Win32 API 日本語リファレンス
ホームMedia.MediaFoundation › MFCameraIntrinsic_DistortionModelArcTan

MFCameraIntrinsic_DistortionModelArcTan

構造体
サイズx64: 20 バイト / x86: 20 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
Radial_k0FLOAT4+0+0ArcTanモデルの半径方向歪み係数k0。
DistortionCenter_xFLOAT4+4+4歪み中心のX座標。
DistortionCenter_yFLOAT4+8+8歪み中心のY座標。
Tangential_xFLOAT4+12+12X方向の接線歪み係数。
Tangential_yFLOAT4+16+16Y方向の接線歪み係数。

各言語での定義

#include <windows.h>

// MFCameraIntrinsic_DistortionModelArcTan  (x64 20 / x86 20 バイト)
typedef struct MFCameraIntrinsic_DistortionModelArcTan {
    FLOAT Radial_k0;
    FLOAT DistortionCenter_x;
    FLOAT DistortionCenter_y;
    FLOAT Tangential_x;
    FLOAT Tangential_y;
} MFCameraIntrinsic_DistortionModelArcTan;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MFCameraIntrinsic_DistortionModelArcTan
{
    public float Radial_k0;
    public float DistortionCenter_x;
    public float DistortionCenter_y;
    public float Tangential_x;
    public float Tangential_y;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MFCameraIntrinsic_DistortionModelArcTan
    Public Radial_k0 As Single
    Public DistortionCenter_x As Single
    Public DistortionCenter_y As Single
    Public Tangential_x As Single
    Public Tangential_y As Single
End Structure
import ctypes
from ctypes import wintypes

class MFCameraIntrinsic_DistortionModelArcTan(ctypes.Structure):
    _fields_ = [
        ("Radial_k0", ctypes.c_float),
        ("DistortionCenter_x", ctypes.c_float),
        ("DistortionCenter_y", ctypes.c_float),
        ("Tangential_x", ctypes.c_float),
        ("Tangential_y", ctypes.c_float),
    ]
#[repr(C)]
pub struct MFCameraIntrinsic_DistortionModelArcTan {
    pub Radial_k0: f32,
    pub DistortionCenter_x: f32,
    pub DistortionCenter_y: f32,
    pub Tangential_x: f32,
    pub Tangential_y: f32,
}
import "golang.org/x/sys/windows"

type MFCameraIntrinsic_DistortionModelArcTan struct {
	Radial_k0 float32
	DistortionCenter_x float32
	DistortionCenter_y float32
	Tangential_x float32
	Tangential_y float32
}
type
  MFCameraIntrinsic_DistortionModelArcTan = record
    Radial_k0: Single;
    DistortionCenter_x: Single;
    DistortionCenter_y: Single;
    Tangential_x: Single;
    Tangential_y: Single;
  end;
const MFCameraIntrinsic_DistortionModelArcTan = extern struct {
    Radial_k0: f32,
    DistortionCenter_x: f32,
    DistortionCenter_y: f32,
    Tangential_x: f32,
    Tangential_y: f32,
};
type
  MFCameraIntrinsic_DistortionModelArcTan {.bycopy.} = object
    Radial_k0: float32
    DistortionCenter_x: float32
    DistortionCenter_y: float32
    Tangential_x: float32
    Tangential_y: float32
struct MFCameraIntrinsic_DistortionModelArcTan
{
    float Radial_k0;
    float DistortionCenter_x;
    float DistortionCenter_y;
    float Tangential_x;
    float Tangential_y;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MFCameraIntrinsic_DistortionModelArcTan サイズ: 20 バイト(x64)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; Radial_k0 : FLOAT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; DistortionCenter_x : FLOAT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; DistortionCenter_y : FLOAT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Tangential_x : FLOAT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Tangential_y : FLOAT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MFCameraIntrinsic_DistortionModelArcTan
    #field float Radial_k0
    #field float DistortionCenter_x
    #field float DistortionCenter_y
    #field float Tangential_x
    #field float Tangential_y
#endstruct

stdim st, MFCameraIntrinsic_DistortionModelArcTan        ; NSTRUCT 変数を確保
st->Radial_k0 = 100
mes "Radial_k0=" + st->Radial_k0