ホーム › Graphics.DirectDraw › DDVIDEOPORTINFO
DDVIDEOPORTINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | 構造体サイズ(バイト数)。呼び出し前に設定する。 |
| dwOriginX | DWORD | 4 | +4 | +4 | 転送先サーフェス内の表示開始X座標を示す。 |
| dwOriginY | DWORD | 4 | +8 | +8 | 転送先サーフェス内の表示開始Y座標を示す。 |
| dwVPFlags | DWORD | 4 | +12 | +12 | ビデオポート動作を制御するDDVP_系フラグの組み合わせ。 |
| rCrop | RECT | 16 | +16 | +16 | 入力映像から切り出すクロップ矩形(RECT)。 |
| dwPrescaleWidth | DWORD | 4 | +32 | +32 | プリスケール後の幅(ピクセル)を示す。 |
| dwPrescaleHeight | DWORD | 4 | +36 | +36 | プリスケール後の高さ(ライン)を示す。 |
| lpddpfInputFormat | DDPIXELFORMAT* | 8/4 | +40 | +40 | 入力映像のピクセル形式へのポインタ(DDPIXELFORMAT*)。 |
| lpddpfVBIInputFormat | DDPIXELFORMAT* | 8/4 | +48 | +44 | VBI入力のピクセル形式へのポインタ。NULL可。 |
| lpddpfVBIOutputFormat | DDPIXELFORMAT* | 8/4 | +56 | +48 | VBI出力のピクセル形式へのポインタ。NULL可。 |
| dwVBIHeight | DWORD | 4 | +64 | +52 | VBIデータの高さ(ライン)を示す。 |
| dwReserved1 | UINT_PTR | 8/4 | +72 | +56 | 予約フィールド。0とする。 |
| dwReserved2 | UINT_PTR | 8/4 | +80 | +60 | 予約フィールド。0とする。 |
各言語での定義
#include <windows.h>
// RECT (x64 16 / x86 16 バイト)
typedef struct RECT {
INT left;
INT top;
INT right;
INT bottom;
} RECT;
// DDVIDEOPORTINFO (x64 88 / x86 64 バイト)
typedef struct DDVIDEOPORTINFO {
DWORD dwSize;
DWORD dwOriginX;
DWORD dwOriginY;
DWORD dwVPFlags;
RECT rCrop;
DWORD dwPrescaleWidth;
DWORD dwPrescaleHeight;
DDPIXELFORMAT* lpddpfInputFormat;
DDPIXELFORMAT* lpddpfVBIInputFormat;
DDPIXELFORMAT* lpddpfVBIOutputFormat;
DWORD dwVBIHeight;
UINT_PTR dwReserved1;
UINT_PTR dwReserved2;
} DDVIDEOPORTINFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDVIDEOPORTINFO
{
public uint dwSize;
public uint dwOriginX;
public uint dwOriginY;
public uint dwVPFlags;
public RECT rCrop;
public uint dwPrescaleWidth;
public uint dwPrescaleHeight;
public IntPtr lpddpfInputFormat;
public IntPtr lpddpfVBIInputFormat;
public IntPtr lpddpfVBIOutputFormat;
public uint dwVBIHeight;
public UIntPtr dwReserved1;
public UIntPtr dwReserved2;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECT
Public left As Integer
Public top As Integer
Public right As Integer
Public bottom As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDVIDEOPORTINFO
Public dwSize As UInteger
Public dwOriginX As UInteger
Public dwOriginY As UInteger
Public dwVPFlags As UInteger
Public rCrop As RECT
Public dwPrescaleWidth As UInteger
Public dwPrescaleHeight As UInteger
Public lpddpfInputFormat As IntPtr
Public lpddpfVBIInputFormat As IntPtr
Public lpddpfVBIOutputFormat As IntPtr
Public dwVBIHeight As UInteger
Public dwReserved1 As UIntPtr
Public dwReserved2 As UIntPtr
End Structureimport ctypes
from ctypes import wintypes
class RECT(ctypes.Structure):
_fields_ = [
("left", ctypes.c_int),
("top", ctypes.c_int),
("right", ctypes.c_int),
("bottom", ctypes.c_int),
]
class DDVIDEOPORTINFO(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwOriginX", wintypes.DWORD),
("dwOriginY", wintypes.DWORD),
("dwVPFlags", wintypes.DWORD),
("rCrop", RECT),
("dwPrescaleWidth", wintypes.DWORD),
("dwPrescaleHeight", wintypes.DWORD),
("lpddpfInputFormat", ctypes.c_void_p),
("lpddpfVBIInputFormat", ctypes.c_void_p),
("lpddpfVBIOutputFormat", ctypes.c_void_p),
("dwVBIHeight", wintypes.DWORD),
("dwReserved1", ctypes.c_size_t),
("dwReserved2", ctypes.c_size_t),
]#[repr(C)]
pub struct RECT {
pub left: i32,
pub top: i32,
pub right: i32,
pub bottom: i32,
}
#[repr(C)]
pub struct DDVIDEOPORTINFO {
pub dwSize: u32,
pub dwOriginX: u32,
pub dwOriginY: u32,
pub dwVPFlags: u32,
pub rCrop: RECT,
pub dwPrescaleWidth: u32,
pub dwPrescaleHeight: u32,
pub lpddpfInputFormat: *mut core::ffi::c_void,
pub lpddpfVBIInputFormat: *mut core::ffi::c_void,
pub lpddpfVBIOutputFormat: *mut core::ffi::c_void,
pub dwVBIHeight: u32,
pub dwReserved1: usize,
pub dwReserved2: usize,
}import "golang.org/x/sys/windows"
type RECT struct {
left int32
top int32
right int32
bottom int32
}
type DDVIDEOPORTINFO struct {
dwSize uint32
dwOriginX uint32
dwOriginY uint32
dwVPFlags uint32
rCrop RECT
dwPrescaleWidth uint32
dwPrescaleHeight uint32
lpddpfInputFormat uintptr
lpddpfVBIInputFormat uintptr
lpddpfVBIOutputFormat uintptr
dwVBIHeight uint32
dwReserved1 uintptr
dwReserved2 uintptr
}type
RECT = record
left: Integer;
top: Integer;
right: Integer;
bottom: Integer;
end;
DDVIDEOPORTINFO = record
dwSize: DWORD;
dwOriginX: DWORD;
dwOriginY: DWORD;
dwVPFlags: DWORD;
rCrop: RECT;
dwPrescaleWidth: DWORD;
dwPrescaleHeight: DWORD;
lpddpfInputFormat: Pointer;
lpddpfVBIInputFormat: Pointer;
lpddpfVBIOutputFormat: Pointer;
dwVBIHeight: DWORD;
dwReserved1: NativeUInt;
dwReserved2: NativeUInt;
end;const RECT = extern struct {
left: i32,
top: i32,
right: i32,
bottom: i32,
};
const DDVIDEOPORTINFO = extern struct {
dwSize: u32,
dwOriginX: u32,
dwOriginY: u32,
dwVPFlags: u32,
rCrop: RECT,
dwPrescaleWidth: u32,
dwPrescaleHeight: u32,
lpddpfInputFormat: ?*anyopaque,
lpddpfVBIInputFormat: ?*anyopaque,
lpddpfVBIOutputFormat: ?*anyopaque,
dwVBIHeight: u32,
dwReserved1: usize,
dwReserved2: usize,
};type
RECT {.bycopy.} = object
left: int32
top: int32
right: int32
bottom: int32
DDVIDEOPORTINFO {.bycopy.} = object
dwSize: uint32
dwOriginX: uint32
dwOriginY: uint32
dwVPFlags: uint32
rCrop: RECT
dwPrescaleWidth: uint32
dwPrescaleHeight: uint32
lpddpfInputFormat: pointer
lpddpfVBIInputFormat: pointer
lpddpfVBIOutputFormat: pointer
dwVBIHeight: uint32
dwReserved1: uint
dwReserved2: uintstruct RECT
{
int left;
int top;
int right;
int bottom;
}
struct DDVIDEOPORTINFO
{
uint dwSize;
uint dwOriginX;
uint dwOriginY;
uint dwVPFlags;
RECT rCrop;
uint dwPrescaleWidth;
uint dwPrescaleHeight;
void* lpddpfInputFormat;
void* lpddpfVBIInputFormat;
void* lpddpfVBIOutputFormat;
uint dwVBIHeight;
size_t dwReserved1;
size_t dwReserved2;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DDVIDEOPORTINFO サイズ: 64 バイト(x86)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwOriginX : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwOriginY : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwVPFlags : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; rCrop : RECT (+16, 16byte) varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; dwPrescaleWidth : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; dwPrescaleHeight : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; lpddpfInputFormat : DDPIXELFORMAT* (+40, 4byte) varptr(st)+40 を基点に操作(4byte:入れ子/配列)
; lpddpfVBIInputFormat : DDPIXELFORMAT* (+44, 4byte) varptr(st)+44 を基点に操作(4byte:入れ子/配列)
; lpddpfVBIOutputFormat : DDPIXELFORMAT* (+48, 4byte) varptr(st)+48 を基点に操作(4byte:入れ子/配列)
; dwVBIHeight : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; dwReserved1 : UINT_PTR (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; dwReserved2 : UINT_PTR (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DDVIDEOPORTINFO サイズ: 88 バイト(x64)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwOriginX : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwOriginY : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwVPFlags : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; rCrop : RECT (+16, 16byte) varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; dwPrescaleWidth : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; dwPrescaleHeight : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; lpddpfInputFormat : DDPIXELFORMAT* (+40, 8byte) varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; lpddpfVBIInputFormat : DDPIXELFORMAT* (+48, 8byte) varptr(st)+48 を基点に操作(8byte:入れ子/配列)
; lpddpfVBIOutputFormat : DDPIXELFORMAT* (+56, 8byte) varptr(st)+56 を基点に操作(8byte:入れ子/配列)
; dwVBIHeight : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; dwReserved1 : UINT_PTR (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; dwReserved2 : UINT_PTR (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global RECT
#field int left
#field int top
#field int right
#field int bottom
#endstruct
#defstruct global DDVIDEOPORTINFO
#field int dwSize
#field int dwOriginX
#field int dwOriginY
#field int dwVPFlags
#field RECT rCrop
#field int dwPrescaleWidth
#field int dwPrescaleHeight
#field intptr lpddpfInputFormat
#field intptr lpddpfVBIInputFormat
#field intptr lpddpfVBIOutputFormat
#field int dwVBIHeight
#field intptr dwReserved1
#field intptr dwReserved2
#endstruct
stdim st, DDVIDEOPORTINFO ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize