ホーム › UI.ColorSystem › PROFILEHEADER
PROFILEHEADER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| phSize | DWORD | 4 | +0 | +0 | プロファイルの全体サイズ(バイト)。 |
| phCMMType | DWORD | 4 | +4 | +4 | 推奨カラーマネジメントモジュールの識別子。 |
| phVersion | DWORD | 4 | +8 | +8 | ICCプロファイルのバージョン番号。 |
| phClass | DWORD | 4 | +12 | +12 | プロファイルのクラス(入力・表示・出力等)。 |
| phDataColorSpace | DWORD | 4 | +16 | +16 | プロファイルのデータ色空間識別子。 |
| phConnectionSpace | DWORD | 4 | +20 | +20 | プロファイル接続空間(PCS)の識別子。 |
| phDateTime | DWORD | 12 | +24 | +24 | プロファイル作成日時。 |
| phSignature | DWORD | 4 | +36 | +36 | プロファイルファイルシグネチャ('acsp')。 |
| phPlatform | DWORD | 4 | +40 | +40 | 対象プラットフォーム識別子。 |
| phProfileFlags | DWORD | 4 | +44 | +44 | プロファイルの属性フラグ群。 |
| phManufacturer | DWORD | 4 | +48 | +48 | デバイス製造元の識別子。 |
| phModel | DWORD | 4 | +52 | +52 | デバイスモデルの識別子。 |
| phAttributes | DWORD | 8 | +56 | +56 | メディア属性(反射・透過等)を示す値。 |
| phRenderingIntent | DWORD | 4 | +64 | +64 | 既定のレンダリングインテントを示す値。 |
| phIlluminant | CIEXYZ | 12 | +68 | +68 | PCSの光源値(CIEXYZ)。 |
| phCreator | DWORD | 4 | +80 | +80 | プロファイル作成者の識別子。 |
| phReserved | BYTE | 44 | +84 | +84 | 予約バイト配列。0で埋める。 |
各言語での定義
#include <windows.h>
// CIEXYZ (x64 12 / x86 12 バイト)
typedef struct CIEXYZ {
INT ciexyzX;
INT ciexyzY;
INT ciexyzZ;
} CIEXYZ;
// PROFILEHEADER (x64 128 / x86 128 バイト)
typedef struct PROFILEHEADER {
DWORD phSize;
DWORD phCMMType;
DWORD phVersion;
DWORD phClass;
DWORD phDataColorSpace;
DWORD phConnectionSpace;
DWORD phDateTime[3];
DWORD phSignature;
DWORD phPlatform;
DWORD phProfileFlags;
DWORD phManufacturer;
DWORD phModel;
DWORD phAttributes[2];
DWORD phRenderingIntent;
CIEXYZ phIlluminant;
DWORD phCreator;
BYTE phReserved[44];
} PROFILEHEADER;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 PROFILEHEADER
{
public uint phSize;
public uint phCMMType;
public uint phVersion;
public uint phClass;
public uint phDataColorSpace;
public uint phConnectionSpace;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public uint[] phDateTime;
public uint phSignature;
public uint phPlatform;
public uint phProfileFlags;
public uint phManufacturer;
public uint phModel;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public uint[] phAttributes;
public uint phRenderingIntent;
public CIEXYZ phIlluminant;
public uint phCreator;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 44)] public byte[] phReserved;
}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 PROFILEHEADER
Public phSize As UInteger
Public phCMMType As UInteger
Public phVersion As UInteger
Public phClass As UInteger
Public phDataColorSpace As UInteger
Public phConnectionSpace As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public phDateTime() As UInteger
Public phSignature As UInteger
Public phPlatform As UInteger
Public phProfileFlags As UInteger
Public phManufacturer As UInteger
Public phModel As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public phAttributes() As UInteger
Public phRenderingIntent As UInteger
Public phIlluminant As CIEXYZ
Public phCreator As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=44)> Public phReserved() As Byte
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 PROFILEHEADER(ctypes.Structure):
_fields_ = [
("phSize", wintypes.DWORD),
("phCMMType", wintypes.DWORD),
("phVersion", wintypes.DWORD),
("phClass", wintypes.DWORD),
("phDataColorSpace", wintypes.DWORD),
("phConnectionSpace", wintypes.DWORD),
("phDateTime", wintypes.DWORD * 3),
("phSignature", wintypes.DWORD),
("phPlatform", wintypes.DWORD),
("phProfileFlags", wintypes.DWORD),
("phManufacturer", wintypes.DWORD),
("phModel", wintypes.DWORD),
("phAttributes", wintypes.DWORD * 2),
("phRenderingIntent", wintypes.DWORD),
("phIlluminant", CIEXYZ),
("phCreator", wintypes.DWORD),
("phReserved", ctypes.c_ubyte * 44),
]#[repr(C)]
pub struct CIEXYZ {
pub ciexyzX: i32,
pub ciexyzY: i32,
pub ciexyzZ: i32,
}
#[repr(C)]
pub struct PROFILEHEADER {
pub phSize: u32,
pub phCMMType: u32,
pub phVersion: u32,
pub phClass: u32,
pub phDataColorSpace: u32,
pub phConnectionSpace: u32,
pub phDateTime: [u32; 3],
pub phSignature: u32,
pub phPlatform: u32,
pub phProfileFlags: u32,
pub phManufacturer: u32,
pub phModel: u32,
pub phAttributes: [u32; 2],
pub phRenderingIntent: u32,
pub phIlluminant: CIEXYZ,
pub phCreator: u32,
pub phReserved: [u8; 44],
}import "golang.org/x/sys/windows"
type CIEXYZ struct {
ciexyzX int32
ciexyzY int32
ciexyzZ int32
}
type PROFILEHEADER struct {
phSize uint32
phCMMType uint32
phVersion uint32
phClass uint32
phDataColorSpace uint32
phConnectionSpace uint32
phDateTime [3]uint32
phSignature uint32
phPlatform uint32
phProfileFlags uint32
phManufacturer uint32
phModel uint32
phAttributes [2]uint32
phRenderingIntent uint32
phIlluminant CIEXYZ
phCreator uint32
phReserved [44]byte
}type
CIEXYZ = record
ciexyzX: Integer;
ciexyzY: Integer;
ciexyzZ: Integer;
end;
PROFILEHEADER = record
phSize: DWORD;
phCMMType: DWORD;
phVersion: DWORD;
phClass: DWORD;
phDataColorSpace: DWORD;
phConnectionSpace: DWORD;
phDateTime: array[0..2] of DWORD;
phSignature: DWORD;
phPlatform: DWORD;
phProfileFlags: DWORD;
phManufacturer: DWORD;
phModel: DWORD;
phAttributes: array[0..1] of DWORD;
phRenderingIntent: DWORD;
phIlluminant: CIEXYZ;
phCreator: DWORD;
phReserved: array[0..43] of Byte;
end;const CIEXYZ = extern struct {
ciexyzX: i32,
ciexyzY: i32,
ciexyzZ: i32,
};
const PROFILEHEADER = extern struct {
phSize: u32,
phCMMType: u32,
phVersion: u32,
phClass: u32,
phDataColorSpace: u32,
phConnectionSpace: u32,
phDateTime: [3]u32,
phSignature: u32,
phPlatform: u32,
phProfileFlags: u32,
phManufacturer: u32,
phModel: u32,
phAttributes: [2]u32,
phRenderingIntent: u32,
phIlluminant: CIEXYZ,
phCreator: u32,
phReserved: [44]u8,
};type
CIEXYZ {.bycopy.} = object
ciexyzX: int32
ciexyzY: int32
ciexyzZ: int32
PROFILEHEADER {.bycopy.} = object
phSize: uint32
phCMMType: uint32
phVersion: uint32
phClass: uint32
phDataColorSpace: uint32
phConnectionSpace: uint32
phDateTime: array[3, uint32]
phSignature: uint32
phPlatform: uint32
phProfileFlags: uint32
phManufacturer: uint32
phModel: uint32
phAttributes: array[2, uint32]
phRenderingIntent: uint32
phIlluminant: CIEXYZ
phCreator: uint32
phReserved: array[44, uint8]struct CIEXYZ
{
int ciexyzX;
int ciexyzY;
int ciexyzZ;
}
struct PROFILEHEADER
{
uint phSize;
uint phCMMType;
uint phVersion;
uint phClass;
uint phDataColorSpace;
uint phConnectionSpace;
uint[3] phDateTime;
uint phSignature;
uint phPlatform;
uint phProfileFlags;
uint phManufacturer;
uint phModel;
uint[2] phAttributes;
uint phRenderingIntent;
CIEXYZ phIlluminant;
uint phCreator;
ubyte[44] phReserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PROFILEHEADER サイズ: 128 バイト(x64)
dim st, 32 ; 4byte整数×32(構造体サイズ 128 / 4 切り上げ)
; phSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; phCMMType : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; phVersion : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; phClass : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; phDataColorSpace : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; phConnectionSpace : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; phDateTime : DWORD (+24, 12byte) varptr(st)+24 を基点に操作(12byte:入れ子/配列)
; phSignature : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; phPlatform : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; phProfileFlags : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; phManufacturer : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; phModel : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; phAttributes : DWORD (+56, 8byte) varptr(st)+56 を基点に操作(8byte:入れ子/配列)
; phRenderingIntent : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; phIlluminant : CIEXYZ (+68, 12byte) varptr(st)+68 を基点に操作(12byte:入れ子/配列)
; phCreator : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; phReserved : BYTE (+84, 44byte) varptr(st)+84 を基点に操作(44byte:入れ子/配列)
; ※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 PROFILEHEADER
#field int phSize
#field int phCMMType
#field int phVersion
#field int phClass
#field int phDataColorSpace
#field int phConnectionSpace
#field int phDateTime 3
#field int phSignature
#field int phPlatform
#field int phProfileFlags
#field int phManufacturer
#field int phModel
#field int phAttributes 2
#field int phRenderingIntent
#field CIEXYZ phIlluminant
#field int phCreator
#field byte phReserved 44
#endstruct
stdim st, PROFILEHEADER ; NSTRUCT 変数を確保
st->phSize = 100
mes "phSize=" + st->phSize