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

WMT_VIDEOIMAGE_SAMPLE

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

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

フィールド

フィールドサイズx64x86説明
dwMagicDWORD4+0+0構造体識別用のマジック値。
cbStructDWORD4+4+4この構造体のサイズをバイトで示す。
dwControlFlagsDWORD4+8+8画像変換の制御フラグ。
dwInputFlagsCurDWORD4+12+12現フレームの入力フラグ。
lCurMotionXtoXINT4+16+16現フレームのアフィン変換係数(X→X、固定小数点)。
lCurMotionYtoXINT4+20+20現フレームのアフィン変換係数(Y→X、固定小数点)。
lCurMotionXoffsetINT4+24+24現フレームのX方向移動量(固定小数点)。
lCurMotionXtoYINT4+28+28現フレームのアフィン変換係数(X→Y、固定小数点)。
lCurMotionYtoYINT4+32+32現フレームのアフィン変換係数(Y→Y、固定小数点)。
lCurMotionYoffsetINT4+36+36現フレームのY方向移動量(固定小数点)。
lCurBlendCoef1INT4+40+40現フレームのブレンド係数1(固定小数点)。
lCurBlendCoef2INT4+44+44現フレームのブレンド係数2(固定小数点)。
dwInputFlagsPrevDWORD4+48+48前フレームの入力フラグ。
lPrevMotionXtoXINT4+52+52前フレームのアフィン変換係数(X→X、固定小数点)。
lPrevMotionYtoXINT4+56+56前フレームのアフィン変換係数(Y→X、固定小数点)。
lPrevMotionXoffsetINT4+60+60前フレームのX方向移動量(固定小数点)。
lPrevMotionXtoYINT4+64+64前フレームのアフィン変換係数(X→Y、固定小数点)。
lPrevMotionYtoYINT4+68+68前フレームのアフィン変換係数(Y→Y、固定小数点)。
lPrevMotionYoffsetINT4+72+72前フレームのY方向移動量(固定小数点)。
lPrevBlendCoef1INT4+76+76前フレームのブレンド係数1(固定小数点)。
lPrevBlendCoef2INT4+80+80前フレームのブレンド係数2(固定小数点)。

各言語での定義

#include <windows.h>

// WMT_VIDEOIMAGE_SAMPLE  (x64 84 / x86 84 バイト)
typedef struct WMT_VIDEOIMAGE_SAMPLE {
    DWORD dwMagic;
    DWORD cbStruct;
    DWORD dwControlFlags;
    DWORD dwInputFlagsCur;
    INT lCurMotionXtoX;
    INT lCurMotionYtoX;
    INT lCurMotionXoffset;
    INT lCurMotionXtoY;
    INT lCurMotionYtoY;
    INT lCurMotionYoffset;
    INT lCurBlendCoef1;
    INT lCurBlendCoef2;
    DWORD dwInputFlagsPrev;
    INT lPrevMotionXtoX;
    INT lPrevMotionYtoX;
    INT lPrevMotionXoffset;
    INT lPrevMotionXtoY;
    INT lPrevMotionYtoY;
    INT lPrevMotionYoffset;
    INT lPrevBlendCoef1;
    INT lPrevBlendCoef2;
} WMT_VIDEOIMAGE_SAMPLE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WMT_VIDEOIMAGE_SAMPLE
{
    public uint dwMagic;
    public uint cbStruct;
    public uint dwControlFlags;
    public uint dwInputFlagsCur;
    public int lCurMotionXtoX;
    public int lCurMotionYtoX;
    public int lCurMotionXoffset;
    public int lCurMotionXtoY;
    public int lCurMotionYtoY;
    public int lCurMotionYoffset;
    public int lCurBlendCoef1;
    public int lCurBlendCoef2;
    public uint dwInputFlagsPrev;
    public int lPrevMotionXtoX;
    public int lPrevMotionYtoX;
    public int lPrevMotionXoffset;
    public int lPrevMotionXtoY;
    public int lPrevMotionYtoY;
    public int lPrevMotionYoffset;
    public int lPrevBlendCoef1;
    public int lPrevBlendCoef2;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WMT_VIDEOIMAGE_SAMPLE
    Public dwMagic As UInteger
    Public cbStruct As UInteger
    Public dwControlFlags As UInteger
    Public dwInputFlagsCur As UInteger
    Public lCurMotionXtoX As Integer
    Public lCurMotionYtoX As Integer
    Public lCurMotionXoffset As Integer
    Public lCurMotionXtoY As Integer
    Public lCurMotionYtoY As Integer
    Public lCurMotionYoffset As Integer
    Public lCurBlendCoef1 As Integer
    Public lCurBlendCoef2 As Integer
    Public dwInputFlagsPrev As UInteger
    Public lPrevMotionXtoX As Integer
    Public lPrevMotionYtoX As Integer
    Public lPrevMotionXoffset As Integer
    Public lPrevMotionXtoY As Integer
    Public lPrevMotionYtoY As Integer
    Public lPrevMotionYoffset As Integer
    Public lPrevBlendCoef1 As Integer
    Public lPrevBlendCoef2 As Integer
End Structure
import ctypes
from ctypes import wintypes

class WMT_VIDEOIMAGE_SAMPLE(ctypes.Structure):
    _fields_ = [
        ("dwMagic", wintypes.DWORD),
        ("cbStruct", wintypes.DWORD),
        ("dwControlFlags", wintypes.DWORD),
        ("dwInputFlagsCur", wintypes.DWORD),
        ("lCurMotionXtoX", ctypes.c_int),
        ("lCurMotionYtoX", ctypes.c_int),
        ("lCurMotionXoffset", ctypes.c_int),
        ("lCurMotionXtoY", ctypes.c_int),
        ("lCurMotionYtoY", ctypes.c_int),
        ("lCurMotionYoffset", ctypes.c_int),
        ("lCurBlendCoef1", ctypes.c_int),
        ("lCurBlendCoef2", ctypes.c_int),
        ("dwInputFlagsPrev", wintypes.DWORD),
        ("lPrevMotionXtoX", ctypes.c_int),
        ("lPrevMotionYtoX", ctypes.c_int),
        ("lPrevMotionXoffset", ctypes.c_int),
        ("lPrevMotionXtoY", ctypes.c_int),
        ("lPrevMotionYtoY", ctypes.c_int),
        ("lPrevMotionYoffset", ctypes.c_int),
        ("lPrevBlendCoef1", ctypes.c_int),
        ("lPrevBlendCoef2", ctypes.c_int),
    ]
#[repr(C)]
pub struct WMT_VIDEOIMAGE_SAMPLE {
    pub dwMagic: u32,
    pub cbStruct: u32,
    pub dwControlFlags: u32,
    pub dwInputFlagsCur: u32,
    pub lCurMotionXtoX: i32,
    pub lCurMotionYtoX: i32,
    pub lCurMotionXoffset: i32,
    pub lCurMotionXtoY: i32,
    pub lCurMotionYtoY: i32,
    pub lCurMotionYoffset: i32,
    pub lCurBlendCoef1: i32,
    pub lCurBlendCoef2: i32,
    pub dwInputFlagsPrev: u32,
    pub lPrevMotionXtoX: i32,
    pub lPrevMotionYtoX: i32,
    pub lPrevMotionXoffset: i32,
    pub lPrevMotionXtoY: i32,
    pub lPrevMotionYtoY: i32,
    pub lPrevMotionYoffset: i32,
    pub lPrevBlendCoef1: i32,
    pub lPrevBlendCoef2: i32,
}
import "golang.org/x/sys/windows"

type WMT_VIDEOIMAGE_SAMPLE struct {
	dwMagic uint32
	cbStruct uint32
	dwControlFlags uint32
	dwInputFlagsCur uint32
	lCurMotionXtoX int32
	lCurMotionYtoX int32
	lCurMotionXoffset int32
	lCurMotionXtoY int32
	lCurMotionYtoY int32
	lCurMotionYoffset int32
	lCurBlendCoef1 int32
	lCurBlendCoef2 int32
	dwInputFlagsPrev uint32
	lPrevMotionXtoX int32
	lPrevMotionYtoX int32
	lPrevMotionXoffset int32
	lPrevMotionXtoY int32
	lPrevMotionYtoY int32
	lPrevMotionYoffset int32
	lPrevBlendCoef1 int32
	lPrevBlendCoef2 int32
}
type
  WMT_VIDEOIMAGE_SAMPLE = record
    dwMagic: DWORD;
    cbStruct: DWORD;
    dwControlFlags: DWORD;
    dwInputFlagsCur: DWORD;
    lCurMotionXtoX: Integer;
    lCurMotionYtoX: Integer;
    lCurMotionXoffset: Integer;
    lCurMotionXtoY: Integer;
    lCurMotionYtoY: Integer;
    lCurMotionYoffset: Integer;
    lCurBlendCoef1: Integer;
    lCurBlendCoef2: Integer;
    dwInputFlagsPrev: DWORD;
    lPrevMotionXtoX: Integer;
    lPrevMotionYtoX: Integer;
    lPrevMotionXoffset: Integer;
    lPrevMotionXtoY: Integer;
    lPrevMotionYtoY: Integer;
    lPrevMotionYoffset: Integer;
    lPrevBlendCoef1: Integer;
    lPrevBlendCoef2: Integer;
  end;
const WMT_VIDEOIMAGE_SAMPLE = extern struct {
    dwMagic: u32,
    cbStruct: u32,
    dwControlFlags: u32,
    dwInputFlagsCur: u32,
    lCurMotionXtoX: i32,
    lCurMotionYtoX: i32,
    lCurMotionXoffset: i32,
    lCurMotionXtoY: i32,
    lCurMotionYtoY: i32,
    lCurMotionYoffset: i32,
    lCurBlendCoef1: i32,
    lCurBlendCoef2: i32,
    dwInputFlagsPrev: u32,
    lPrevMotionXtoX: i32,
    lPrevMotionYtoX: i32,
    lPrevMotionXoffset: i32,
    lPrevMotionXtoY: i32,
    lPrevMotionYtoY: i32,
    lPrevMotionYoffset: i32,
    lPrevBlendCoef1: i32,
    lPrevBlendCoef2: i32,
};
type
  WMT_VIDEOIMAGE_SAMPLE {.bycopy.} = object
    dwMagic: uint32
    cbStruct: uint32
    dwControlFlags: uint32
    dwInputFlagsCur: uint32
    lCurMotionXtoX: int32
    lCurMotionYtoX: int32
    lCurMotionXoffset: int32
    lCurMotionXtoY: int32
    lCurMotionYtoY: int32
    lCurMotionYoffset: int32
    lCurBlendCoef1: int32
    lCurBlendCoef2: int32
    dwInputFlagsPrev: uint32
    lPrevMotionXtoX: int32
    lPrevMotionYtoX: int32
    lPrevMotionXoffset: int32
    lPrevMotionXtoY: int32
    lPrevMotionYtoY: int32
    lPrevMotionYoffset: int32
    lPrevBlendCoef1: int32
    lPrevBlendCoef2: int32
struct WMT_VIDEOIMAGE_SAMPLE
{
    uint dwMagic;
    uint cbStruct;
    uint dwControlFlags;
    uint dwInputFlagsCur;
    int lCurMotionXtoX;
    int lCurMotionYtoX;
    int lCurMotionXoffset;
    int lCurMotionXtoY;
    int lCurMotionYtoY;
    int lCurMotionYoffset;
    int lCurBlendCoef1;
    int lCurBlendCoef2;
    uint dwInputFlagsPrev;
    int lPrevMotionXtoX;
    int lPrevMotionYtoX;
    int lPrevMotionXoffset;
    int lPrevMotionXtoY;
    int lPrevMotionYtoY;
    int lPrevMotionYoffset;
    int lPrevBlendCoef1;
    int lPrevBlendCoef2;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WMT_VIDEOIMAGE_SAMPLE サイズ: 84 バイト(x64)
dim st, 21    ; 4byte整数×21(構造体サイズ 84 / 4 切り上げ)
; dwMagic : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; cbStruct : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwControlFlags : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwInputFlagsCur : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; lCurMotionXtoX : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; lCurMotionYtoX : INT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; lCurMotionXoffset : INT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; lCurMotionXtoY : INT (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; lCurMotionYtoY : INT (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; lCurMotionYoffset : INT (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; lCurBlendCoef1 : INT (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; lCurBlendCoef2 : INT (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; dwInputFlagsPrev : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; lPrevMotionXtoX : INT (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; lPrevMotionYtoX : INT (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; lPrevMotionXoffset : INT (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; lPrevMotionXtoY : INT (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; lPrevMotionYtoY : INT (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; lPrevMotionYoffset : INT (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; lPrevBlendCoef1 : INT (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; lPrevBlendCoef2 : INT (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WMT_VIDEOIMAGE_SAMPLE
    #field int dwMagic
    #field int cbStruct
    #field int dwControlFlags
    #field int dwInputFlagsCur
    #field int lCurMotionXtoX
    #field int lCurMotionYtoX
    #field int lCurMotionXoffset
    #field int lCurMotionXtoY
    #field int lCurMotionYtoY
    #field int lCurMotionYoffset
    #field int lCurBlendCoef1
    #field int lCurBlendCoef2
    #field int dwInputFlagsPrev
    #field int lPrevMotionXtoX
    #field int lPrevMotionYtoX
    #field int lPrevMotionXoffset
    #field int lPrevMotionXtoY
    #field int lPrevMotionYtoY
    #field int lPrevMotionYoffset
    #field int lPrevBlendCoef1
    #field int lPrevBlendCoef2
#endstruct

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