TPDFICCComponentTransform
Colour management
Description
TPDFICCComponentTransform converts complete component tuples between two ICC profiles through an optional LittleCMS 2 runtime. It supports GRAY, RGB, CMYK, CMY, Lab, XYZ and N-channel profiles, keeps every output channel and works in the unit range 0 through 1.
Each instance loads its own library handle, CMM context, profiles and transform. Construction does not raise for environmental failures: check Valid and read LastError before calling Transform.
InputComponents and OutputComponents report the source and destination channel counts; BackendVersion reports the encoded LittleCMS version.
Syntax
Delphi
TPDFICCComponentTransform = class
Public
constructor Create(const SourceProfile, TargetProfile: AnsiString;
RenderingIntent: Integer = 1; BlackPointCompensation: Boolean = False;
const LibraryFileName: AnsiString = '');
destructor Destroy; override;
function Transform(const Samples: array of Double;
var Converted: TPLICCComponentValues): Boolean;
property Valid: Boolean read FValid;
property InputComponents: Integer read FInputComponents;
property OutputComponents: Integer read FOutputComponents;
property BackendVersion: Integer read FVersion;
property LastError: AnsiString read FErrorText;
end;Fields
| Create | Constructor taking raw source and target profile bytes, a rendering intent from 0 through 3, the black-point-compensation flag and an optional library path |
|---|---|
| Transform | Converts interleaved source tuples; returns False and clears the destination array on failure |
| Valid | True only when the library, both profiles and the transform are ready |
| InputComponents | Source channel count, 1 through 15 |
| OutputComponents | Destination channel count, 1 through 15 |
| BackendVersion | Encoded version reported by the loaded LittleCMS runtime |
| LastError | English diagnostic for the last construction or conversion failure |
| Destroy | Frees the transform, profiles, CMM context and library handle |
Remarks
An empty source or target profile selects the CMM's standard sRGB profile.
A nonempty profile must be at least 132 bytes, no more than 16 MiB, contain the acsp signature at offset 36 and declare a size within the supplied bytes.
Construction accepts a rendering intent only in 0 through 3; any other value leaves Valid false with LastError set.
Transform clamps finite input samples to the unit range and rejects NaN or infinity before conversion, and it clears Converted before it validates anything else.
Use one instance per concurrent caller because the handle, context, profiles and transform are not shared.
See also
Transform, ICCComponentTransforms, ICCProfileComponents, ICCBasedRendering