Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 66

Previous Page 65   Index   Next Page 67

Color spaces
Page 66 of 750
PDF_CMYK() or with the function CMYK() defined in the DynaPDF interfaces for the used
programming language. See also Color Values.
Device color spaces can be set directly with the functions SetColorSpace(), SetFillColorSpace(), and
Device Independent Color Spaces
Calibrated color in PDF is defined in terms of an international standard used in the graphic arts,
television, and printing industries. CIE-based color spaces enable a page description to specify color
values in a way that is related to human visual perception. The goal is for the same color
specification to produce consistent results on different output devices, within the limitations of each
device. PDF 1.1 supports three CIE-based color space families, named CalGray, CalRGB, and Lab;
PDF 1.3 adds a fourth, named ICCBased.
While CalGray, CalRGB, or Lab use relatively simple formulas to convert colors into a device color
space, an ICCBased color space uses a color profile instead. A color profile offers much more control
over the color conversion process to match the characteristics of an output device precisely.
Device independent color spaces require a color space object that must be created before the color
space can be used:
CreateCIEColorSpace() creates a CalGray, CalRGB, or Lab color space.
CreateICCBasedColorSpace() creates an ICCBased color space.
The functions above return a color space handle on success which is required to set the color space
with SetExtColorSpace(). Color values for CIE based color spaces can be created in the very same
way as for device color spaces (see previous section) with the exception of Lab colors which require a
special treatment depending on the used programming language (see CreateCIEColorSpace() for
further information).
Special Color Spaces
Special color spaces add features or properties to an underlying color space. There are four special
color space families: Pattern, Indexed, Separation, and DeviceN. The Pattern color space is not
described here since DynaPDF provides separate functions to create and apply pattern color spaces
(see BeginPattern() for further information).
Indexed Color Space
An Indexed color space allows a PDF content stream to use small integers as indices into a color map
or color table of arbitrary colors in some other space. A PDF consumer application treats each sample
value as an index into the color table and uses the color value it finds there. Indexed color spaces are
mostly used to reduce the amount of data for sampled images. The usage within a page description
is possible but there is normally no advantage to do so. DynaPDF creates indexed color spaces for
sampled images automatically if the original data was organized in this way.

Previous topic: Device Color Spaces

Next topic: Separation Color Space