ホーム › Devices.Display › COLORINFO
COLORINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Red | CIECHROMA | 12 | +0 | +0 | 赤原色のCIE色度・輝度(CIECHROMA)。 |
| Green | CIECHROMA | 12 | +12 | +12 | 緑原色のCIE色度・輝度。 |
| Blue | CIECHROMA | 12 | +24 | +24 | 青原色のCIE色度・輝度。 |
| Cyan | CIECHROMA | 12 | +36 | +36 | シアン色のCIE色度・輝度。 |
| Magenta | CIECHROMA | 12 | +48 | +48 | マゼンタ色のCIE色度・輝度。 |
| Yellow | CIECHROMA | 12 | +60 | +60 | イエロー色のCIE色度・輝度。 |
| AlignmentWhite | CIECHROMA | 12 | +72 | +72 | 基準白色点のCIE色度・輝度。 |
| RedGamma | INT | 4 | +84 | +84 | 赤チャネルのガンマ値(固定小数点)。 |
| GreenGamma | INT | 4 | +88 | +88 | 緑チャネルのガンマ値。 |
| BlueGamma | INT | 4 | +92 | +92 | 青チャネルのガンマ値。 |
| MagentaInCyanDye | INT | 4 | +96 | +96 | シアン染料中のマゼンタ汚染量(色補正係数)。 |
| YellowInCyanDye | INT | 4 | +100 | +100 | シアン染料中のイエロー汚染量。 |
| CyanInMagentaDye | INT | 4 | +104 | +104 | マゼンタ染料中のシアン汚染量。 |
| YellowInMagentaDye | INT | 4 | +108 | +108 | マゼンタ染料中のイエロー汚染量。 |
| CyanInYellowDye | INT | 4 | +112 | +112 | イエロー染料中のシアン汚染量。 |
| MagentaInYellowDye | INT | 4 | +116 | +116 | イエロー染料中のマゼンタ汚染量。 |
各言語での定義
#include <windows.h>
// CIECHROMA (x64 12 / x86 12 バイト)
typedef struct CIECHROMA {
INT x;
INT y;
INT Y;
} CIECHROMA;
// COLORINFO (x64 120 / x86 120 バイト)
typedef struct COLORINFO {
CIECHROMA Red;
CIECHROMA Green;
CIECHROMA Blue;
CIECHROMA Cyan;
CIECHROMA Magenta;
CIECHROMA Yellow;
CIECHROMA AlignmentWhite;
INT RedGamma;
INT GreenGamma;
INT BlueGamma;
INT MagentaInCyanDye;
INT YellowInCyanDye;
INT CyanInMagentaDye;
INT YellowInMagentaDye;
INT CyanInYellowDye;
INT MagentaInYellowDye;
} COLORINFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CIECHROMA
{
public int x;
public int y;
public int Y;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct COLORINFO
{
public CIECHROMA Red;
public CIECHROMA Green;
public CIECHROMA Blue;
public CIECHROMA Cyan;
public CIECHROMA Magenta;
public CIECHROMA Yellow;
public CIECHROMA AlignmentWhite;
public int RedGamma;
public int GreenGamma;
public int BlueGamma;
public int MagentaInCyanDye;
public int YellowInCyanDye;
public int CyanInMagentaDye;
public int YellowInMagentaDye;
public int CyanInYellowDye;
public int MagentaInYellowDye;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CIECHROMA
Public x As Integer
Public y As Integer
Public Y As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure COLORINFO
Public Red As CIECHROMA
Public Green As CIECHROMA
Public Blue As CIECHROMA
Public Cyan As CIECHROMA
Public Magenta As CIECHROMA
Public Yellow As CIECHROMA
Public AlignmentWhite As CIECHROMA
Public RedGamma As Integer
Public GreenGamma As Integer
Public BlueGamma As Integer
Public MagentaInCyanDye As Integer
Public YellowInCyanDye As Integer
Public CyanInMagentaDye As Integer
Public YellowInMagentaDye As Integer
Public CyanInYellowDye As Integer
Public MagentaInYellowDye As Integer
End Structureimport ctypes
from ctypes import wintypes
class CIECHROMA(ctypes.Structure):
_fields_ = [
("x", ctypes.c_int),
("y", ctypes.c_int),
("Y", ctypes.c_int),
]
class COLORINFO(ctypes.Structure):
_fields_ = [
("Red", CIECHROMA),
("Green", CIECHROMA),
("Blue", CIECHROMA),
("Cyan", CIECHROMA),
("Magenta", CIECHROMA),
("Yellow", CIECHROMA),
("AlignmentWhite", CIECHROMA),
("RedGamma", ctypes.c_int),
("GreenGamma", ctypes.c_int),
("BlueGamma", ctypes.c_int),
("MagentaInCyanDye", ctypes.c_int),
("YellowInCyanDye", ctypes.c_int),
("CyanInMagentaDye", ctypes.c_int),
("YellowInMagentaDye", ctypes.c_int),
("CyanInYellowDye", ctypes.c_int),
("MagentaInYellowDye", ctypes.c_int),
]#[repr(C)]
pub struct CIECHROMA {
pub x: i32,
pub y: i32,
pub Y: i32,
}
#[repr(C)]
pub struct COLORINFO {
pub Red: CIECHROMA,
pub Green: CIECHROMA,
pub Blue: CIECHROMA,
pub Cyan: CIECHROMA,
pub Magenta: CIECHROMA,
pub Yellow: CIECHROMA,
pub AlignmentWhite: CIECHROMA,
pub RedGamma: i32,
pub GreenGamma: i32,
pub BlueGamma: i32,
pub MagentaInCyanDye: i32,
pub YellowInCyanDye: i32,
pub CyanInMagentaDye: i32,
pub YellowInMagentaDye: i32,
pub CyanInYellowDye: i32,
pub MagentaInYellowDye: i32,
}import "golang.org/x/sys/windows"
type CIECHROMA struct {
x int32
y int32
Y int32
}
type COLORINFO struct {
Red CIECHROMA
Green CIECHROMA
Blue CIECHROMA
Cyan CIECHROMA
Magenta CIECHROMA
Yellow CIECHROMA
AlignmentWhite CIECHROMA
RedGamma int32
GreenGamma int32
BlueGamma int32
MagentaInCyanDye int32
YellowInCyanDye int32
CyanInMagentaDye int32
YellowInMagentaDye int32
CyanInYellowDye int32
MagentaInYellowDye int32
}type
CIECHROMA = record
x: Integer;
y: Integer;
Y: Integer;
end;
COLORINFO = record
Red: CIECHROMA;
Green: CIECHROMA;
Blue: CIECHROMA;
Cyan: CIECHROMA;
Magenta: CIECHROMA;
Yellow: CIECHROMA;
AlignmentWhite: CIECHROMA;
RedGamma: Integer;
GreenGamma: Integer;
BlueGamma: Integer;
MagentaInCyanDye: Integer;
YellowInCyanDye: Integer;
CyanInMagentaDye: Integer;
YellowInMagentaDye: Integer;
CyanInYellowDye: Integer;
MagentaInYellowDye: Integer;
end;const CIECHROMA = extern struct {
x: i32,
y: i32,
Y: i32,
};
const COLORINFO = extern struct {
Red: CIECHROMA,
Green: CIECHROMA,
Blue: CIECHROMA,
Cyan: CIECHROMA,
Magenta: CIECHROMA,
Yellow: CIECHROMA,
AlignmentWhite: CIECHROMA,
RedGamma: i32,
GreenGamma: i32,
BlueGamma: i32,
MagentaInCyanDye: i32,
YellowInCyanDye: i32,
CyanInMagentaDye: i32,
YellowInMagentaDye: i32,
CyanInYellowDye: i32,
MagentaInYellowDye: i32,
};type
CIECHROMA {.bycopy.} = object
x: int32
y: int32
Y: int32
COLORINFO {.bycopy.} = object
Red: CIECHROMA
Green: CIECHROMA
Blue: CIECHROMA
Cyan: CIECHROMA
Magenta: CIECHROMA
Yellow: CIECHROMA
AlignmentWhite: CIECHROMA
RedGamma: int32
GreenGamma: int32
BlueGamma: int32
MagentaInCyanDye: int32
YellowInCyanDye: int32
CyanInMagentaDye: int32
YellowInMagentaDye: int32
CyanInYellowDye: int32
MagentaInYellowDye: int32struct CIECHROMA
{
int x;
int y;
int Y;
}
struct COLORINFO
{
CIECHROMA Red;
CIECHROMA Green;
CIECHROMA Blue;
CIECHROMA Cyan;
CIECHROMA Magenta;
CIECHROMA Yellow;
CIECHROMA AlignmentWhite;
int RedGamma;
int GreenGamma;
int BlueGamma;
int MagentaInCyanDye;
int YellowInCyanDye;
int CyanInMagentaDye;
int YellowInMagentaDye;
int CyanInYellowDye;
int MagentaInYellowDye;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; COLORINFO サイズ: 120 バイト(x64)
dim st, 30 ; 4byte整数×30(構造体サイズ 120 / 4 切り上げ)
; Red : CIECHROMA (+0, 12byte) varptr(st)+0 を基点に操作(12byte:入れ子/配列)
; Green : CIECHROMA (+12, 12byte) varptr(st)+12 を基点に操作(12byte:入れ子/配列)
; Blue : CIECHROMA (+24, 12byte) varptr(st)+24 を基点に操作(12byte:入れ子/配列)
; Cyan : CIECHROMA (+36, 12byte) varptr(st)+36 を基点に操作(12byte:入れ子/配列)
; Magenta : CIECHROMA (+48, 12byte) varptr(st)+48 を基点に操作(12byte:入れ子/配列)
; Yellow : CIECHROMA (+60, 12byte) varptr(st)+60 を基点に操作(12byte:入れ子/配列)
; AlignmentWhite : CIECHROMA (+72, 12byte) varptr(st)+72 を基点に操作(12byte:入れ子/配列)
; RedGamma : INT (+84, 4byte) st.21 = 値 / 値 = st.21 (lpoke/lpeek も可)
; GreenGamma : INT (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; BlueGamma : INT (+92, 4byte) st.23 = 値 / 値 = st.23 (lpoke/lpeek も可)
; MagentaInCyanDye : INT (+96, 4byte) st.24 = 値 / 値 = st.24 (lpoke/lpeek も可)
; YellowInCyanDye : INT (+100, 4byte) st.25 = 値 / 値 = st.25 (lpoke/lpeek も可)
; CyanInMagentaDye : INT (+104, 4byte) st.26 = 値 / 値 = st.26 (lpoke/lpeek も可)
; YellowInMagentaDye : INT (+108, 4byte) st.27 = 値 / 値 = st.27 (lpoke/lpeek も可)
; CyanInYellowDye : INT (+112, 4byte) st.28 = 値 / 値 = st.28 (lpoke/lpeek も可)
; MagentaInYellowDye : INT (+116, 4byte) st.29 = 値 / 値 = st.29 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global CIECHROMA
#field int x
#field int y
#field int Y
#endstruct
#defstruct global COLORINFO
#field CIECHROMA Red
#field CIECHROMA Green
#field CIECHROMA Blue
#field CIECHROMA Cyan
#field CIECHROMA Magenta
#field CIECHROMA Yellow
#field CIECHROMA AlignmentWhite
#field int RedGamma
#field int GreenGamma
#field int BlueGamma
#field int MagentaInCyanDye
#field int YellowInCyanDye
#field int CyanInMagentaDye
#field int YellowInMagentaDye
#field int CyanInYellowDye
#field int MagentaInYellowDye
#endstruct
stdim st, COLORINFO ; NSTRUCT 変数を確保
st->RedGamma = 100
mes "RedGamma=" + st->RedGamma