Win32 API 日本語リファレンス
ホームUI.ColorSystem › GamutBoundaryDescription

GamutBoundaryDescription

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

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

フィールド

フィールドサイズx64x86説明
pPrimariesPrimaryJabColors*8/4+0+0原色定義(PrimaryJabColors)へのポインタ。
cNeutralSamplesDWORD4+8+4中間グレーサンプルの数。
pNeutralSamplesJabColorF*8/4+16+8中間グレーサンプル配列へのポインタ。
pReferenceShellGamutShell*8/4+24+12基準色域シェルへのポインタ。
pPlausibleShellGamutShell*8/4+32+16妥当な色域シェルへのポインタ。
pPossibleShellGamutShell*8/4+40+20可能性のある色域シェルへのポインタ。

各言語での定義

#include <windows.h>

// GamutBoundaryDescription  (x64 48 / x86 24 バイト)
typedef struct GamutBoundaryDescription {
    PrimaryJabColors* pPrimaries;
    DWORD cNeutralSamples;
    JabColorF* pNeutralSamples;
    GamutShell* pReferenceShell;
    GamutShell* pPlausibleShell;
    GamutShell* pPossibleShell;
} GamutBoundaryDescription;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GamutBoundaryDescription
{
    public IntPtr pPrimaries;
    public uint cNeutralSamples;
    public IntPtr pNeutralSamples;
    public IntPtr pReferenceShell;
    public IntPtr pPlausibleShell;
    public IntPtr pPossibleShell;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GamutBoundaryDescription
    Public pPrimaries As IntPtr
    Public cNeutralSamples As UInteger
    Public pNeutralSamples As IntPtr
    Public pReferenceShell As IntPtr
    Public pPlausibleShell As IntPtr
    Public pPossibleShell As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class GamutBoundaryDescription(ctypes.Structure):
    _fields_ = [
        ("pPrimaries", ctypes.c_void_p),
        ("cNeutralSamples", wintypes.DWORD),
        ("pNeutralSamples", ctypes.c_void_p),
        ("pReferenceShell", ctypes.c_void_p),
        ("pPlausibleShell", ctypes.c_void_p),
        ("pPossibleShell", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct GamutBoundaryDescription {
    pub pPrimaries: *mut core::ffi::c_void,
    pub cNeutralSamples: u32,
    pub pNeutralSamples: *mut core::ffi::c_void,
    pub pReferenceShell: *mut core::ffi::c_void,
    pub pPlausibleShell: *mut core::ffi::c_void,
    pub pPossibleShell: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type GamutBoundaryDescription struct {
	pPrimaries uintptr
	cNeutralSamples uint32
	pNeutralSamples uintptr
	pReferenceShell uintptr
	pPlausibleShell uintptr
	pPossibleShell uintptr
}
type
  GamutBoundaryDescription = record
    pPrimaries: Pointer;
    cNeutralSamples: DWORD;
    pNeutralSamples: Pointer;
    pReferenceShell: Pointer;
    pPlausibleShell: Pointer;
    pPossibleShell: Pointer;
  end;
const GamutBoundaryDescription = extern struct {
    pPrimaries: ?*anyopaque,
    cNeutralSamples: u32,
    pNeutralSamples: ?*anyopaque,
    pReferenceShell: ?*anyopaque,
    pPlausibleShell: ?*anyopaque,
    pPossibleShell: ?*anyopaque,
};
type
  GamutBoundaryDescription {.bycopy.} = object
    pPrimaries: pointer
    cNeutralSamples: uint32
    pNeutralSamples: pointer
    pReferenceShell: pointer
    pPlausibleShell: pointer
    pPossibleShell: pointer
struct GamutBoundaryDescription
{
    void* pPrimaries;
    uint cNeutralSamples;
    void* pNeutralSamples;
    void* pReferenceShell;
    void* pPlausibleShell;
    void* pPossibleShell;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; GamutBoundaryDescription サイズ: 24 バイト(x86)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; pPrimaries : PrimaryJabColors* (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; cNeutralSamples : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pNeutralSamples : JabColorF* (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; pReferenceShell : GamutShell* (+12, 4byte)  varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; pPlausibleShell : GamutShell* (+16, 4byte)  varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; pPossibleShell : GamutShell* (+20, 4byte)  varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GamutBoundaryDescription サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; pPrimaries : PrimaryJabColors* (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; cNeutralSamples : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; pNeutralSamples : JabColorF* (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; pReferenceShell : GamutShell* (+24, 8byte)  varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; pPlausibleShell : GamutShell* (+32, 8byte)  varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; pPossibleShell : GamutShell* (+40, 8byte)  varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GamutBoundaryDescription
    #field intptr pPrimaries
    #field int cNeutralSamples
    #field intptr pNeutralSamples
    #field intptr pReferenceShell
    #field intptr pPlausibleShell
    #field intptr pPossibleShell
#endstruct

stdim st, GamutBoundaryDescription        ; NSTRUCT 変数を確保
st->cNeutralSamples = 100
mes "cNeutralSamples=" + st->cNeutralSamples