CalGrayColorSpace Class Documentation
class CalGrayColorSpace : ColorSpaceNamespace:datalogics_interface
- Inherits from:
ColorSpace
Detailed Description
A calibrated gray color space.
A CalGray color space is a special case of a single-component CIE-based color space, known as a CIE-based A color space.
This type of space is the one-dimensional (and usually achromatic) analog of CIE-based ABC spaces.
Uses types
Constructor & Destructor Documentation
CalGrayColorSpace
CalGrayColorSpace(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 CalGray color space.
CalGrayColorSpace
CalGrayColorSpace(const std::vector< double > & white_point, const std::vector< double > & black_point, double gamma)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: doubleA number G defining the gamma for the gray component. G must be positive and is generally greater than or equal to 1.
Create a CalGray 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
double get_gamma()Returns:
doubleA number G defining the gamma for the gray component. G must be positive and is generally greater than or equal to 1.
get_name
std::string get_name()Returns:
std::stringThe 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:
intThe 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_pdf_object
std::unique_ptr< PDFObject > get_pdf_object()Returns:
std::unique_ptr< PDFObject >The PDFObject associated with the color space.
Get the PDFObject associated with the color space. This may be a PDFName, PDFDict, PDFStream, or PDFArray.
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:
booltrue 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::stringA string describing this ColorSpace.
Convert a ColorSpace to a string representation.