|
pdfmm 0.9.20
|
#include <PdfColor.h>
Inherited by mm::PdfColorCMYK, mm::PdfColorCieLab, mm::PdfColorGray, mm::PdfColorRGB, mm::PdfColorSeparation, mm::PdfColorSeparationAll, and mm::PdfColorSeparationNone.
Public Member Functions | |
| PdfColor () | |
| PdfColor (double gray) | |
| PdfColor (double red, double green, double blue) | |
| PdfColor (double cyan, double magenta, double yellow, double black) | |
| PdfColor (const PdfColor &rhs) | |
| virtual | ~PdfColor () |
| const PdfColor & | operator= (const PdfColor &rhs) |
| bool | operator== (const PdfColor &rhs) const |
| bool | operator!= (const PdfColor &rhs) const |
| bool | IsGrayScale () const |
| bool | IsRGB () const |
| bool | IsCMYK () const |
| bool | IsSeparation () const |
| bool | IsCieLab () const |
| PdfColorSpace | GetColorSpace () const |
| PdfColorSpace | GetAlternateColorSpace () const |
| double | GetGrayScale () const |
| double | GetRed () const |
| double | GetGreen () const |
| double | GetBlue () const |
| double | GetCyan () const |
| double | GetMagenta () const |
| double | GetYellow () const |
| double | GetBlack () const |
| const std::string & | GetName () const |
| double | GetDensity () const |
| double | GetCieL () const |
| double | GetCieA () const |
| double | GetCieB () const |
| PdfColor | ConvertToGrayScale () const |
| PdfColor | ConvertToRGB () const |
| PdfColor | ConvertToCMYK () const |
| PdfArray | ToArray () const |
| PdfObject * | BuildColorSpace (PdfDocument &document) const |
Static Public Member Functions | |
| static PdfColor | FromString (const std::string_view &name) |
| static PdfColor | FromArray (const PdfArray &arr) |
| static PdfColorSpace | GetColorSpaceForName (const PdfName &name) |
A color object can represent either a grayscale value, a RGB color, a CMYK color, a separation color or a CieLab color.
All drawing functions in pdfmm accept a PdfColor object to specify a drawing color in one of these colorspaces.
Derived classes PdfColorGray, PdfColorRGB, PdfColorCMYK, PdfColorSeparation and PdfColorCieLab are available for easy construction
| PdfColor::PdfColor | ( | ) |
Create a PdfColor object that is RGB black.
|
explicit |
Create a new PdfColor object with a grayscale value.
| gray | a grayscale value between 0.0 and 1.0 |
| PdfColor::PdfColor | ( | double | red, |
| double | green, | ||
| double | blue | ||
| ) |
Create a new PdfColor object with a RGB color
| red | the value of the red component, must be between 0.0 and 1.0 |
| green | the value of the green component, must be between 0.0 and 1.0 |
| blue | the value of the blue component, must be between 0.0 and 1.0 |
| PdfColor::PdfColor | ( | double | cyan, |
| double | magenta, | ||
| double | yellow, | ||
| double | black | ||
| ) |
Create a new PdfColor object with a CMYK color
| cyan | the value of the cyan component, must be between 0.0 and 1.0 |
| magenta | the value of the magenta component, must be between 0.0 and 1.0 |
| yellow | the value of the yellow component, must be between 0.0 and 1.0 |
| black | the value of the black component, must be between 0.0 and 1.0 |
| PdfColor::PdfColor | ( | const PdfColor & | rhs | ) |
Copy constructor
| rhs | copy rhs into this object |
|
virtual |
Destructor
| PdfObject * PdfColor::BuildColorSpace | ( | PdfDocument & | document | ) | const |
Creates a colorspace object from a color to insert into resources.
| document | a pointer to the owner document of the generated object |
| PdfColor PdfColor::ConvertToCMYK | ( | ) | const |
Converts the color object into a CMYK color object.
This is only a convenience function. It might be useful for on screen display but is in NO WAY suitable to professional printing!
| PdfColor PdfColor::ConvertToGrayScale | ( | ) | const |
Converts the color object into a grayscale color object.
This is only a convenience function. It might be useful for on screen display but is in NO WAY suitable to professional printing!
| PdfColor PdfColor::ConvertToRGB | ( | ) | const |
Converts the color object into a RGB color object.
This is only a convenience function. It might be useful for on screen display but is in NO WAY suitable to professional printing!
|
static |
| PdfColorSpace PdfColor::GetAlternateColorSpace | ( | ) | const |
| double PdfColor::GetBlack | ( | ) | const |
Get the black color value of this object.
Throws an exception if this is no CMYK or separation color object.
| double PdfColor::GetBlue | ( | ) | const |
Get the blue color value of this object.
Throws an exception if this is no RGB color object.
| double PdfColor::GetCieA | ( | ) | const |
Get the A color value of this object.
Throws an exception if this is no CIE-Lab color object.
| double PdfColor::GetCieB | ( | ) | const |
Get the B color value of this object.
Throws an exception if this is no CIE-Lab color object.
| double PdfColor::GetCieL | ( | ) | const |
Get the L color value of this object.
Throws an exception if this is no CIE-Lab color object.
|
inline |
|
static |
Convert a name into a colorspace enum.
| name | name representing a colorspace such as DeviceGray |
| double PdfColor::GetCyan | ( | ) | const |
Get the cyan color value of this object.
Throws an exception if this is no CMYK or separation color object.
| double PdfColor::GetDensity | ( | ) | const |
Get the density color value of this object.
Throws an exception if this is no separation color object.
| double PdfColor::GetGrayScale | ( | ) | const |
Get the grayscale color value of this object.
Throws an exception if this is no grayscale color object.
| double PdfColor::GetGreen | ( | ) | const |
Get the green color value of this object.
Throws an exception if this is no RGB color object.
| double PdfColor::GetMagenta | ( | ) | const |
Get the magenta color value of this object.
Throws an exception if this is no CMYK or separation color object.
| const string & PdfColor::GetName | ( | ) | const |
Get the separation name of this object.
Throws an exception if this is no separation color object.
| double PdfColor::GetRed | ( | ) | const |
Get the red color value of this object.
Throws an exception if this is no RGB color object.
| double PdfColor::GetYellow | ( | ) | const |
Get the yellow color value of this object.
Throws an exception if this is no CMYK or separation color object.
| bool PdfColor::IsCieLab | ( | ) | const |
Test if this is a CIE-Lab color.
| bool PdfColor::IsCMYK | ( | ) | const |
Test if this is a CMYK color.
| bool PdfColor::IsGrayScale | ( | ) | const |
Test if this is a grayscale color.
| bool PdfColor::IsRGB | ( | ) | const |
Test if this is a RGB color.
| bool PdfColor::IsSeparation | ( | ) | const |
Test if this is a separation color.
| bool PdfColor::operator!= | ( | const PdfColor & | rhs | ) | const |
Test for inequality of colors.
| rhs | color to compare to |
Assignment operator
| rhs | copy rhs into this object |
| bool PdfColor::operator== | ( | const PdfColor & | rhs | ) | const |
Test for equality of colors.
| rhs | color to compare to |