Xojo Conferences

MBS | Oct | 2019 | Cologne | DE |

DynaPDF Manual - Page 222

Previous Page 221 Index Next Page 223

Function Reference

Page 222 of 770

CreateCIEColorSpace

Syntax:

SI32 pdfCreateCIEColorSpace(

const PPDF* IPDF,

// Instance pointer

TExtColorSpace CS, // Allowed values: esCalGray, esCalRGB, esLab

float* WhitePoint, // White point -> required

float* BlackPoint, // Optional black point

float* Gamma,

// Optional gamma value per component or Range in Lab

float* Matrix)

// Optional transformation matrix -> CalRGB only

The function creates a CIE-based color space. Three CIE-based color spaces are supported: CalGray,

CalRGB, and Lab.

The semantics of CIE-based color spaces are defined in terms of the relationship between the space’s

components and the tristimulus values X, Y, and Z of the CIE 1931 XYZ space. The CalRGB and Lab

color spaces (PDF 1.1) are special cases of three-component CIE-based color spaces, known as CIE-

based ABC color spaces. These spaces are defined in terms of a two-stage, nonlinear transformation

of the CIE 1931 XYZ space. See PDF Reference for further information.

A CalGray color space (PDF 1.1) is a special case of a single-component CIEbased color space, known

as CIE-based A color space. This type of space is the one-dimensional (and usually achromatic)

analog of CIE-based ABC spaces. Color values in a CIE-based A space have a single component,

arbitrarily named A.

The white point is an array of three numbers [XW YW ZW] specifying the tristimulus value, in the

CIE 1931 XYZ space, of the diffuse white point. The numbers XW and ZW must be positive, and YW

must be equal to 1.0. The parameter WhitePoint is always required.

The optional black point is an array of three numbers [XB YB ZB] specifying the tristimulus value, in

the CIE 1931 XYZ space, of the diffuse black point. All three of these numbers must be non-negative.

Default value: [0.0 0.0 0.0].

The parameter Gamma is optional and its meaning is different depending on the underlying color

space. If the color space is CalRGB or CalGray the array must contain gamma values for each

component. Default value: [1.0 1.0 1.0].

The Lab color space does not support gamma but it supports a range array which can be used to

define the valid ranges of the a* and b* components of the color space. So, the parameter Gamma can

be named as Range when a Lab color space will be created. If set, the array must contain exactly 4

values in the form [amin amax bmin bmax]. Default value: [-100 100 -100 100]. The valid range of the L*

component is always 0 to 100.

The parameter Matrix is optional and used in CalRGB color spaces only. If set, the array must contain

exactly 9 numbers representing a 3 x 3 matrix which specifies the linear interpretation of the decoded

A, B, and C components of the color space with respect to the final XYZ representation.

Previous topic: CreateCheckBox

Next topic: How to define CalGray colors?, How to define CalcRGB colors?, How to define Lab colors?