|
PoDoFo 1.1.0
|
A color object can represent either a grayscale value, a RGB color, a CMYK color. More...
#include <PdfColor.h>
Public Member Functions | |
| PdfColor () | |
| Create a PdfColor object that is grayscale black. | |
| PdfColor (double gray) | |
| Create a new PdfColor object with a grayscale value. | |
| PdfColor (double red, double green, double blue) | |
| Create a new PdfColor object with a RGB color. | |
| PdfColor (double cyan, double magenta, double yellow, double black) | |
| Create a new PdfColor object with a CMYK color. | |
| PdfColor (const PdfColor &rhs)=default | |
| Copy constructor. | |
| bool | IsGrayScale () const |
| Test if this is a grayscale color. | |
| bool | IsRGB () const |
| Test if this is a RGB color. | |
| bool | IsCMYK () const |
| Test if this is a CMYK color. | |
| bool | IsTransparent () const |
| PdfColorSpaceType | GetColorSpace () const |
| Get the colorspace of this PdfColor object. | |
| double | GetGrayScale () const |
| Get the grayscale color value of this object. | |
| double | GetRed () const |
| Get the red color value of this object. | |
| double | GetGreen () const |
| Get the green color value of this object. | |
| double | GetBlue () const |
| Get the blue color value of this object. | |
| double | GetCyan () const |
| Get the cyan color value of this object. | |
| double | GetMagenta () const |
| Get the magenta color value of this object. | |
| double | GetYellow () const |
| Get the yellow color value of this object. | |
| double | GetBlack () const |
| Get the black color value of this object. | |
| PdfColor | ConvertToGrayScale () const |
| Converts the color object into a grayscale color object. | |
| PdfColor | ConvertToRGB () const |
| Converts the color object into a RGB color object. | |
| PdfColor | ConvertToCMYK () const |
| Converts the color object into a CMYK color object. | |
| PdfArray | ToArray () const |
| Creates a PdfArray which represents a color from a color. | |
| unsigned char | GetComponentCount () const |
| const PdfColorRaw & | GetRawColor () const |
| PdfColor & | operator= (const PdfColor &rhs)=default |
| Assignment operator. | |
| bool | operator== (const PdfColor &rhs) const |
| Test for equality of colors. | |
| bool | operator!= (const PdfColor &rhs) const |
| Test for inequality of colors. | |
Static Public Member Functions | |
| static bool | TryCreateFromObject (const PdfObject &obj, PdfColor &color) |
| Creates a color object from a PdfArray which represents a color. | |
| static PdfColor | CreateFromObject (const PdfObject &obj) |
| static PdfColor | CreateTransparent () |
| static PdfColor | CreateFromString (const std::string_view &name) |
| Creates a color object from a string. | |
A color object can represent either a grayscale value, a RGB color, a CMYK color.
All drawing functions in PoDoFo accept a PdfColor object to specify a drawing color in one of these colorspaces.
|
explicit |
Create a new PdfColor object with a grayscale value.
| gray | a grayscale value between 0.0 and 1.0 |
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 |
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 |
Copy constructor.
| rhs | copy rhs into this 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!
| 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.
|
inline |
| 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::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.
| 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::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.
Test for inequality of colors.
| rhs | color to compare to |
Assignment operator.
| rhs | copy rhs into this object |
Test for equality of colors.
| rhs | color to compare to |
| PdfArray PdfColor::ToArray | ( | ) | const |