| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Color Class Reference

This defines a simple Color class. More...

#include <VisSvc/Color.h>

List of all members.


Public Member Functions

 Color ()
 Standard constructor.
 Color (float R, float G, float B)
 Color (float R, float G, float B, float A)
 Color (const float[4])
const float * value () const
const float red () const
const float green () const
const float blue () const
const float alpha () const
bool isValid () const
bool operator== (const Color &c) const
bool operator!= (const Color &c) const

Protected Attributes

float vec [4]

Detailed Description

This defines a simple Color class.

This mimics what was done in the SoFree package but was copied to avoid useless dependencies.

A color is defined by its three components in the Red Green Blue space. These components are floats and are supposed to be between 0 and 1

Author:
Sebastien Ponce
Date:
18/01/2002

Definition at line 19 of file Color.h.


Constructor & Destructor Documentation

Color::Color (  )  [inline]

Standard constructor.

Definition at line 41 of file Color.h.

00041                      {
00042   vec[0] = 2;
00043   vec[1] = 2;
00044   vec[2] = 2;
00045   vec[3] = 2;
00046 }

Color::Color ( float  R,
float  G,
float  B 
) [inline]

Definition at line 48 of file Color.h.

00048                                               {
00049   vec[0] = R;
00050   vec[1] = G;
00051   vec[2] = B;
00052   vec[3] = 0;
00053 }

Color::Color ( float  R,
float  G,
float  B,
float  A 
) [inline]

Definition at line 55 of file Color.h.

00055                                                        {
00056   vec[0] = R;
00057   vec[1] = G;
00058   vec[2] = B;
00059   vec[3] = A;
00060 }

Color::Color ( const   float[4]  ) 


Member Function Documentation

const float * Color::value (  )  const [inline]

Definition at line 62 of file Color.h.

00062                                        {
00063   return vec;
00064 }

const float Color::red (  )  const [inline]

Definition at line 66 of file Color.h.

00066                                      {
00067   return vec[0];
00068 }

const float Color::green (  )  const [inline]

Definition at line 70 of file Color.h.

00070                                        {
00071   return vec[1];
00072 }

const float Color::blue (  )  const [inline]

Definition at line 74 of file Color.h.

00074                                       {
00075   return vec[2];
00076 }

const float Color::alpha (  )  const [inline]

Definition at line 78 of file Color.h.

00078                                        {
00079   return vec[3];
00080 }

bool Color::isValid (  )  const [inline]

Definition at line 82 of file Color.h.

00082                                  {
00083   return vec[0] >= 0 && vec[0] <= 1 &&
00084     vec[1] >= 0 && vec[1] <= 1 &&
00085     vec[2] >= 0 && vec[2] <= 1 &&
00086     vec[3] >= 0 && vec[3] <= 1;
00087 }

bool Color::operator== ( const Color c  )  const [inline]

Definition at line 89 of file Color.h.

00089                                                   {
00090   return vec[0] == c.red() && vec[1] == c.green() &&
00091     vec[2] == c.blue() && vec[3] == c.alpha();
00092 }

bool Color::operator!= ( const Color c  )  const [inline]

Definition at line 94 of file Color.h.

00094                                                    {
00095   return !this->operator==(c);
00096 }


Member Data Documentation

float Color::vec[4] [protected]

Definition at line 38 of file Color.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:00:45 2011 for VisSvc by doxygen 1.4.7