PLInitGroupColorLUT
Compliance, colour management
Description
Builds the lookup tables that convert colours in and out of a transparency group's blending space. Modes 0 through 2 (DeviceRGB, DeviceGray and CalGray or ICC-based grey) only record the mode and gamma and return true, because no table is needed. Mode 3 (ICC-based RGB) parses a three-component profile and fills 17 by 17 by 17 FromSRGB and ToSRGB tables through the pure Pascal ICC engine; a node whose conversion fails falls back to the identity colour. Mode 4 (DeviceCMYK or ICC-based CMYK) fills a 17 by 17 by 17 FromSRGBToCMYK table and a 13 by 13 by 13 by 13 FromCMYKToSRGB table.
For mode 4 a valid four-component profile drives both tables through the profile chain; when the profile is missing or a conversion direction fails, the affected entries fall back to a naive black-extraction CMYK conversion, so mode 4 still succeeds without a profile. A rendering intent outside 0 through 3 falls back to the profile's declared intent.
Mode 3 returns false when the profile is missing or does not declare three components, and any mode above 4 fails. The record is reset first, so a partially filled LUT is never left behind.
Syntax
Delphi
Function PLInitGroupColorLUT(Mode: Integer; Gamma: Double;
Const Profile: AnsiString; RenderingIntent: Integer;
Out GroupLUT: TPDFGroupColorLUT): Boolean;Parameters
| Mode | Blending space selector: 0 DeviceRGB, 1 DeviceGray, 2 CalGray or ICC grey, 3 ICC-based RGB, 4 DeviceCMYK or ICC-based CMYK |
|---|---|
| Gamma | Gamma recorded in the LUT for the grey modes, applied when the tables are consumed |
| Profile | Raw ICC profile bytes for modes 3 and 4; ignored for the device modes and may be empty for mode 4 |
| RenderingIntent | 0 through 3 for the profile-driven conversions; other values select the profile's own declared intent |
| GroupLUT | Receives the prepared record, grid sizes and lookup tables |
Return values
| True | The LUT is ready for the requested mode; for mode 4 the tables may carry fallback conversions when no profile was supplied |
|---|---|
| False | The mode is out of range, or mode 3 received no valid three-component profile |
See also
ICCComponentTransforms, ICCProfileComponents, ParseICCProfileHeader, DefaultRGBProfile