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

SourceProfileRaw ICC profile bytes for the input colour space; an empty value selects the built-in standard sRGB profile
DestProfileRaw ICC profile bytes for the output colour space; an empty value selects the built-in standard sRGB profile
RenderingIntent0 perceptual, 1 relative colorimetric, 2 saturation, 3 absolute colorimetric; other values fall back to the source profile's declared intent
BlackPointCompensationMaps the source black onto the destination black in PCS XYZ before the final device conversion
SamplesInterleaved source tuples whose length must be a multiple of the source profile's component count; values outside 0 through 1 are clamped
ConvertedReceives the interleaved destination tuples, one tuple of destination components per input pixel

Return values

TrueAll pixels were converted through the profile chain
FalseA 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