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

GamutShell

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

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

フィールド

フィールドサイズx64x86説明
JMinFLOAT4+0+0色域シェルの最小明度(J)値。
JMaxFLOAT4+4+4色域シェルの最大明度(J)値。
cVerticesDWORD4+8+8シェルを構成する頂点の数。
cTrianglesDWORD4+12+12シェルを構成する三角形の数。
pVerticesJabColorF*8/4+16+16頂点(JabColorF)配列へのポインタ。
pTrianglesGamutShellTriangle*8/4+24+20三角形定義配列へのポインタ。

各言語での定義

#include <windows.h>

// GamutShell  (x64 32 / x86 24 バイト)
typedef struct GamutShell {
    FLOAT JMin;
    FLOAT JMax;
    DWORD cVertices;
    DWORD cTriangles;
    JabColorF* pVertices;
    GamutShellTriangle* pTriangles;
} GamutShell;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GamutShell
{
    public float JMin;
    public float JMax;
    public uint cVertices;
    public uint cTriangles;
    public IntPtr pVertices;
    public IntPtr pTriangles;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GamutShell
    Public JMin As Single
    Public JMax As Single
    Public cVertices As UInteger
    Public cTriangles As UInteger
    Public pVertices As IntPtr
    Public pTriangles As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class GamutShell(ctypes.Structure):
    _fields_ = [
        ("JMin", ctypes.c_float),
        ("JMax", ctypes.c_float),
        ("cVertices", wintypes.DWORD),
        ("cTriangles", wintypes.DWORD),
        ("pVertices", ctypes.c_void_p),
        ("pTriangles", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct GamutShell {
    pub JMin: f32,
    pub JMax: f32,
    pub cVertices: u32,
    pub cTriangles: u32,
    pub pVertices: *mut core::ffi::c_void,
    pub pTriangles: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type GamutShell struct {
	JMin float32
	JMax float32
	cVertices uint32
	cTriangles uint32
	pVertices uintptr
	pTriangles uintptr
}
type
  GamutShell = record
    JMin: Single;
    JMax: Single;
    cVertices: DWORD;
    cTriangles: DWORD;
    pVertices: Pointer;
    pTriangles: Pointer;
  end;
const GamutShell = extern struct {
    JMin: f32,
    JMax: f32,
    cVertices: u32,
    cTriangles: u32,
    pVertices: ?*anyopaque,
    pTriangles: ?*anyopaque,
};
type
  GamutShell {.bycopy.} = object
    JMin: float32
    JMax: float32
    cVertices: uint32
    cTriangles: uint32
    pVertices: pointer
    pTriangles: pointer
struct GamutShell
{
    float JMin;
    float JMax;
    uint cVertices;
    uint cTriangles;
    void* pVertices;
    void* pTriangles;
}

HSP用 定義

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

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

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