ホーム › Graphics.DirectDraw › DD_MOTIONCOMP_LOCAL
DD_MOTIONCOMP_LOCAL
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| lpDD | DD_DIRECTDRAW_LOCAL* | 8/4 | +0 | +0 | 所属するDirectDrawローカルオブジェクトへのポインタ。 |
| guid | GUID | 16 | +8 | +4 | このモーション補償方式を識別するGUID。 |
| dwUncompWidth | DWORD | 4 | +24 | +20 | 非圧縮データの幅をピクセル単位で示す。 |
| dwUncompHeight | DWORD | 4 | +28 | +24 | 非圧縮データの高さをピクセル単位で示す。 |
| ddUncompPixelFormat | DDPIXELFORMAT | 40/32 | +32 | +28 | 非圧縮データのピクセル形式を示すDDPIXELFORMAT。 |
| dwDriverReserved1 | DWORD | 4 | +72 | +60 | ドライバが任意に使用できる予約フィールド1。 |
| dwDriverReserved2 | DWORD | 4 | +76 | +64 | ドライバが任意に使用できる予約フィールド2。 |
| dwDriverReserved3 | DWORD | 4 | +80 | +68 | ドライバが任意に使用できる予約フィールド3。 |
| lpDriverReserved1 | void* | 8/4 | +88 | +72 | ドライバが任意に使用できるポインタ予約1。NULL可。 |
| lpDriverReserved2 | void* | 8/4 | +96 | +76 | ドライバが任意に使用できるポインタ予約2。NULL可。 |
| lpDriverReserved3 | void* | 8/4 | +104 | +80 | ドライバが任意に使用できるポインタ予約3。NULL可。 |
各言語での定義
#include <windows.h>
// DDPIXELFORMAT (x64 40 / x86 32 バイト)
typedef struct DDPIXELFORMAT {
DWORD dwSize;
DWORD dwFlags;
DWORD dwFourCC;
_Anonymous1_e__Union Anonymous1;
_Anonymous2_e__Union Anonymous2;
_Anonymous3_e__Union Anonymous3;
_Anonymous4_e__Union Anonymous4;
_Anonymous5_e__Union Anonymous5;
} DDPIXELFORMAT;
// DD_MOTIONCOMP_LOCAL (x64 112 / x86 84 バイト)
typedef struct DD_MOTIONCOMP_LOCAL {
DD_DIRECTDRAW_LOCAL* lpDD;
GUID guid;
DWORD dwUncompWidth;
DWORD dwUncompHeight;
DDPIXELFORMAT ddUncompPixelFormat;
DWORD dwDriverReserved1;
DWORD dwDriverReserved2;
DWORD dwDriverReserved3;
void* lpDriverReserved1;
void* lpDriverReserved2;
void* lpDriverReserved3;
} DD_MOTIONCOMP_LOCAL;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDPIXELFORMAT
{
public uint dwSize;
public uint dwFlags;
public uint dwFourCC;
public _Anonymous1_e__Union Anonymous1;
public _Anonymous2_e__Union Anonymous2;
public _Anonymous3_e__Union Anonymous3;
public _Anonymous4_e__Union Anonymous4;
public _Anonymous5_e__Union Anonymous5;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DD_MOTIONCOMP_LOCAL
{
public IntPtr lpDD;
public Guid guid;
public uint dwUncompWidth;
public uint dwUncompHeight;
public DDPIXELFORMAT ddUncompPixelFormat;
public uint dwDriverReserved1;
public uint dwDriverReserved2;
public uint dwDriverReserved3;
public IntPtr lpDriverReserved1;
public IntPtr lpDriverReserved2;
public IntPtr lpDriverReserved3;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDPIXELFORMAT
Public dwSize As UInteger
Public dwFlags As UInteger
Public dwFourCC As UInteger
Public Anonymous1 As _Anonymous1_e__Union
Public Anonymous2 As _Anonymous2_e__Union
Public Anonymous3 As _Anonymous3_e__Union
Public Anonymous4 As _Anonymous4_e__Union
Public Anonymous5 As _Anonymous5_e__Union
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DD_MOTIONCOMP_LOCAL
Public lpDD As IntPtr
Public guid As Guid
Public dwUncompWidth As UInteger
Public dwUncompHeight As UInteger
Public ddUncompPixelFormat As DDPIXELFORMAT
Public dwDriverReserved1 As UInteger
Public dwDriverReserved2 As UInteger
Public dwDriverReserved3 As UInteger
Public lpDriverReserved1 As IntPtr
Public lpDriverReserved2 As IntPtr
Public lpDriverReserved3 As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class DDPIXELFORMAT(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("dwFourCC", wintypes.DWORD),
("Anonymous1", _Anonymous1_e__Union),
("Anonymous2", _Anonymous2_e__Union),
("Anonymous3", _Anonymous3_e__Union),
("Anonymous4", _Anonymous4_e__Union),
("Anonymous5", _Anonymous5_e__Union),
]
class DD_MOTIONCOMP_LOCAL(ctypes.Structure):
_fields_ = [
("lpDD", ctypes.c_void_p),
("guid", GUID),
("dwUncompWidth", wintypes.DWORD),
("dwUncompHeight", wintypes.DWORD),
("ddUncompPixelFormat", DDPIXELFORMAT),
("dwDriverReserved1", wintypes.DWORD),
("dwDriverReserved2", wintypes.DWORD),
("dwDriverReserved3", wintypes.DWORD),
("lpDriverReserved1", ctypes.c_void_p),
("lpDriverReserved2", ctypes.c_void_p),
("lpDriverReserved3", ctypes.c_void_p),
]#[repr(C)]
pub struct DDPIXELFORMAT {
pub dwSize: u32,
pub dwFlags: u32,
pub dwFourCC: u32,
pub Anonymous1: _Anonymous1_e__Union,
pub Anonymous2: _Anonymous2_e__Union,
pub Anonymous3: _Anonymous3_e__Union,
pub Anonymous4: _Anonymous4_e__Union,
pub Anonymous5: _Anonymous5_e__Union,
}
#[repr(C)]
pub struct DD_MOTIONCOMP_LOCAL {
pub lpDD: *mut core::ffi::c_void,
pub guid: GUID,
pub dwUncompWidth: u32,
pub dwUncompHeight: u32,
pub ddUncompPixelFormat: DDPIXELFORMAT,
pub dwDriverReserved1: u32,
pub dwDriverReserved2: u32,
pub dwDriverReserved3: u32,
pub lpDriverReserved1: *mut core::ffi::c_void,
pub lpDriverReserved2: *mut core::ffi::c_void,
pub lpDriverReserved3: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type DDPIXELFORMAT struct {
dwSize uint32
dwFlags uint32
dwFourCC uint32
Anonymous1 _Anonymous1_e__Union
Anonymous2 _Anonymous2_e__Union
Anonymous3 _Anonymous3_e__Union
Anonymous4 _Anonymous4_e__Union
Anonymous5 _Anonymous5_e__Union
}
type DD_MOTIONCOMP_LOCAL struct {
lpDD uintptr
guid windows.GUID
dwUncompWidth uint32
dwUncompHeight uint32
ddUncompPixelFormat DDPIXELFORMAT
dwDriverReserved1 uint32
dwDriverReserved2 uint32
dwDriverReserved3 uint32
lpDriverReserved1 uintptr
lpDriverReserved2 uintptr
lpDriverReserved3 uintptr
}type
DDPIXELFORMAT = record
dwSize: DWORD;
dwFlags: DWORD;
dwFourCC: DWORD;
Anonymous1: _Anonymous1_e__Union;
Anonymous2: _Anonymous2_e__Union;
Anonymous3: _Anonymous3_e__Union;
Anonymous4: _Anonymous4_e__Union;
Anonymous5: _Anonymous5_e__Union;
end;
DD_MOTIONCOMP_LOCAL = record
lpDD: Pointer;
guid: TGUID;
dwUncompWidth: DWORD;
dwUncompHeight: DWORD;
ddUncompPixelFormat: DDPIXELFORMAT;
dwDriverReserved1: DWORD;
dwDriverReserved2: DWORD;
dwDriverReserved3: DWORD;
lpDriverReserved1: Pointer;
lpDriverReserved2: Pointer;
lpDriverReserved3: Pointer;
end;const DDPIXELFORMAT = extern struct {
dwSize: u32,
dwFlags: u32,
dwFourCC: u32,
Anonymous1: _Anonymous1_e__Union,
Anonymous2: _Anonymous2_e__Union,
Anonymous3: _Anonymous3_e__Union,
Anonymous4: _Anonymous4_e__Union,
Anonymous5: _Anonymous5_e__Union,
};
const DD_MOTIONCOMP_LOCAL = extern struct {
lpDD: ?*anyopaque,
guid: GUID,
dwUncompWidth: u32,
dwUncompHeight: u32,
ddUncompPixelFormat: DDPIXELFORMAT,
dwDriverReserved1: u32,
dwDriverReserved2: u32,
dwDriverReserved3: u32,
lpDriverReserved1: ?*anyopaque,
lpDriverReserved2: ?*anyopaque,
lpDriverReserved3: ?*anyopaque,
};type
DDPIXELFORMAT {.bycopy.} = object
dwSize: uint32
dwFlags: uint32
dwFourCC: uint32
Anonymous1: _Anonymous1_e__Union
Anonymous2: _Anonymous2_e__Union
Anonymous3: _Anonymous3_e__Union
Anonymous4: _Anonymous4_e__Union
Anonymous5: _Anonymous5_e__Union
DD_MOTIONCOMP_LOCAL {.bycopy.} = object
lpDD: pointer
guid: GUID
dwUncompWidth: uint32
dwUncompHeight: uint32
ddUncompPixelFormat: DDPIXELFORMAT
dwDriverReserved1: uint32
dwDriverReserved2: uint32
dwDriverReserved3: uint32
lpDriverReserved1: pointer
lpDriverReserved2: pointer
lpDriverReserved3: pointerstruct DDPIXELFORMAT
{
uint dwSize;
uint dwFlags;
uint dwFourCC;
_Anonymous1_e__Union Anonymous1;
_Anonymous2_e__Union Anonymous2;
_Anonymous3_e__Union Anonymous3;
_Anonymous4_e__Union Anonymous4;
_Anonymous5_e__Union Anonymous5;
}
struct DD_MOTIONCOMP_LOCAL
{
void* lpDD;
GUID guid;
uint dwUncompWidth;
uint dwUncompHeight;
DDPIXELFORMAT ddUncompPixelFormat;
uint dwDriverReserved1;
uint dwDriverReserved2;
uint dwDriverReserved3;
void* lpDriverReserved1;
void* lpDriverReserved2;
void* lpDriverReserved3;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DD_MOTIONCOMP_LOCAL サイズ: 84 バイト(x86)
dim st, 21 ; 4byte整数×21(構造体サイズ 84 / 4 切り上げ)
; lpDD : DD_DIRECTDRAW_LOCAL* (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; guid : GUID (+4, 16byte) varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; dwUncompWidth : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwUncompHeight : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ddUncompPixelFormat : DDPIXELFORMAT (+28, 32byte) varptr(st)+28 を基点に操作(32byte:入れ子/配列)
; dwDriverReserved1 : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; dwDriverReserved2 : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; dwDriverReserved3 : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; lpDriverReserved1 : void* (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; lpDriverReserved2 : void* (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; lpDriverReserved3 : void* (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DD_MOTIONCOMP_LOCAL サイズ: 112 バイト(x64)
dim st, 28 ; 4byte整数×28(構造体サイズ 112 / 4 切り上げ)
; lpDD : DD_DIRECTDRAW_LOCAL* (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; guid : GUID (+8, 16byte) varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; dwUncompWidth : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwUncompHeight : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ddUncompPixelFormat : DDPIXELFORMAT (+32, 40byte) varptr(st)+32 を基点に操作(40byte:入れ子/配列)
; dwDriverReserved1 : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; dwDriverReserved2 : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; dwDriverReserved3 : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; lpDriverReserved1 : void* (+88, 8byte) qpoke st,88,値 / qpeek(st,88) ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; lpDriverReserved2 : void* (+96, 8byte) qpoke st,96,値 / qpeek(st,96) ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; lpDriverReserved3 : void* (+104, 8byte) qpoke st,104,値 / qpeek(st,104) ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global DDPIXELFORMAT
#field int dwSize
#field int dwFlags
#field int dwFourCC
#field byte Anonymous1 4
#field byte Anonymous2 4
#field byte Anonymous3 8
#field byte Anonymous4 4
#field byte Anonymous5 4
#endstruct
#defstruct global DD_MOTIONCOMP_LOCAL
#field intptr lpDD
#field GUID guid
#field int dwUncompWidth
#field int dwUncompHeight
#field DDPIXELFORMAT ddUncompPixelFormat
#field int dwDriverReserved1
#field int dwDriverReserved2
#field int dwDriverReserved3
#field intptr lpDriverReserved1
#field intptr lpDriverReserved2
#field intptr lpDriverReserved3
#endstruct
stdim st, DD_MOTIONCOMP_LOCAL ; NSTRUCT 変数を確保
st->dwUncompWidth = 100
mes "dwUncompWidth=" + st->dwUncompWidth