PoDoFo 0.9.6
|
#include <PdfColor.h>
Inherited by PoDoFo::PdfColorCMYK, PoDoFo::PdfColorCieLab, PoDoFo::PdfColorGray, PoDoFo::PdfColorRGB, PoDoFo::PdfColorSeparation, PoDoFo::PdfColorSeparationAll, and PoDoFo::PdfColorSeparationNone.
Public Member Functions | |
PdfColor () | |
PdfColor (double dGray) | |
PdfColor (double dRed, double dGreen, double dBlue) | |
PdfColor (double dCyan, double dMagenta, double dYellow, double dBlack) | |
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 |
EPdfColorSpace | GetColorSpace () const |
EPdfColorSpace | 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 (PdfVecObjects *pOwner) const |
Static Public Member Functions | |
static PdfColor | FromString (const char *pszName) |
static PdfColor | FromArray (const PdfArray &rArray) |
static EPdfColorSpace | GetColorSpaceForName (const PdfName &rName) |
static PdfName | GetNameForColorSpace (EPdfColorSpace eColorSpace) |
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 PoDoFo 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
PoDoFo::PdfColor::PdfColor | ( | ) |
Create a PdfColor object that is RGB black.
|
explicit |
Create a new PdfColor object with a grayscale value.
dGray | a grayscale value between 0.0 and 1.0 |
PoDoFo::PdfColor::PdfColor | ( | double | dRed, |
double | dGreen, | ||
double | dBlue | ||
) |
Create a new PdfColor object with a RGB color
dRed | the value of the red component, must be between 0.0 and 1.0 |
dGreen | the value of the green component, must be between 0.0 and 1.0 |
dBlue | the value of the blue component, must be between 0.0 and 1.0 |
PoDoFo::PdfColor::PdfColor | ( | double | dCyan, |
double | dMagenta, | ||
double | dYellow, | ||
double | dBlack | ||
) |
Create a new PdfColor object with a CMYK color
dCyan | the value of the cyan component, must be between 0.0 and 1.0 |
dMagenta | the value of the magenta component, must be between 0.0 and 1.0 |
dYellow | the value of the yellow component, must be between 0.0 and 1.0 |
dBlack | the value of the black component, must be between 0.0 and 1.0 |
PoDoFo::PdfColor::PdfColor | ( | const PdfColor & | rhs | ) |
Copy constructor
rhs | copy rhs into this object |
|
virtual |
Destructor
PdfObject * PoDoFo::PdfColor::BuildColorSpace | ( | PdfVecObjects * | pOwner | ) | const |
Creates a colorspace object from a color to insert into resources.
pOwner | a pointer to the owner of the generated object |
PdfColor PoDoFo::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 PoDoFo::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 PoDoFo::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 |
|
inline |
|
inline |
Get the black color value of this object.
Throws an exception if this is no CMYK or separation color object.
|
inline |
Get the blue color value of this object.
Throws an exception if this is no RGB color object.
|
inline |
Get the A color value of this object.
Throws an exception if this is no CIE-Lab color object.
|
inline |
Get the B color value of this object.
Throws an exception if this is no CIE-Lab color object.
|
inline |
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.
rName | name representing a colorspace such as DeviceGray |
|
inline |
Get the cyan color value of this object.
Throws an exception if this is no CMYK or separation color object.
|
inline |
Get the density color value of this object.
Throws an exception if this is no separation color object.
|
inline |
Get the grayscale color value of this object.
Throws an exception if this is no grayscale color object.
|
inline |
Get the green color value of this object.
Throws an exception if this is no RGB color object.
|
inline |
Get the magenta color value of this object.
Throws an exception if this is no CMYK or separation color object.
|
inline |
Get the separation name of this object.
Throws an exception if this is no separation color object.
|
static |
Convert a colorspace enum value into a name such as DeviceRGB
eColorSpace | a colorspace |
|
inline |
Get the red color value of this object.
Throws an exception if this is no RGB color object.
|
inline |
Get the yellow color value of this object.
Throws an exception if this is no CMYK or separation color object.
|
inline |
Test if this is a CIE-Lab color.
|
inline |
Test if this is a CMYK color.
|
inline |
Test if this is a grayscale color.
|
inline |
Test if this is a RGB color.
|
inline |
Test if this is a separation color.
|
inline |
Test for inequality of colors.
rhs | color to compare to |
Assignment operator
rhs | copy rhs into this object |
|
inline |
Test for equality of colors.
rhs | color to compare to |