Transform
Color management
Description
Converts interleaved source colour component tuples through the transform built by TPDFICCComponentTransform.Create and writes the interleaved destination tuples. Input and output values use the unit range 0 through 1; the implementation maps Lab components (0 through 1 to L* 0 through 100 and a* and b* -128 through 127), XYZ components (0 through 1.99997) and the percentage encoding the CMM uses for CMYK, CMY and nCLR profiles with five or more channels to and from that range internally.
The sample count must be a whole number of input tuples, every sample must be finite, and the combined input and output must stay inside a 256 MiB budget of doubles. Work is handed to the CMM in batches of 4096 pixels, input samples are clamped to the unit range, and each converted value is clamped back into it.
A failed call clears Converted and leaves an English diagnostic in LastError; the instance must be Valid before any conversion is attempted.
Syntax
Delphi
function TPDFICCComponentTransform.Transform(const Samples: array of Double;
var Converted: TPLICCComponentValues): Boolean;Parameters
| Samples | Interleaved complete source tuples, InputComponents values per pixel; finite values outside the unit range are clamped, and an empty input succeeds with an empty output |
|---|---|
| Converted | Receives the interleaved destination tuples, OutputComponents values per pixel; the caller may pass the same variable that holds the samples for in-place conversion, and the array is cleared on failure |
Return values
| True | All tuples were converted; Converted holds Length(Samples) div InputComponents pixels times OutputComponents finite values in the unit range |
|---|---|
| False | The instance is not valid, the input is not a whole number of tuples, a sample is NaN or infinite, the 256 MiB sample budget is exceeded or the backend produced a non-finite value; LastError names the cause |
Remarks
The instance retains aliased input storage before clearing a caller's reusable output array, so one output variable can safely be recycled across calls.
Each instance owns its library handle, CMM context, profiles and transform; use a separate instance per concurrent caller.
See also
ICCComponentTransforms, ICCProfileComponents, ICCBasedRendering