Win32 API 日本語リファレンス
ホームGraphics.Dxgi › DXGI_DISPLAY_COLOR_SPACE

DXGI_DISPLAY_COLOR_SPACE

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

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

フィールド

フィールドサイズx64x86説明
PrimaryCoordinatesFLOAT64+0+0色域の原色座標を表す配列。
WhitePointsFLOAT128+64+64ホワイトポイントの座標を表す配列。

各言語での定義

#include <windows.h>

// DXGI_DISPLAY_COLOR_SPACE  (x64 192 / x86 192 バイト)
typedef struct DXGI_DISPLAY_COLOR_SPACE {
    FLOAT PrimaryCoordinates[16];
    FLOAT WhitePoints[32];
} DXGI_DISPLAY_COLOR_SPACE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXGI_DISPLAY_COLOR_SPACE
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public float[] PrimaryCoordinates;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public float[] WhitePoints;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXGI_DISPLAY_COLOR_SPACE
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public PrimaryCoordinates() As Single
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public WhitePoints() As Single
End Structure
import ctypes
from ctypes import wintypes

class DXGI_DISPLAY_COLOR_SPACE(ctypes.Structure):
    _fields_ = [
        ("PrimaryCoordinates", ctypes.c_float * 16),
        ("WhitePoints", ctypes.c_float * 32),
    ]
#[repr(C)]
pub struct DXGI_DISPLAY_COLOR_SPACE {
    pub PrimaryCoordinates: [f32; 16],
    pub WhitePoints: [f32; 32],
}
import "golang.org/x/sys/windows"

type DXGI_DISPLAY_COLOR_SPACE struct {
	PrimaryCoordinates [16]float32
	WhitePoints [32]float32
}
type
  DXGI_DISPLAY_COLOR_SPACE = record
    PrimaryCoordinates: array[0..15] of Single;
    WhitePoints: array[0..31] of Single;
  end;
const DXGI_DISPLAY_COLOR_SPACE = extern struct {
    PrimaryCoordinates: [16]f32,
    WhitePoints: [32]f32,
};
type
  DXGI_DISPLAY_COLOR_SPACE {.bycopy.} = object
    PrimaryCoordinates: array[16, float32]
    WhitePoints: array[32, float32]
struct DXGI_DISPLAY_COLOR_SPACE
{
    float[16] PrimaryCoordinates;
    float[32] WhitePoints;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXGI_DISPLAY_COLOR_SPACE サイズ: 192 バイト(x64)
dim st, 48    ; 4byte整数×48(構造体サイズ 192 / 4 切り上げ)
; PrimaryCoordinates : FLOAT (+0, 64byte)  varptr(st)+0 を基点に操作(64byte:入れ子/配列)
; WhitePoints : FLOAT (+64, 128byte)  varptr(st)+64 を基点に操作(128byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DXGI_DISPLAY_COLOR_SPACE
    #field float PrimaryCoordinates 16
    #field float WhitePoints 32
#endstruct

stdim st, DXGI_DISPLAY_COLOR_SPACE        ; NSTRUCT 変数を確保