DynaPDF Manual - Page 239

Previous Page 238   Index   Next Page 240

Function Reference
Page 239 of 818
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.
How to define CalGray colors?
Since CalGray colors consist of only one component which ranges from 0 to 255 the colors can be
defined as if you would use DeviceGray. No further conversion function is required.
How to define CalcRGB colors?
CalRGB can be used in the same way as DeviceRGB. Each component of a CalRGB color space
ranges from 0 to 255. Use the macro PDF_RGB() to convert color components to a 32 bit integer.
Other programming languages than C/C++ support mostly a function like rgb() which does
essentially the same as the C macro PDF_RGB().
How to define Lab colors?
The Lab color space is a three component space where each component supports different ranges:
0 to 100
a* -128 to 127
b* -128 to 127
The ranges above define the maximum ranges which can be used in a Lab color space. In
comparison to RGB each component is defined as signed char while in RGB each component is
defined as unsigned char. C/C++ programmers can still use the macro PDF_RGB() to convert Lab
colors to 32 bit integers.
If you use another programming language it is usually best to convert negative component values to
unsigned char before passing the value to a function like rgb().

Previous topic: CreateCIEColorSpace

Next topic: CreateColItemDate

Start Chat