CalRGBColorSpace Class Documentation

class CalRGBColorSpace : ColorSpace

Namespace:datalogics_interface

Inherits from:
ColorSpace

Detailed Description

A calibrated RGB color space.

A CalRGB color space (Red, Green, Blue) is a CIE-based ABC color space with only one transformation stage instead of two.

In this type of space, A, B, and C represent calibrated red, green, and blue color values. These three color components must be in the range 0.0 to 1.0; component values falling outside that range are adjusted to the nearest valid value without error indication.

Uses types

Constructor & Destructor Documentation

CalRGBColorSpace

CalRGBColorSpace(const std::vector< double > & white_point)

Parameters

white_point: const std::vector< double > &

An array of three numbers specifying the tristimulus value, in the CIE 1931 XYZ space, of the diffuse white point. The numbers X and Z must be positive, and Y must be equal to 1.0.

Create a CalRGB color space.

CalRGBColorSpace

CalRGBColorSpace(const std::vector< double > & white_point, const std::vector< double > & black_point, const std::vector< double > & gamma, const std::vector< double > & matrix)

Parameters

white_point: const std::vector< double > &

An array of three numbers specifying the tristimulus value, in the CIE 1931 XYZ space, of the diffuse white point. The numbers X and Z must be positive, and Y must be equal to 1.0.

black_point: const std::vector< double > &

An array of three numbers specifying the tristimulus value, in the CIE 1931 XYZ space, of the diffuse black point. All three of these numbers must be non-negative.

gamma: const std::vector< double > &

An array of three numbers [ GR GG GB ] specifying the gamma for the red, green, and blue (A, B, and C) components of the color space.

matrix: const std::vector< double > &

An array of nine numbers [ XA YA ZA XB YB ZB XC YC ZC ] specifying the linear interpretation of the decoded A, B, and C components of the color space with respect to the final XYZ representation.

Create a CalRGB color space.

Member Function Documentation

get_black_point

std::vector< double > get_black_point()

Returns:

std::vector< double >

An array of three numbers specifying the tristimulus value, in the CIE 1931 XYZ space, of the diffuse black point. All three of these numbers must be non-negative.

get_gamma

std::vector< double > get_gamma()

Returns:

std::vector< double >

A number G defining the gamma for the gray component. G must be positive and is generally greater than or equal to 1.

get_matrix

std::vector< double > get_matrix()

Returns:

std::vector< double >

An array of nine numbers [ XA YA ZA XB YB ZB XC YC ZC ] specifying the linear interpretation of the decoded A, B, and C components of the color space with respect to the final XYZ representation.

get_name

std::string get_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_num_components

int get_num_components()

Returns:

int

The number of color components.

The number of components in the color space.

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

get_white_point

std::vector< double > get_white_point()

Returns:

std::vector< double >

An array of three numbers specifying the tristimulus value, in the CIE 1931 XYZ space, of the diffuse white point. The numbers X and Z must be positive, and Y must be equal to 1.0.

operator==

bool operator==(const ColorSpace & other)

Parameters

other: const ColorSpace &

The ColorSpace to compare against.

Returns:

bool

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

Test for equality.

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::string to_string()

Returns:

std::string

A string describing this ColorSpace.

Convert a ColorSpace to a string representation.