NamedColorSpace Class Documentation
class NamedColorSpace : ColorSpaceNamespace:datalogics_interface
- Inherits from:
ColorSpace
Detailed Description
Class used to define the color space in use.
Referenced by
Uses types
Constructor & Destructor Documentation
NamedColorSpace
NamedColorSpace(const std::string & name)Parameters
name: const std::string &the name of the color space.
Create a named color space with the given name, e.g. DeviceRGB
Member Function Documentation
device_cmyk
static NamedColorSpace device_cmyk()Returns:
NamedColorSpaceA new NamedColorSpace for DeviceCMYK (4 components).
Creates a NamedColorSpace representing the DeviceCMYK color space.
device_gray
static NamedColorSpace device_gray()Returns:
NamedColorSpaceA new NamedColorSpace for DeviceGray (1 component).
Creates a NamedColorSpace representing the DeviceGray color space.
device_rgb
static NamedColorSpace device_rgb()Returns:
NamedColorSpaceA new NamedColorSpace for DeviceRGB (3 components).
Creates a NamedColorSpace representing the DeviceRGB color space.
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.
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.