DeviceNColorSpace Class Documentation

classDeviceNColorSpace : ColorSpace

Namespace:datalogics_interface

Inherits from:
ColorSpace

Detailed Description

DeviceN color spaces were designed to represent color spaces containing multiple color components that correspond to the colorants of some target device. They provide greater flexibility than is possible with standard device color spaces such as DeviceCMYK or with individual Separation color spaces. For example, it is possible to create a DeviceN color space consisting of only the cyan, magenta, and yellow color components, with the black component excluded.

Constructor & Destructor Documentation

DeviceNColorSpace

DeviceNColorSpace(const std::vector< std::string > &names, const ColorSpace &alternate, const Function &tint_transform)

Parameters

names: const std::vector< std::string > &

the names of the colorants that the DeviceN space is intended to represent, among which may be All, or None

alternate: const ColorSpace &

the alternate color space, which can be any device or CIE-based color space but not another special color space (Pattern, Indexed, Separation, or DeviceN).

tint_transform: const Function &

function, called with the tint value and returning the corresponding color component values. That is, the number of components and the interpretation of their values depend on the alternate color space.

Create a DeviceN color space.

Member Function Documentation

get_function

Returns:

std::unique_ptr< Function >

A function, called with the tint value and returning the corresponding color component values. That is, the number of components and the interpretation of their values depend on the alternate color space.

get_name

std::stringget_name()

Returns:

std::string

The name of the color space. A named color space may be named something like DeviceRGB. More complicated color spaces may have a name like Indexed or ICCBased.

get_names

std::vector< std::string >get_names()

Returns:

std::vector< std::string >

the names of the colorant that the DeviceN space is intended to represent, some of which may be All or None

get_num_components

intget_num_components()

Returns:

The number of color components.

For example, DeviceGray has 1 component, DeviceRGB has 3, and DeviceCMYK has 4.

get_pdf_object

Returns:

The PDFObject associated with the color space.

Get the PDFObject associated with the color space. This may be a PDFName, PDFDict, PDFStream, or PDFArray.

operator==

booloperator==(const ColorSpace &other)

Parameters

other: const ColorSpace &

The ColorSpace to compare against.

Returns:

true if the two color spaces are equal, false otherwise.

This works best for named color spaces.

More complex color spaces (such as ICCBased) do not support equality testing and will always return false.

to_string

std::stringto_string()

Returns:

A string describing this ColorSpace.

Convert a ColorSpace to a string representation.