Win32 API 日本語リファレンス
ホームDevices.Display › COLORSPACE_TRANSFORM

COLORSPACE_TRANSFORM

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

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

フィールド

フィールドサイズx64x86説明
TypeCOLORSPACE_TRANSFORM_TYPE4+0+0色空間変換の種類を示す列挙値。Dataの解釈を決定する。
Data_Data_e__Union98352+4+4変換種類ごとの具体的なパラメータを保持する無名共用体。

共用体: _Data_e__Union x64 98352B / x86 98352B

フィールドサイズx64x86
Rgb256x3x16GAMMA_RAMP_RGB256x3x161536+0+0
Dxgi1GAMMA_RAMP_DXGI_112324+0+0
T3x4COLORSPACE_TRANSFORM_3x449204+0+0
MatrixV2COLORSPACE_TRANSFORM_MATRIX_V298352+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 Structure
import 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__Union
struct 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 非対応)。必要に応じ手動でアクセス。