PLPureICCTransformComponents
Compliance, colour management
Description
Converts unit-range colour component tuples between two ICC profiles entirely in Pascal, with no CMM library involved. Both profiles are parsed in full, each must declare 1 through 4 colour components, and every pixel is carried device to PCS XYZ, optionally black-point compensated, then PCS XYZ to device.
Black point compensation maps the estimated source black onto the estimated destination black per axis, relative to the D50 media white (0.9642, 1.0, 0.8249), using a scale and offset on the XYZ coordinates. A rendering intent outside 0 through 3 falls back to the source profile's own declared intent.
Input samples are clamped to the unit range and so is every output value. This engine is the fallback used when no LittleCMS runtime is available, and it also serves profiles the platform colour services cannot convert.
Syntax
Delphi
Function PLPureICCTransformComponents(Const SourceProfile, DestProfile: AnsiString;
RenderingIntent: Integer; BlackPointCompensation: Boolean;
Const Samples: Array Of Double; Out Converted: TPDFDoubleArray): Boolean;Parameters
| SourceProfile | Raw ICC profile bytes for the input colour space; an empty value selects the built-in standard sRGB profile |
|---|---|
| DestProfile | Raw ICC profile bytes for the output colour space; an empty value selects the built-in standard sRGB profile |
| RenderingIntent | 0 perceptual, 1 relative colorimetric, 2 saturation, 3 absolute colorimetric; other values fall back to the source profile's declared intent |
| BlackPointCompensation | Maps the source black onto the destination black in PCS XYZ before the final device conversion |
| Samples | Interleaved source tuples whose length must be a multiple of the source profile's component count; values outside 0 through 1 are clamped |
| Converted | Receives the interleaved destination tuples, one tuple of destination components per input pixel |
Return values
| True | All pixels were converted through the profile chain |
|---|---|
| False | A profile cannot be parsed, a component count is outside 1 through 4, the samples are not a whole number of tuples or a pixel conversion step failed |
See also
ICCComponentTransforms, ParseICCProfileHeader, DefaultRGBProfile, ICCProfileComponents