Color Class Reference

An RGB color. More...

#include </usr1/tp517/Tumble/trunk/src/tumble/color.h>

List of all members.

Public Member Functions

 Color ()
 Generate a new Color, with black values.
 Color (float r, float g, float b)
 Generate a new Color with given values.
void assign (float r, float g, float b)
 Change current color to hold new values.
float R () const
 Get value of red.
float G () const
 Get value of green.
float B () const
 Get value of blue.
bool is_valid () const
 Check that values are valid.
Color operator * (double alpha) const
 Scale color by given constant.
Color operator+ (Color other) const

Public Attributes

float v [3]
 The R,G,B values of the color. All values are between 0.0 and 1.0.


Detailed Description

An RGB color.

This is used by any ouput format who needs to deal with colors. The two current examples of ouptu format being OpenGL and postscript.

Definition at line 17 of file color.h.


Constructor & Destructor Documentation

Color::Color (  )  [inline]

Generate a new Color, with black values.

Definition at line 22 of file color.h.

References v.

Referenced by operator *(), and operator+().

Color::Color ( float  r,
float  g,
float  b 
) [inline]

Generate a new Color with given values.

Definition at line 25 of file color.h.

References v.


Member Function Documentation

void Color::assign ( float  r,
float  g,
float  b 
) [inline]

Change current color to hold new values.

Definition at line 28 of file color.h.

References v.

float Color::R (  )  const [inline]

Get value of red.

Definition at line 30 of file color.h.

References v.

Referenced by EPSWrite::set_ink().

float Color::G (  )  const [inline]

Get value of green.

Definition at line 31 of file color.h.

References v.

Referenced by EPSWrite::set_ink().

float Color::B (  )  const [inline]

Get value of blue.

Definition at line 32 of file color.h.

References v.

Referenced by EPSWrite::set_ink().

bool Color::is_valid (  )  const

Check that values are valid.

Definition at line 40 of file color.C.

References v.

Referenced by Visualization::map_color(), EPSWrite::map_rgbcolor(), EPSWrite::set_bdry_ink(), EPSWrite::set_border_ink(), and EPSWrite::set_edge_ink().

Color Color::operator * ( double  alpha  )  const [inline]

Scale color by given constant.

Definition at line 36 of file color.h.

References Color(), and v.

Here is the call graph for this function:

Color Color::operator+ ( Color  other  )  const [inline]

Definition at line 41 of file color.h.

References Color(), and v.

Here is the call graph for this function:


Member Data Documentation

float Color::v[3]

The R,G,B values of the color. All values are between 0.0 and 1.0.

Definition at line 19 of file color.h.

Referenced by assign(), B(), Color(), Visualization::draw_bezier_edge(), Visualization::draw_bezier_triangle(), Visualization::draw_bezier_vertex(), Visualization::draw_boundary_edge(), Visualization::draw_boundary_edge_debug(), Visualization::draw_boundary_vertex(), Visualization::draw_circle(), Visualization::draw_control_net(), Visualization::draw_point(), Visualization::draw_polygon(), G(), is_valid(), operator *(), operator+(), and R().


The documentation for this class was generated from the following files:
Generated on Mon May 24 09:53:33 2010 for TUMBLE by  doxygen 1.5.2