📄 ielcms.pas
字号:
icSigProfileDescriptionTag = $64657363; (* 'desc' *)
icSigProfileSequenceDescTag = $70736571; (* 'pseq' *)
icSigPs2CRD0Tag = $70736430; (* 'psd0' *)
icSigPs2CRD1Tag = $70736431; (* 'psd1' *)
icSigPs2CRD2Tag = $70736432; (* 'psd2' *)
icSigPs2CRD3Tag = $70736433; (* 'psd3' *)
icSigPs2CSATag = $70733273; (* 'ps2s' *)
icSigPs2RenderingIntentTag = $70733269; (* 'ps2i' *)
icSigRedColorantTag = $7258595A; (* 'rXYZ' *)
icSigRedTRCTag = $72545243; (* 'rTRC' *)
icSigScreeningDescTag = $73637264; (* 'scrd' *)
icSigScreeningTag = $7363726E; (* 'scrn' *)
icSigTechnologyTag = $74656368; (* 'tech' *)
icSigUcrBgTag = $62666420; (* 'bfd ' *)
icSigViewingCondDescTag = $76756564; (* 'vued' *)
icSigViewingConditionsTag = $76696577; (* 'view' *)
icMaxEnumTag = $FFFFFFFF;
type
PicTagSignature = ^icTagSignature;
icRenderingIntent = integer;
const
icPerceptual = 0;
icRelativeColorimetric = 1;
icSaturation = 2;
icAbsoluteColorimetric = 3;
icMaxEnumIntent = $FFFFFFFF;
type
icPlatformSignature = integer;
const
icSigMacintosh = $4150504C; // 'APPL' */
icSigMicrosoft = $4D534654; // 'MSFT' */
icSigSolaris = $53554E57; // 'SUNW' */
icSigSGI = $53474920; // 'SGI ' */
icSigTaligent = $54474E54; // 'TGNT' */
icMaxEnumPlatform = $FFFFFFFF;
type
icTagTypeSignature = integer;
const
icSigCurveType = $63757276; // 'curv' */
icSigDataType = $64617461; // 'data' */
icSigDateTimeType = $6474696D; // 'dtim' */
icSigLut16Type = $6D667432; // 'mft2' */
icSigLut8Type = $6D667431; // 'mft1' */
icSigMeasurementType = $6D656173; // 'meas' */
icSigNamedColorType = $6E636F6C; // 'ncol'
//* OBSOLETE; use ncl2 */
icSigProfileSequenceDescType = $70736571; // 'pseq' */
icSigS15Fixed16ArrayType = $73663332; // 'sf32' */
icSigScreeningType = $7363726E; // 'scrn' */
icSigSignatureType = $73696720; // 'sig ' */
icSigTextType = $74657874; // 'text' */
icSigTextDescriptionType = $64657363; // 'desc' */
icSigU16Fixed16ArrayType = $75663332; // 'uf32' */
icSigUcrBgType = $62666420; // 'bfd ' */
icSigUInt16ArrayType = $75693136; // 'ui16' */
icSigUInt32ArrayType = $75693332; // 'ui32' */
icSigUInt64ArrayType = $75693634; // 'ui64' */
icSigUInt8ArrayType = $75693038; // 'ui08' */
icSigViewingConditionsType = $76696577; // 'view' */
icSigXYZType = $58595A20; // 'XYZ ' */
icSigXYZArrayType = $58595A20; // 'XYZ ' */
icSigNamedColor2Type = $6E636C32; // 'ncl2' */
icSigCrdInfoType = $63726469; // 'crdi' */
icMaxEnumType = $FFFFFFFF;
// technology signature descriptions */
type
icTechnologySignature = integer;
const
icSigDigitalCamera = $6463616D; // 'dcam' */
icSigFilmScanner = $6673636E; // 'fscn' */
icSigReflectiveScanner = $7273636E; // 'rscn' */
icSigInkJetPrinter = $696A6574; // 'ijet' */
icSigThermalWaxPrinter = $74776178; // 'twax' */
icSigElectrophotographicPrinter = $6570686F; // 'epho' */
icSigElectrostaticPrinter = $65737461; // 'esta' */
icSigDyeSublimationPrinter = $64737562; // 'dsub' */
icSigPhotographicPaperPrinter = $7270686F; // 'rpho' */
icSigFilmWriter = $6670726E; // 'fprn' */
icSigVideoMonitor = $7669646D; // 'vidm' */
icSigVideoCamera = $76696463; // 'vidc' */
icSigProjectionTelevision = $706A7476; // 'pjtv' */
icSigCRTDisplay = $43525420; // 'CRT ' */
icSigPMDisplay = $504D4420; // 'PMD ' */
icSigAMDisplay = $414D4420; // 'AMD ' */
icSigPhotoCD = $4B504344; // 'KPCD' */
icSigPhotoImageSetter = $696D6773; // 'imgs' */
icSigGravure = $67726176; // 'grav' */
icSigOffsetLithography = $6F666673; // 'offs' */
icSigSilkscreen = $73696C6B; // 'silk' */
icSigFlexography = $666C6578; // 'flex' */
icMaxEnumTechnology = $FFFFFFFF;
type
cmsCIEXYZ = packed record
X: double;
Y: double;
Z: double;
end;
LPcmsCIEXYZ = ^cmsCIEXYZ;
VEC3 = packed record
n: array[0..2] of double;
end;
LPVEC3 = ^VEC3;
MAT3 = packed record
v: array[0..2] of VEC3;
end;
LPMAT3 = ^MAT3;
icTag = packed record
sig: icTagSignature;
offset: icUInt32Number;
size: icUInt32Number;
end;
icDateTimeNumber = packed record
year: icUInt16Number;
month: icUInt16Number;
day: icUInt16Number;
hours: icUInt16Number;
minutes: icUInt16Number;
seconds: icUInt16Number;
end;
PicDateTimeNumber = ^icDateTimeNumber;
icXYZNumber = packed record
X: icS15Fixed16Number;
Y: icS15Fixed16Number;
Z: icS15Fixed16Number;
end;
icHeader = packed record
size: icUInt32Number;
cmmId: icSignature;
version: icUInt32Number;
deviceClass: icProfileClassSignature;
colorSpace: icColorSpaceSignature;
pcs: icColorSpaceSignature;
date: icDateTimeNumber;
magic: icSignature;
xplatform: icPlatformSignature;
flags: icUInt32Number;
manufacturer: icSignature;
model: icUInt32Number;
attributes: icUInt64Number;
renderingIntent: icUInt32Number;
illuminant: icXYZNumber;
creator: icSignature;
reserved: array[0..43] of icInt8Number;
end;
TReadFunction = function(buffer: pointer; size: integer; count: integer; stream: TStream): integer;
TSeekFunction = function(stream: TStream; offset: int64): longbool;
TCloseFunction = function(stream: TStream): longbool;
TTellFunction = function(stream: TStream): int64;
TWriteFunction = function(stream: TStream; size: integer; Ptr: pointer): longbool;
LCMSICCPROFILE = packed record
stream: TStream;
DeviceClass: icProfileClassSignature;
ColorSpace: icColorSpaceSignature;
PCS: icColorSpaceSignature;
RenderingIntent: icRenderingIntent;
flags: icUInt32Number;
Illuminant: cmsCIEXYZ;
Version: icUInt32Number;
ChromaticAdaptation: MAT3;
MediaWhitePoint: cmsCIEXYZ;
MediaBlackPoint: cmsCIEXYZ;
ProfileID: array[0..15] of BYTE;
TagCount: icInt32Number;
TagNames: array[0..MAX_TABLE_TAG - 1] of icTagSignature;
TagSizes: array[0..MAX_TABLE_TAG - 1] of integer;
TagOffsets: array[0..MAX_TABLE_TAG - 1] of integer;
TagPtrs: array[0..MAX_TABLE_TAG - 1] of pointer;
PhysicalFile: TStream;
IsWrite: longbool;
SaveAs8Bits: longbool;
Read: TReadFunction;
Seek: TSeekFunction;
Close: TCloseFunction;
Tell: TTellFunction;
Write: TWriteFunction;
end;
LPLCMSICCPROFILE = ^LCMSICCPROFILE;
icTagBase = packed record
sig: icTagTypeSignature; // Signature */
reserved: array[0..3] of icInt8Number; // Reserved, set to 0 */
end;
WVEC3 = packed record
n: array[0..2] of Fixed32;
end;
LPWVEC3 = ^WVEC3;
WMAT3 = packed record
v: array[0..2] of WVEC3;
end;
LPWMAT3 = ^WMAT3;
_LPcmsTRANSFORM = ^_cmsTRANSFORM;
_cmsCOLORCALLBACKFN = procedure(Transform: _LPcmsTRANSFORM;
InputBuffer: pointer;
OutputBuffer: pointer; Size: dword);
_cmsFIXFN = function(info: _LPcmsTRANSFORM; ToUnroll: pwordarray; Buffer: pbyte): pbyte;
_cmsTRANSFN = procedure(Transform: _LPcmsTRANSFORM; xIn: pwordarray; xOut: pwordarray);
_cmsADJFN = procedure(xIn: pwordarray; xOut: pwordarray; m: LPWMAT3; b: LPWVEC3);
LPLUT = ^LUT;
LPL16PARAMS = ^L16PARAMS;
_cms3DLERP = procedure(Input: pwordarray; Output: pwordarray; LutTable: pwordarray; p: LPL16PARAMS);
//_lcms_l8opt_struc
L8PARAMS = packed record
X0, Y0, Z0: array[0..255] of dword;
rx, ry, rz: array[0..255] of word;
end;
LPL8PARAMS = ^L8PARAMS;
// _lcms_l16params_struc
L16PARAMS = packed record
nSamples: integer;
nInputs: integer;
nOutputs: integer;
Domain: WORD;
opta1, opta2: integer;
opta3, opta4: integer;
opta5, opta6: integer;
opta7, opta8: integer;
Interp3D: _cms3DLERP;
p8: LPL8PARAMS;
end;
//struct _lcms_LUT_struc
LUT = packed record
wFlags: DWORD;
Matrix: WMAT3;
InputChan: dword;
OutputChan: dword;
InputEntries: dword;
OutputEntries: dword;
cLutPoints: dword;
L1: array[0..MAXCHANNELS - 1] of PWORD;
L2: array[0..MAXCHANNELS - 1] of PWORD;
T: PWORD;
Tsize: integer;
In16params: L16PARAMS;
Out16params: L16PARAMS;
CLut16params: L16PARAMS;
Intent: integer;
Mat3: WMAT3;
Ofs3: WVEC3;
L3: array[0..MAXCHANNELS - 1] of PWORD;
L3params: L16PARAMS;
L3Entries: dword;
Mat4: WMAT3;
Ofs4: WVEC3;
L4: array[0..MAXCHANNELS - 1] of PWORD;
L4params: L16PARAMS;
L4Entries: dword;
end;
MATSHAPER = packed record
dwFlags: DWORD;
Matrix: WMAT3;
p16: L16PARAMS;
L: array[0..2] of PWORD;
p2_16: L16PARAMS;
L2: array[0..2] of PWORD;
end;
LPMATSHAPER = ^MATSHAPER;
cmsNAMEDCOLOR = packed record
Name: array[0..MAX_PATH - 1] of char;
PCS: array[0..2] of WORD;
DeviceColorant: array[0..MAXCHANNELS - 1] of WORD;
end;
LPcmsNAMEDCOLOR = ^cmsNAMEDCOLOR;
cmsNAMEDCOLORLIST = packed record
nColors: integer;
Allocated: integer;
ColorantCount: integer;
Prefix: array[0..32] of char;
Suffix: array[0..32] of char;
List: array[0..0] of cmsNAMEDCOLOR;
end;
LPcmsNAMEDCOLORLIST = ^cmsNAMEDCOLORLIST;
// Transformation
_cmsTRANSFORM = packed record
InputFormat, OutputFormat: DWORD;
StrideIn, StrideOut: DWORD;
Intent, ProofIntent: integer;
DoGamutCheck: integer;
InputProfile: cmsHPROFILE;
OutputProfile: cmsHPROFILE;
PreviewProfile: cmsHPROFILE;
EntryColorSpace: icColorSpaceSignature;
ExitColorSpace: icColorSpaceSignature;
m1, m2: WMAT3;
of1, of2: WVEC3;
xform: _cmsCOLORCALLBACKFN;
FromInput: _cmsFIXFN;
FromDevice: _cmsTRANSFN;
Stage1: _cmsADJFN;
Stage2: _cmsADJFN;
ToDevice: _cmsTRANSFN;
ToOutput: _cmsFIXFN;
Device2PCS: LPLUT;
PCS2Device: LPLUT;
Gamut: LPLUT;
Preview: LPLUT;
DeviceLink: LPLUT;
InMatShaper: LPMATSHAPER;
OutMatShaper: LPMATSHAPER;
SmeltMatShaper: LPMATSHAPER;
Phase1, Phase2, Phase3: integer;
NamedColorList: LPcmsNAMEDCOLORLIST;
lInputV4Lab, lOutputV4Lab: longbool;
CacheIn: array[0..MAXCHANNELS - 1] of word;
CacheOut: array[0..MAXCHANNELS - 1] of word;
end;
_cmstransform_struct = _cmsTRANSFORM;
P_cmstransform_struct = ^_cmstransform_struct;
cmsCIELab = packed record
L: double;
a: double;
b: double;
end;
LPcmsCIELab = ^cmsCIELab;
// lut8, input & output tables are always 256 bytes in length */
icLut8 = packed record
inputChan: icUInt8Number; // Num of input channels */
outputChan: icUInt8Number; // Num of output channels */
clutPoints: icUInt8Number; // Num of grid points */
pad: icInt8Number;
e00: icS15Fixed16Number; // e00 in the 3 * 3 */
e01: icS15Fixed16Number; // e01 in the 3 * 3 */
e02: icS15Fixed16Number; // e02 in the 3 * 3 */
e10: icS15Fixed16Number; // e10 in the 3 * 3 */
e11: icS15Fixed16Number; // e11 in the 3 * 3 */
e12: icS15Fixed16Number; // e12 in the 3 * 3 */
e20: icS15Fixed16Number; // e20 in the 3 * 3 */
e21: icS15Fixed16Number; // e21 in the 3 * 3 */
e22: icS15Fixed16Number; // e22 in the 3 * 3 */
data: array[0..0] of icUInt8Number; // Data follows see spec */
(*
* Data that follows is of this form
*
* icUInt8Number inputTable[inputChan][256]; * The in-table
* icUInt8Number clutTable[icAny]; * The clut
* icUInt8Number outputTable[outputChan][256]; * The out-table
*)
end;
_cmsTestAlign8 = packed record
a: icS15Fixed16Number;
b: icUInt8Number;
end;
// lut16 */
icLut16 = packed record
inputChan: icUInt8Number; // Number of input channels */
outputChan: icUInt8Number; // Number of output channels */
clutPoints: icUInt8Number; // Number of grid points */
pad: icInt8Number; // Padding for byte alignment */
e00: icS15Fixed16Number; // e00 in the 3 * 3 */
e01: icS15Fixed16Number; // e01 in the 3 * 3 */
e02: icS15Fixed16Number; // e02 in the 3 * 3 */
e10: icS15Fixed16Number; // e10 in the 3 * 3 */
e11: icS15Fixed16Number; // e11 in the 3 * 3 */
e12: icS15Fixed16Number; // e12 in the 3 * 3 */
e20: icS15Fixed16Number; // e20 in the 3 * 3 */
e21: icS15Fixed16Number; // e21 in the 3 * 3 */
e22: icS15Fixed16Number; // e22 in the 3 * 3 */
inputEnt: icUInt16Number; // Num of in-table entries */
outputEnt: icUInt16Number; // Num of out-table entries */
data: array[0..0] of icUInt16Number; // Data follows see spec */
(*
* Data that follows is of this form
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -