ホーム › Graphics.Gdi › CIEXYZTRIPLE
CIEXYZTRIPLE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ciexyzRed | CIEXYZ | 12 | +0 | +0 | 赤原色のCIE XYZ座標を表すCIEXYZ。 |
| ciexyzGreen | CIEXYZ | 12 | +12 | +12 | 緑原色のCIE XYZ座標を表すCIEXYZ。 |
| ciexyzBlue | CIEXYZ | 12 | +24 | +24 | 青原色のCIE XYZ座標を表すCIEXYZ。 |
各言語での定義
#include <windows.h>
// CIEXYZ (x64 12 / x86 12 バイト)
typedef struct CIEXYZ {
INT ciexyzX;
INT ciexyzY;
INT ciexyzZ;
} CIEXYZ;
// CIEXYZTRIPLE (x64 36 / x86 36 バイト)
typedef struct CIEXYZTRIPLE {
CIEXYZ ciexyzRed;
CIEXYZ ciexyzGreen;
CIEXYZ ciexyzBlue;
} CIEXYZTRIPLE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CIEXYZ
{
public int ciexyzX;
public int ciexyzY;
public int ciexyzZ;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CIEXYZTRIPLE
{
public CIEXYZ ciexyzRed;
public CIEXYZ ciexyzGreen;
public CIEXYZ ciexyzBlue;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CIEXYZ
Public ciexyzX As Integer
Public ciexyzY As Integer
Public ciexyzZ As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CIEXYZTRIPLE
Public ciexyzRed As CIEXYZ
Public ciexyzGreen As CIEXYZ
Public ciexyzBlue As CIEXYZ
End Structureimport ctypes
from ctypes import wintypes
class CIEXYZ(ctypes.Structure):
_fields_ = [
("ciexyzX", ctypes.c_int),
("ciexyzY", ctypes.c_int),
("ciexyzZ", ctypes.c_int),
]
class CIEXYZTRIPLE(ctypes.Structure):
_fields_ = [
("ciexyzRed", CIEXYZ),
("ciexyzGreen", CIEXYZ),
("ciexyzBlue", CIEXYZ),
]#[repr(C)]
pub struct CIEXYZ {
pub ciexyzX: i32,
pub ciexyzY: i32,
pub ciexyzZ: i32,
}
#[repr(C)]
pub struct CIEXYZTRIPLE {
pub ciexyzRed: CIEXYZ,
pub ciexyzGreen: CIEXYZ,
pub ciexyzBlue: CIEXYZ,
}import "golang.org/x/sys/windows"
type CIEXYZ struct {
ciexyzX int32
ciexyzY int32
ciexyzZ int32
}
type CIEXYZTRIPLE struct {
ciexyzRed CIEXYZ
ciexyzGreen CIEXYZ
ciexyzBlue CIEXYZ
}type
CIEXYZ = record
ciexyzX: Integer;
ciexyzY: Integer;
ciexyzZ: Integer;
end;
CIEXYZTRIPLE = record
ciexyzRed: CIEXYZ;
ciexyzGreen: CIEXYZ;
ciexyzBlue: CIEXYZ;
end;const CIEXYZ = extern struct {
ciexyzX: i32,
ciexyzY: i32,
ciexyzZ: i32,
};
const CIEXYZTRIPLE = extern struct {
ciexyzRed: CIEXYZ,
ciexyzGreen: CIEXYZ,
ciexyzBlue: CIEXYZ,
};type
CIEXYZ {.bycopy.} = object
ciexyzX: int32
ciexyzY: int32
ciexyzZ: int32
CIEXYZTRIPLE {.bycopy.} = object
ciexyzRed: CIEXYZ
ciexyzGreen: CIEXYZ
ciexyzBlue: CIEXYZstruct CIEXYZ
{
int ciexyzX;
int ciexyzY;
int ciexyzZ;
}
struct CIEXYZTRIPLE
{
CIEXYZ ciexyzRed;
CIEXYZ ciexyzGreen;
CIEXYZ ciexyzBlue;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CIEXYZTRIPLE サイズ: 36 バイト(x64)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; ciexyzRed : CIEXYZ (+0, 12byte) varptr(st)+0 を基点に操作(12byte:入れ子/配列)
; ciexyzGreen : CIEXYZ (+12, 12byte) varptr(st)+12 を基点に操作(12byte:入れ子/配列)
; ciexyzBlue : CIEXYZ (+24, 12byte) varptr(st)+24 を基点に操作(12byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global CIEXYZ
#field int ciexyzX
#field int ciexyzY
#field int ciexyzZ
#endstruct
#defstruct global CIEXYZTRIPLE
#field CIEXYZ ciexyzRed
#field CIEXYZ ciexyzGreen
#field CIEXYZ ciexyzBlue
#endstruct
stdim st, CIEXYZTRIPLE ; NSTRUCT 変数を確保