ホーム › Devices.Display › COLORSPACE_TRANSFORM
COLORSPACE_TRANSFORM
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Type | COLORSPACE_TRANSFORM_TYPE | 4 | +0 | +0 | 色空間変換の種類を示す列挙値。Dataの解釈を決定する。 |
| Data | _Data_e__Union | 98352 | +4 | +4 | 変換種類ごとの具体的なパラメータを保持する無名共用体。 |
共用体: _Data_e__Union x64 98352B / x86 98352B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| Rgb256x3x16 | GAMMA_RAMP_RGB256x3x16 | 1536 | +0 | +0 |
| Dxgi1 | GAMMA_RAMP_DXGI_1 | 12324 | +0 | +0 |
| T3x4 | COLORSPACE_TRANSFORM_3x4 | 49204 | +0 | +0 |
| MatrixV2 | COLORSPACE_TRANSFORM_MATRIX_V2 | 98352 | +0 | +0 |
各言語での定義
#include <windows.h>
// COLORSPACE_TRANSFORM (x64 98356 / x86 98356 バイト)
typedef struct COLORSPACE_TRANSFORM {
COLORSPACE_TRANSFORM_TYPE Type;
_Data_e__Union Data;
} COLORSPACE_TRANSFORM;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct COLORSPACE_TRANSFORM
{
public int Type;
public _Data_e__Union Data;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure COLORSPACE_TRANSFORM
Public Type As Integer
Public Data As _Data_e__Union
End Structureimport ctypes
from ctypes import wintypes
class COLORSPACE_TRANSFORM(ctypes.Structure):
_fields_ = [
("Type", ctypes.c_int),
("Data", _Data_e__Union),
]#[repr(C)]
pub struct COLORSPACE_TRANSFORM {
pub Type: i32,
pub Data: _Data_e__Union,
}import "golang.org/x/sys/windows"
type COLORSPACE_TRANSFORM struct {
Type int32
Data _Data_e__Union
}type
COLORSPACE_TRANSFORM = record
Type: Integer;
Data: _Data_e__Union;
end;const COLORSPACE_TRANSFORM = extern struct {
Type: i32,
Data: _Data_e__Union,
};type
COLORSPACE_TRANSFORM {.bycopy.} = object
Type: int32
Data: _Data_e__Unionstruct COLORSPACE_TRANSFORM
{
int Type;
_Data_e__Union Data;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; COLORSPACE_TRANSFORM サイズ: 98356 バイト(x64)
dim st, 24589 ; 4byte整数×24589(構造体サイズ 98356 / 4 切り上げ)
; Type : COLORSPACE_TRANSFORM_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Data : _Data_e__Union (+4, 98352byte) varptr(st)+4 を基点に操作(98352byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global COLORSPACE_TRANSFORM
#field int Type
#field byte Data 98352
#endstruct
stdim st, COLORSPACE_TRANSFORM ; NSTRUCT 変数を確保
st->Type = 100
mes "Type=" + st->Type
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。