PoDoFo::PdfColor Class Reference

#include <PdfColor.h>

List of all members.

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)
const PdfColoroperator= (const PdfColor &rhs)
bool operator== (const PdfColor &rhs) const
bool operator!= (const PdfColor &rhs) const
bool IsGrayScale () const
bool IsRGB () const
bool IsCMYK () const
EPdfColorSpace GetColorSpace () 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
PdfColor ConvertToGrayScale () const
PdfColor ConvertToRGB () const
PdfColor ConvertToCMYK () const
PdfArray ToArray () const

Static Public Member Functions

static PdfColor FromString (const char *pszName)
static PdfColor FromArray (const PdfArray &rArray)


Detailed Description

A color object can represent a either a grayscale value, a RGB color or a CMYK color.

All drawing functions in PoDoFo accept a PdfColor object to specify a drawing color in one of these colorspaces.


Constructor & Destructor Documentation

PoDoFo::PdfColor::PdfColor (  ) 

Create a PdfColor object that is RGB black.

PoDoFo::PdfColor::PdfColor ( double  dGray  ) 

Create a new PdfColor object with a grayscale value.

Parameters:
dGray a grayscalue 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

Parameters:
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

Parameters:
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  )  [inline]

Copy constructor

Parameters:
rhs copy rhs into this object


Member Function Documentation

PdfColor PoDoFo::PdfColor::ConvertToCMYK (  )  const

Converts the color object into a CMYK color object.

This is only a convinience function. It might be useful for on screen display but is in NO WAY suitable to professional printing!

Returns:
a CMYK color object
See also:
IsCMYK()

PdfColor PoDoFo::PdfColor::ConvertToGrayScale (  )  const

Converts the color object into a grayscale color object.

This is only a convinience function. It might be useful for on screen display but is in NO WAY suitable to professional printing!

Returns:
a grayscale color object
See also:
IsGrayScale()

PdfColor PoDoFo::PdfColor::ConvertToRGB (  )  const

Converts the color object into a RGB color object.

This is only a convinience function. It might be useful for on screen display but is in NO WAY suitable to professional printing!

Returns:
a RGB color object
See also:
IsRGB()

PdfColor PoDoFo::PdfColor::FromArray ( const PdfArray &  rArray  )  [static]

Creates a color object from a PdfArray which represents a color.

Raises an exception if this is no PdfColor!

Parameters:
rArray an array that must be a color PdfArray
Returns:
a PdfColor object

PdfColor PoDoFo::PdfColor::FromString ( const char *  pszName  )  [static]

Creates a color object from a string.

Parameters:
pszName a string describing a color.
Supported values are:
  • single gray values as string (e.g. '0.5')
  • a named color (e.g. 'auquamarine' or 'magenta')
  • hex values (e.g. FF002A (RGB) or FF12AB3D (CMYK))
  • PdfArray's

Returns:
a PdfColor object

double PoDoFo::PdfColor::GetBlack (  )  const [inline]

Get the black color value of this object.

Throws an exception if this is no CMYK color object.

Returns:
the black color value of this object (between 0.0 and 1.0)
See also:
IsCMYK

double PoDoFo::PdfColor::GetBlue (  )  const [inline]

Get the blue color value of this object.

Throws an exception if this is no RGB color object.

Returns:
the blue color value of this object (between 0.0 and 1.0)
See also:
IsRGB

EPdfColorSpace PoDoFo::PdfColor::GetColorSpace (  )  const [inline]

Get the colorspace of this PdfColor object

Returns:
the colorspace of this PdfColor object

double PoDoFo::PdfColor::GetCyan (  )  const [inline]

Get the cyan color value of this object.

Throws an exception if this is no CMYK color object.

Returns:
the cyan color value of this object (between 0.0 and 1.0)
See also:
IsCMYK

double PoDoFo::PdfColor::GetGrayScale (  )  const [inline]

Get the grayscale color value of this object.

Throws an exception if this is no grayscale color object.

Returns:
the grayscale color value of this object (between 0.0 and 1.0)
See also:
IsGrayScale

double PoDoFo::PdfColor::GetGreen (  )  const [inline]

Get the green color value of this object.

Throws an exception if this is no RGB color object.

Returns:
the green color value of this object (between 0.0 and 1.0)
See also:
IsRGB

double PoDoFo::PdfColor::GetMagenta (  )  const [inline]

Get the magenta color value of this object.

Throws an exception if this is no CMYK color object.

Returns:
the magenta color value of this object (between 0.0 and 1.0)
See also:
IsCMYK

double PoDoFo::PdfColor::GetRed (  )  const [inline]

Get the red color value of this object.

Throws an exception if this is no RGB color object.

Returns:
the red color value of this object (between 0.0 and 1.0)
See also:
IsRGB

double PoDoFo::PdfColor::GetYellow (  )  const [inline]

Get the yellow color value of this object.

Throws an exception if this is no CMYK color object.

Returns:
the yellow color value of this object (between 0.0 and 1.0)
See also:
IsCMYK

bool PoDoFo::PdfColor::IsCMYK (  )  const [inline]

Test if this is a CMYK color.

Returns:
true if this is a CMYK PdfColor object

bool PoDoFo::PdfColor::IsGrayScale (  )  const [inline]

Test if this is a grayscale color.

Returns:
true if this is a grayscale PdfColor object

bool PoDoFo::PdfColor::IsRGB (  )  const [inline]

Test if this is a RGB color.

Returns:
true if this is a RGB PdfColor object

bool PoDoFo::PdfColor::operator!= ( const PdfColor rhs  )  const [inline]

Test for inequality of colors.

Parameters:
rhs color to compare ro
Returns:
true if object color is not equal to rhs

const PdfColor & PoDoFo::PdfColor::operator= ( const PdfColor rhs  ) 

Assignment operator

Parameters:
rhs copy rhs into this object
Returns:
a reference to this color object

bool PoDoFo::PdfColor::operator== ( const PdfColor rhs  )  const [inline]

Test for equality of colors.

Parameters:
rhs color to compare ro
Returns:
true if object color is equal to rhs

PdfArray PoDoFo::PdfColor::ToArray (  )  const

Creates a PdfArray which represents a color from a color.

Returns:
a PdfArray object


Generated on Tue Jul 28 00:01:33 2009 for PoDoFo by  doxygen 1.5.9