ホーム › Graphics.DirectDraw › DDHAL_COLORCONTROLDATA
DDHAL_COLORCONTROLDATA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| lpDD | DDRAWI_DIRECTDRAW_GBL* | 8/4 | +0 | +0 | 対象のグローバルDirectDrawオブジェクトへのポインタ。 |
| lpDDSurface | DDRAWI_DDRAWSURFACE_LCL* | 8/4 | +8 | +4 | 色調整を行う対象サーフェスへのポインタを示す。 |
| lpColorData | DDCOLORCONTROL* | 8/4 | +16 | +8 | 色調整情報(DDCOLORCONTROL)へのポインタ。 |
| dwFlags | DWORD | 4 | +24 | +12 | 色調整の取得か設定かを示すフラグを示す。 |
| ddRVal | HRESULT | 4 | +28 | +16 | 色調整処理の実行結果を示すHRESULT。 |
| ColorControl | LPDDHALCOLORCB_COLORCONTROL | 8/4 | +32 | +20 | 実際の色調整を行うコールバックへのポインタ。 |
各言語での定義
#include <windows.h>
// DDHAL_COLORCONTROLDATA (x64 40 / x86 24 バイト)
typedef struct DDHAL_COLORCONTROLDATA {
DDRAWI_DIRECTDRAW_GBL* lpDD;
DDRAWI_DDRAWSURFACE_LCL* lpDDSurface;
DDCOLORCONTROL* lpColorData;
DWORD dwFlags;
HRESULT ddRVal;
LPDDHALCOLORCB_COLORCONTROL ColorControl;
} DDHAL_COLORCONTROLDATA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDHAL_COLORCONTROLDATA
{
public IntPtr lpDD;
public IntPtr lpDDSurface;
public IntPtr lpColorData;
public uint dwFlags;
public int ddRVal;
public IntPtr ColorControl;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDHAL_COLORCONTROLDATA
Public lpDD As IntPtr
Public lpDDSurface As IntPtr
Public lpColorData As IntPtr
Public dwFlags As UInteger
Public ddRVal As Integer
Public ColorControl As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class DDHAL_COLORCONTROLDATA(ctypes.Structure):
_fields_ = [
("lpDD", ctypes.c_void_p),
("lpDDSurface", ctypes.c_void_p),
("lpColorData", ctypes.c_void_p),
("dwFlags", wintypes.DWORD),
("ddRVal", ctypes.c_int),
("ColorControl", ctypes.c_void_p),
]#[repr(C)]
pub struct DDHAL_COLORCONTROLDATA {
pub lpDD: *mut core::ffi::c_void,
pub lpDDSurface: *mut core::ffi::c_void,
pub lpColorData: *mut core::ffi::c_void,
pub dwFlags: u32,
pub ddRVal: i32,
pub ColorControl: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type DDHAL_COLORCONTROLDATA struct {
lpDD uintptr
lpDDSurface uintptr
lpColorData uintptr
dwFlags uint32
ddRVal int32
ColorControl uintptr
}type
DDHAL_COLORCONTROLDATA = record
lpDD: Pointer;
lpDDSurface: Pointer;
lpColorData: Pointer;
dwFlags: DWORD;
ddRVal: Integer;
ColorControl: Pointer;
end;const DDHAL_COLORCONTROLDATA = extern struct {
lpDD: ?*anyopaque,
lpDDSurface: ?*anyopaque,
lpColorData: ?*anyopaque,
dwFlags: u32,
ddRVal: i32,
ColorControl: ?*anyopaque,
};type
DDHAL_COLORCONTROLDATA {.bycopy.} = object
lpDD: pointer
lpDDSurface: pointer
lpColorData: pointer
dwFlags: uint32
ddRVal: int32
ColorControl: pointerstruct DDHAL_COLORCONTROLDATA
{
void* lpDD;
void* lpDDSurface;
void* lpColorData;
uint dwFlags;
int ddRVal;
void* ColorControl;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DDHAL_COLORCONTROLDATA サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; lpDD : DDRAWI_DIRECTDRAW_GBL* (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; lpDDSurface : DDRAWI_DDRAWSURFACE_LCL* (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; lpColorData : DDCOLORCONTROL* (+8, 4byte) varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; dwFlags : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ddRVal : HRESULT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ColorControl : LPDDHALCOLORCB_COLORCONTROL (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DDHAL_COLORCONTROLDATA サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; lpDD : DDRAWI_DIRECTDRAW_GBL* (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; lpDDSurface : DDRAWI_DDRAWSURFACE_LCL* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; lpColorData : DDCOLORCONTROL* (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; dwFlags : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ddRVal : HRESULT (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ColorControl : LPDDHALCOLORCB_COLORCONTROL (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DDHAL_COLORCONTROLDATA
#field intptr lpDD
#field intptr lpDDSurface
#field intptr lpColorData
#field int dwFlags
#field int ddRVal
#field intptr ColorControl
#endstruct
stdim st, DDHAL_COLORCONTROLDATA ; NSTRUCT 変数を確保
st->dwFlags = 100
mes "dwFlags=" + st->dwFlags