In file graphics3D/Color.h:

namespace yav class Color

Class for Managing color strings and names

Inheritance:


Public Classes

enum StringMode
string representation mode
NONE
uninitialized
THREE_DIGITS
#RGB mode
SIX_DIGITS
#RRGGBB mode
NINE_DIGITS
#RRRGGGBBB mode
TWELVE_DIGITS
#RRRRGGGGBBBB mode

Public Fields

static const char* synopsis
-color option synopsis

Public Methods

void setColor (GLfloat r, GLfloat g, GLfloat b, GLfloat a = 1.0f)
set color, each component should be between 0 and 1
Color& operator= (const Color& c)
assignement operator
const GLfloat* getColor (void) const
returns color values as a 4 components array
GLfloat getRed (void) const
returns color red component
GLfloat getGreen (void) const
returns color green component
GLfloat getBlue (void) const
returns color blue component
GLfloat getAlpha (void) const
returns color alpha component
void glSet (void) const
set color in GL window
bool scan (const char *src)
set color value from a #RGB, #RRGGBB, #RRRGGGBBB or #RRRRGGGGBBBB string
int colorCmd (TclModule *m, Data3D *data, int argc, char **argv, int i = 0)
-color TCL command

Public

exception
class InvalidString : public Exception
invalid color string transmitted
constructors
Color ()
default (white) color
Color (GLfloat r, GLfloat g, GLfloat b, GLfloat a = 1.0f)
creates a new color, each component should be between 0 and 1
Color (const char *src) throw(InvalidString)
creates a color from a string
Color (const Material& mat)
creates a new color from material color
Color (const Color& c)
copy constructor
destructor

Protected Fields

GLfloat color [4]
RGBA color components
char* str
color string
StringMode mode
str mode

Documentation

Class for Managing color strings and names
enum StringMode
string representation mode

NONE
uninitialized

THREE_DIGITS
#RGB mode

SIX_DIGITS
#RRGGBB mode

NINE_DIGITS
#RRRGGGBBB mode

TWELVE_DIGITS
#RRRRGGGGBBBB mode

exception

class InvalidString: public Exception
invalid color string transmitted

GLfloat color[4]
RGBA color components

char* str
color string

StringMode mode
str mode

constructors

Color()
default (white) color

Color(GLfloat r, GLfloat g, GLfloat b, GLfloat a = 1.0f)
creates a new color, each component should be between 0 and 1
Parameters:
r - red color component
g - green color component
b - blue color component
a - alpha component

Color(const char *src) throw(InvalidString)
creates a color from a string
Throws:
InvalidString src does not represent a color
Parameters:
src - color string, should be #RGB, #RRGGBB, #RRRGGGBBB or #RRRRGGGGBBBB

Color(const Material& mat)
creates a new color from material color
Parameters:
mat - reference material

Color(const Color& c)
copy constructor

destructor

void setColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a = 1.0f)
set color, each component should be between 0 and 1
Parameters:
r - red color component
g - green color component
b - blue color component
a - alpha component

Color& operator=(const Color& c)
assignement operator

const GLfloat* getColor(void) const
returns color values as a 4 components array

GLfloat getRed(void) const
returns color red component

GLfloat getGreen(void) const
returns color green component

GLfloat getBlue(void) const
returns color blue component

GLfloat getAlpha(void) const
returns color alpha component

void glSet(void) const
set color in GL window

bool scan(const char *src)
set color value from a #RGB, #RRGGBB, #RRRGGGBBB or #RRRRGGGGBBBB string
Returns:
true if src is valid, false otherwise
Parameters:
src - string to parse

int colorCmd(TclModule *m, Data3D *data, int argc, char **argv, int i = 0)
-color TCL command

static const char* synopsis
-color option synopsis


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de