Clutter::Color Class Reference

#include <color.h>

List of all members.

Public Member Functions

 Color (ClutterColor *gobject, bool make_a_copy=true)
 Color (const Color &other)
Coloroperator= (const Color &other)
 ~Color ()
void swap (Color &other)
ClutterColor * gobj ()
 Provides access to the underlying C instance.
const ClutterColor * gobj () const
 Provides access to the underlying C instance.
ClutterColor * gobj_copy () const
 Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
 Color ()
 Color (guint8 red, guint8 green, guint8 blue, guint8 alpha=255)
 Create a new Color object by specifying its value in RGB(A).
 Color (guint32 pixel)
 Create a new Color object by specifying its pixel value.
 Color (const Glib::ustring &color)
void set_from_rgb (guint8 red, guint8 blue, guint8 green)
void set_from_string (const Glib::ustring &color)
Glib::ustring to_string () const
 Return value: a newly-allocated text string.
void set_from_hls (guint8 hue, guint8 luminance, guint8 saturation)
 Converts a color expressed in HLS (hue, luminance and saturation) values into a Clutter::Color.
void set_from_hlsx (Fixed hue, Fixed luminance, Fixed saturation)
 Converts a color expressed in HLS (hue, luminance and saturation) values into a Clutter::Color.
void to_hls (guint8 &hue, guint8 &luminance, guint8 &saturation) const
 Converts src to the HLS format.
void to_hlsx (Fixed &hue, Fixed &luminance, Fixed &saturation) const
 Converts src to the HLS format.
void set_from_pixel (guint32 pixel)
 Converts pixel from the packed representation of a four 8 bit channel color to a Clutter::Color.
guint32 to_pixel () const
 Converts src into a packed 32 bit integer, containing all the four 8 bit channels used by Clutter::Color.
Color add (const Color &color) const
 Adds src2 to src1 and saves the resulting color inside dest.
Color subtract (const Color &color) const
 Subtracts src2 from src1 and saves the resulting color inside dest.
void darken ()
 Darkens src by a fixed amount, and saves the changed color in dest.
void lighten ()
 Lightens src by a fixed amount, and saves the changed color in dest.
void shade (double shade)
 Shades src by the factor of shade and saves the modified color into dest.
void shadex (Fixed shade)
 Fixed point version of clutter_color_shade().
guint8 get_red () const
void set_red (const guint8 &value)
guint8 get_green () const
void set_green (const guint8 &value)
guint8 get_blue () const
void set_blue (const guint8 &value)
guint8 get_alpha () const
void set_alpha (const guint8 &value)

Protected Attributes

ClutterColor * gobject_

Related Functions

(Note that these are not member functions.)

Color operator+ (const Color &color1, const Color &color2)
Color operator- (const Color &color1, const Color &color2)
bool operator== (const Color &lhs, const Color &rhs)
bool operator!= (const Color &lhs, const Color &rhs)
void swap (Color &lhs, Color &rhs)
Clutter::Color wrap (ClutterColor *object, bool take_copy=false)
 A Glib::wrap() method for this object.


Constructor & Destructor Documentation

Clutter::Color::Color ( ClutterColor *  gobject,
bool  make_a_copy = true 
) [explicit]

Clutter::Color::Color ( const Color other  ) 

Clutter::Color::~Color (  ) 

Clutter::Color::Color (  ) 

Clutter::Color::Color ( guint8  red,
guint8  green,
guint8  blue,
guint8  alpha = 255 
)

Create a new Color object by specifying its value in RGB(A).

Clutter::Color::Color ( guint32  pixel  )  [explicit]

Create a new Color object by specifying its pixel value.

Clutter::Color::Color ( const Glib::ustring &  color  )  [explicit]


Member Function Documentation

Color& Clutter::Color::operator= ( const Color other  ) 

void Clutter::Color::swap ( Color other  ) 

Referenced by swap().

ClutterColor* Clutter::Color::gobj (  )  [inline]

Provides access to the underlying C instance.

References gobject_.

const ClutterColor* Clutter::Color::gobj (  )  const [inline]

Provides access to the underlying C instance.

References gobject_.

ClutterColor* Clutter::Color::gobj_copy (  )  const

Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.

void Clutter::Color::set_from_rgb ( guint8  red,
guint8  blue,
guint8  green 
)

void Clutter::Color::set_from_string ( const Glib::ustring &  color  ) 

Glib::ustring Clutter::Color::to_string (  )  const

Return value: a newly-allocated text string.

Returns:
A newly-allocated text string
Since: 0.2.

void Clutter::Color::set_from_hls ( guint8  hue,
guint8  luminance,
guint8  saturation 
)

Converts a color expressed in HLS (hue, luminance and saturation) values into a Clutter::Color.

Parameters:
hue Hue value (0 .. 255).
luminance Luminance value (0 .. 255).
saturation Saturation value (0 .. 255).

void Clutter::Color::set_from_hlsx ( Fixed  hue,
Fixed  luminance,
Fixed  saturation 
)

Converts a color expressed in HLS (hue, luminance and saturation) values into a Clutter::Color.

Parameters:
hue Hue value (0 .. 360).
luminance Luminance value (0 .. 1).
saturation Saturation value (0 .. 1).

void Clutter::Color::to_hls ( guint8 &  hue,
guint8 &  luminance,
guint8 &  saturation 
) const

Converts src to the HLS format.

Returned HLS values are from interval 0 .. 255.

Parameters:
hue Return location for the hue value or 0.
luminance Return location for the luminance value or 0.
saturation Return location for the saturation value or 0.

void Clutter::Color::to_hlsx ( Fixed hue,
Fixed luminance,
Fixed saturation 
) const

Converts src to the HLS format.

Returned hue is in degrees (0 .. 360), luminance and saturation from interval <0 .. 1>.

Parameters:
hue Return location for the hue value or 0.
luminance Return location for the luminance value or 0.
saturation Return location for the saturation value or 0.

void Clutter::Color::set_from_pixel ( guint32  pixel  ) 

Converts pixel from the packed representation of a four 8 bit channel color to a Clutter::Color.

Parameters:
pixel A 32 bit packed integer containing a color.

guint32 Clutter::Color::to_pixel (  )  const

Converts src into a packed 32 bit integer, containing all the four 8 bit channels used by Clutter::Color.

Returns:
A packed color.

Color Clutter::Color::add ( const Color color  )  const

Adds src2 to src1 and saves the resulting color inside dest.

The alpha channel of dest is as the maximum value between the alpha channels of src1 and src2.

Parameters:
src2 A Clutter::Color.
dest Return location for the result.

Color Clutter::Color::subtract ( const Color color  )  const

Subtracts src2 from src1 and saves the resulting color inside dest.

This function assumes that the components of src1 are greater than the components of src2; the result is, otherwise, undefined.

The alpha channel of dest is set as the minimum value between the alpha channels of src1 and src2.

Parameters:
src2 A Clutter::Color.
dest Return location for the result.

void Clutter::Color::darken (  ) 

Darkens src by a fixed amount, and saves the changed color in dest.

Parameters:
dest Return location for the darker color.

void Clutter::Color::lighten (  ) 

Lightens src by a fixed amount, and saves the changed color in dest.

Parameters:
dest Return location for the lighter color.

void Clutter::Color::shade ( double  shade  ) 

Shades src by the factor of shade and saves the modified color into dest.

Parameters:
dest Return location for the shaded color.
shade The shade factor to apply.

void Clutter::Color::shadex ( Fixed  shade  ) 

Fixed point version of clutter_color_shade().

Shades src by the factor of shade and saves the modified color into dest.

Since: 0.2

Parameters:
dest Return location for the shaded color.
shade Clutter::Fixed the shade factor to apply.

guint8 Clutter::Color::get_red (  )  const

void Clutter::Color::set_red ( const guint8 &  value  ) 

guint8 Clutter::Color::get_green (  )  const

void Clutter::Color::set_green ( const guint8 &  value  ) 

guint8 Clutter::Color::get_blue (  )  const

void Clutter::Color::set_blue ( const guint8 &  value  ) 

guint8 Clutter::Color::get_alpha (  )  const

void Clutter::Color::set_alpha ( const guint8 &  value  ) 


Friends And Related Function Documentation

Color operator+ ( const Color color1,
const Color color2 
) [related]

Returns:
the sum of color1 and color2

Color operator- ( const Color color1,
const Color color2 
) [related]

Returns:
the color resulting from subtracting color2 from color1

bool operator== ( const Color lhs,
const Color rhs 
) [related]

Parameters:
lhs The left-hand side
rhs The right-hand side
Returns:
The result

bool operator!= ( const Color lhs,
const Color rhs 
) [related]

Parameters:
lhs The left-hand side
rhs The right-hand side
Returns:
The result

void swap ( Color lhs,
Color rhs 
) [related]

Parameters:
lhs The left-hand side
rhs The right-hand side

References swap().

Clutter::Color wrap ( ClutterColor *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
object The C instance.
take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns:
A C++ instance that wraps this C instance.


Member Data Documentation

ClutterColor* Clutter::Color::gobject_ [protected]

Referenced by gobj().


The documentation for this class was generated from the following file:

Generated on Fri Jun 6 02:16:48 2008 for cluttermm by  doxygen 1.5.5