C++ main module for gpm Package  1.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
CORE_Color Class Reference

this class describes color More...

#include <CORE_Color.h>

Inheritance diagram for CORE_Color:
Inheritance graph
[legend]
Collaboration diagram for CORE_Color:
Collaboration graph
[legend]

Public Member Functions

 CORE_Color (int r, int g, int b)
 create a color with rgb value More...
 
 CORE_Color (int r, int g, int b, int a)
 create a color with rgb value in the a base More...
 
 CORE_Color (int rgb)
 create a color with rgb value More...
 
 CORE_Color (const tString &str)
 create a color from string More...
 
 CORE_Color ()
 create a color More...
 
virtual ~CORE_Color (void)
 destroy an object node. More...
 
void setBlack ()
 set color to black #000000 More...
 
void setWhite ()
 set color to white #ffffff More...
 
void setRed ()
 set color to red #ff0000 More...
 
void setGreen ()
 set color to green #00ff00 More...
 
void setBlue ()
 set color to blue #0000ff More...
 
void setOrange ()
 set color to orange #ff6c00 More...
 
void setYellow ()
 set color to yellow More...
 
void setCyan ()
 set color to Cyan More...
 
void setPurple ()
 set color to Purple More...
 
void setPink ()
 set color to Pink More...
 
tBoolean isEquals (const SPC::CORE_Color &x)
 test if two color are identical More...
 
void setOpacity (const int &opacity)
 set the opacity in [0,100] More...
 
int getOpacity () const
 get opacity More...
 
unsigned char * getRGBToArray () const
 return the rgb value to array of unsigned char More...
 
int getRed () const
 Returns the red component in the range 0-255 in the default sRGB space. More...
 
int getGreen () const
 Returns the green component in the range 0-255 in the default sRGB space. More...
 
int getBlue () const
 Returns the blue component in the range 0-255 in the default sRGB space. More...
 
int getAlpha () const
 Returns the alpha component in the range 0-255. More...
 
int getRGB () const
 Returns the RGB value representing the color in the default sRGB (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are blue). More...
 
void getRGBColor (double &r, double &g, double &b) const
 get the rgdb color More...
 
void getRGBColor (int &r, int &g, int &b) const
 get the rgdb color More...
 
void getRGBColor (int &r, int &g, int &b, int &opacity) const
 get the rgdb color More...
 
void darker (const SP::CORE_Color &color) const
 Creates a new Color that is a darker version of this Color More...
 
void brighter (const SP::CORE_Color &color) const
 Creates a new Color that is a brighter version of this Color More...
 
virtual string toString () const
 return the string representation of the color More...
 
string name () const
 return the string representation of the color More...
 
string toString (const tString &format) const
 return the string representation of the color More...
 
void setColor (const SPC::CORE_Color &c)
 set the color to color More...
 
void setColor (const SPC::CORE_Color *c)
 set the color to color More...
 
void setColor (const CORE_Color &c)
 set the color to color More...
 
void setColor (const CORE_Color *c)
 set the color to color More...
 
void setColor (const tString &c)
 set the color to color string More...
 
void setColor (const SPC::CORE_Color &c0, const SPC::CORE_Color &c1, float f)
 interpolate the color : c=c0+(f-1)*(c1-co) More...
 
void setColor (int r, int g, int b)
 interpolate the color : c=c0+(f-1)*(c1-co) More...
 
void setColor (double r, double g, double b)
 interpolate the color : c=c0+(f-1)*(c1-co) More...
 
void setRGB (const int &rgb)
 set rgb More...
 
void toColor (const tReal &tau, const SPC::CORE_Color &fromColor, const SP::CORE_Color &color) const
 set the color as an intermediare between from color and this color More...
 
void toColor (const tReal &tau, const CORE_Color &fromColor, CORE_Color &color) const
 set the color as an intermediare between from color and this color More...
 
void getSharedPointer (SP::CORE_Object &p)
 get the shared pointer of this class into p More...
 
void getSharedPointer (SPC::CORE_Object &p) const
 get the shared pointer of this class into p More...
 
tString getClassName () const
 return the class name of the object More...
 
tString getIdentityString () const
 return the identity string of the object of the form className_at_address More...
 
tString getPointerAddress () const
 return the identity string of the object More...
 
template<class T >
tBoolean isInstanceOf () const
 return true if the object is an instance of T More...
 
virtual void print ()
 print the class More...
 
virtual ostream & print (ostream &out) const
 print the class More...
 
virtual void print (const tString &message)
 print the class More...
 
virtual void print (const tInteger &str)
 print More...
 
virtual void print (const tRelativeInteger &str)
 print More...
 
virtual void print (const tReal &str)
 print More...
 
virtual void print (const int &str)
 print More...
 

Static Public Member Functions

static SP::CORE_Color New (int r, int g, int b)
 create a color with rgb value More...
 
static SP::CORE_Color New (int r, int g, int b, int a)
 create a color with rgb value in the a base More...
 
static SP::CORE_Color New (int rgb)
 create a color with rgb value More...
 
static SP::CORE_Color New ()
 create a color More...
 
static SP::CORE_Color New (const tString &value)
 create a color More...
 
static SP::CORE_Color New (const CORE_Color &c)
 copy a color More...
 
static SP::CORE_Color NewDefaultColor (const tBoolean &variing)
 create a new default color More...
 
static SP::CORE_Color NewDefaultColor ()
 create a new default color More...
 
static SP::CORE_Color NewDefaultColor (const int &index, const tBoolean &variing)
 create a new default color More...
 
static tString getDefaultColorString (const tBoolean &variing)
 
static tString getDefaultColorString (const int &index)
 
static tString getDefaultColorString (const int &index, const tBoolean &variing)
 
static tString getDefaultColorString ()
 
static tString getClassName (const tString &identityString)
 return the class name of the object using only the identity string More...
 
template<class T >
static tString getTypeName ()
 get type name More...
 
static tBoolean is64Architecture ()
 return true if the machine is a 64 bits machine More...
 
static tBoolean is32Architecture ()
 return true if the machine is a 32 bits machine More...
 
static tString pointer2String (const void *obj)
 return the string represantation of a pointer More...
 
static void setOutput (ostream &out)
 set output More...
 
static ostream & getOutput ()
 get output More...
 
static void printObjectsInMemory ()
 print object in memory More...
 
static ostream & print (ostream &out, const tString &message)
 print the class More...
 
static void outputPrint (const tString &message)
 

Static Public Attributes

static tBoolean mIsMemoryTesting =false
 indicator to store all classes created and deleted only for debuging version More...
 

Protected Member Functions

void setThis (SP::CORE_Object p)
 set this weak shared pointer called toDoAfterThis setting method More...
 
virtual void setType (tString type)
 set the type of the object More...
 
virtual void toDoAfterThisSetting ()
 method called after setThis() method this method can oly be called once. More...
 

Detailed Description

this class describes color

Attributes:

Constructor & Destructor Documentation

CORE_Color::CORE_Color ( int  r,
int  g,
int  b 
)

create a color with rgb value

CORE_Color::CORE_Color ( int  r,
int  g,
int  b,
int  a 
)

create a color with rgb value in the a base

CORE_Color::CORE_Color ( int  rgb)

create a color with rgb value

CORE_Color::CORE_Color ( const tString str)

create a color from string

References setColor().

Here is the call graph for this function:

CORE_Color::CORE_Color ( )

create a color

CORE_Color::~CORE_Color ( void  )
virtual

destroy an object node.

Member Function Documentation

void CORE_Color::brighter ( const SP::CORE_Color &  color) const

Creates a new Color that is a brighter version of this Color

This method applies an arbitrary scale factor to each of the three RGB components of this Color to create a brighter version of this Color. Although brighter and darker are inverse operations, the results of a series of invocations of these two methods might be inconsistent because of rounding errors.

Returns
a new Color object that is a brighter version of this Color.
See also
darker

References getBlue(), getGreen(), and getRed().

Here is the call graph for this function:

void CORE_Color::darker ( const SP::CORE_Color &  color) const

Creates a new Color that is a darker version of this Color

This method applies an arbitrary scale factor to each of the three RGB components of this Color to create a darker version of this Color. Although brighter and darker are inverse operations, the results of a series of invocations of these two methods might be inconsistent because of rounding errors.

Returns
a new Color object that is a darker version of this Color.
See also
brighter

References getBlue(), getGreen(), and getRed().

Here is the call graph for this function:

int CORE_Color::getAlpha ( ) const

Returns the alpha component in the range 0-255.

Returns
the alpha component.
See also
getRGB

References getRGB().

Here is the call graph for this function:

int CORE_Color::getBlue ( ) const

Returns the blue component in the range 0-255 in the default sRGB space.

Returns
the blue component.
See also
getRGB

References getRGB().

Referenced by brighter(), darker(), getRGBToArray(), New(), toColor(), and toString().

Here is the call graph for this function:

Here is the caller graph for this function:

static tString CORE_Object::getClassName ( const tString identityString)
inlinestaticinherited

return the class name of the object using only the identity string

Referenced by CORE_Object::printObjectsInMemory().

Here is the caller graph for this function:

tString CORE_Object::getClassName ( ) const
inherited

return the class name of the object

Returns
the class name of the object

References tString.

Referenced by CORE_Object::getIdentityString().

Here is the caller graph for this function:

static tString CORE_Color::getDefaultColorString ( const tBoolean variing)
inlinestatic

get default color string

References tString.

static tString CORE_Color::getDefaultColorString ( const int &  index)
inlinestatic

get default color string

static tString CORE_Color::getDefaultColorString ( const int &  index,
const tBoolean variing 
)
inlinestatic

get default color string

static tString CORE_Color::getDefaultColorString ( )
inlinestatic

get default color string

int CORE_Color::getGreen ( ) const

Returns the green component in the range 0-255 in the default sRGB space.

Returns
the green component.
See also
getRGB

References getRGB().

Referenced by brighter(), darker(), getRGBToArray(), New(), toColor(), and toString().

Here is the call graph for this function:

Here is the caller graph for this function:

tString CORE_Object::getIdentityString ( ) const
inlineinherited

return the identity string of the object of the form className_at_address

Returns
the identity string of the object

References CORE_Object::getClassName(), CORE_Object::pointer2String(), and tString.

Referenced by CORE_Object::toString().

Here is the call graph for this function:

Here is the caller graph for this function:

int CORE_Color::getOpacity ( ) const
inline

get opacity

Referenced by toString().

Here is the caller graph for this function:

static ostream& CORE_Object::getOutput ( )
inlinestaticinherited

get output

tString CORE_Object::getPointerAddress ( ) const
inlineinherited

return the identity string of the object

Returns
the identity string of the object

References CORE_Object::pointer2String().

Here is the call graph for this function:

int CORE_Color::getRed ( ) const

Returns the red component in the range 0-255 in the default sRGB space.

Returns
the red component.
See also
getRGB

References getRGB().

Referenced by brighter(), darker(), getRGBToArray(), New(), toColor(), and toString().

Here is the call graph for this function:

Here is the caller graph for this function:

int CORE_Color::getRGB ( ) const

Returns the RGB value representing the color in the default sRGB (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are blue).

Returns
the RGB value of the color in the default sRGB ColorModel.
See also
getRed
getGreen
getBlue

Referenced by getAlpha(), getBlue(), getGreen(), and getRed().

Here is the caller graph for this function:

void CORE_Color::getRGBColor ( double &  r,
double &  g,
double &  b 
) const
inline

get the rgdb color

void CORE_Color::getRGBColor ( int &  r,
int &  g,
int &  b 
) const
inline

get the rgdb color

void CORE_Color::getRGBColor ( int &  r,
int &  g,
int &  b,
int &  opacity 
) const
inline

get the rgdb color

unsigned char * CORE_Color::getRGBToArray ( ) const

return the rgb value to array of unsigned char

References getBlue(), getGreen(), and getRed().

Here is the call graph for this function:

void CORE_Object::getSharedPointer ( SP::CORE_Object &  p)
inlineinherited
void CORE_Object::getSharedPointer ( SPC::CORE_Object &  p) const
inlineinherited

get the shared pointer of this class into p

template<class T >
static tString CORE_Object::getTypeName ( )
inlinestaticinherited

get type name

References tString.

static tBoolean CORE_Object::is32Architecture ( )
inlinestaticinherited

return true if the machine is a 32 bits machine

References CORE_Object::is64Architecture().

Here is the call graph for this function:

tBoolean CORE_Object::is64Architecture ( )
staticinherited

return true if the machine is a 64 bits machine

Referenced by CORE_Object::is32Architecture().

Here is the caller graph for this function:

tBoolean CORE_Color::isEquals ( const SPC::CORE_Color &  x)
inline

test if two color are identical

template<class T >
tBoolean CORE_Object::isInstanceOf ( ) const
inlineinherited

return true if the object is an instance of T

References null.

Referenced by MATH_BinaryOperator::insertInTree(), MATH_UnaryOperator::insertInTree(), and MATH_EndBlock::insertInTree().

Here is the caller graph for this function:

string CORE_Color::name ( ) const
inline

return the string representation of the color

Returns
the string representation of the color
static SP::CORE_Color CORE_Color::New ( int  r,
int  g,
int  b 
)
inlinestatic

create a color with rgb value

static SP::CORE_Color CORE_Color::New ( int  r,
int  g,
int  b,
int  a 
)
inlinestatic

create a color with rgb value in the a base

static SP::CORE_Color CORE_Color::New ( int  rgb)
inlinestatic

create a color with rgb value

static SP::CORE_Color CORE_Color::New ( )
inlinestatic
static SP::CORE_Color CORE_Color::New ( const tString value)
inlinestatic

create a color

static SP::CORE_Color CORE_Color::New ( const CORE_Color c)
inlinestatic

copy a color

References getBlue(), getGreen(), and getRed().

Here is the call graph for this function:

static SP::CORE_Color CORE_Color::NewDefaultColor ( const tBoolean variing)
inlinestatic

create a new default color

static SP::CORE_Color CORE_Color::NewDefaultColor ( )
inlinestatic

create a new default color

static SP::CORE_Color CORE_Color::NewDefaultColor ( const int &  index,
const tBoolean variing 
)
inlinestatic

create a new default color

void CORE_Object::outputPrint ( const tString message)
staticinherited

print on output

References null, and CORE_Object::print().

Referenced by CORE_Exception::CORE_Exception().

Here is the call graph for this function:

Here is the caller graph for this function:

tString CORE_Object::pointer2String ( const void *  obj)
staticinherited

return the string represantation of a pointer

References tString.

Referenced by CORE_Object::CORE_Object(), CORE_Object::getIdentityString(), CORE_Object::getPointerAddress(), and CORE_Object::~CORE_Object().

Here is the caller graph for this function:

virtual void CORE_Object::print ( )
inlinevirtualinherited

print the class

References CORE_Object::toString().

Referenced by CORE_Object::outputPrint(), CORE_Out::print(), CORE_Object::print(), CORE_Out::printInt(), CORE_Out::println(), CORE_Out::printReal(), CORE_Out::printString(), and CORE_Out::setAction().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual ostream& CORE_Object::print ( ostream &  out) const
inlinevirtualinherited

print the class

References CORE_Object::print(), and CORE_Object::toString().

Here is the call graph for this function:

void CORE_Object::print ( const tString message)
virtualinherited

print the class

Reimplemented in CORE_Out.

References null, and CORE_Object::print().

Here is the call graph for this function:

void CORE_Object::print ( const tInteger str)
virtualinherited

print

References null.

void CORE_Object::print ( const tRelativeInteger str)
virtualinherited

print

References null.

void CORE_Object::print ( const tReal str)
virtualinherited

print

References null.

void CORE_Object::print ( const int &  str)
virtualinherited

print

References null.

static ostream& CORE_Object::print ( ostream &  out,
const tString message 
)
inlinestaticinherited

print the class

void CORE_Object::printObjectsInMemory ( )
staticinherited

print object in memory

References CORE_Object::getClassName(), CORE_Object::getSharedPointer(), and CORE_Object::mIsMemoryTesting.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void CORE_Color::setBlack ( )
inline

set color to black #000000

void CORE_Color::setBlue ( )
inline

set color to blue #0000ff

void CORE_Color::setColor ( const SPC::CORE_Color &  c)

set the color to color

Referenced by CORE_Color(), setColor(), and toColor().

Here is the caller graph for this function:

void CORE_Color::setColor ( const SPC::CORE_Color *  c)
inline

set the color to color

References null.

void CORE_Color::setColor ( const CORE_Color c)
inline

set the color to color

References toString().

Here is the call graph for this function:

void CORE_Color::setColor ( const CORE_Color c)
inline

set the color to color

References null, and toString().

Here is the call graph for this function:

void CORE_Color::setColor ( const tString c)

set the color to color string

References CORE_String::New(), CORE_Integer::parseHex(), CORE_Integer::parseInt(), setColor(), setOpacity(), and tString.

Here is the call graph for this function:

void CORE_Color::setColor ( const SPC::CORE_Color &  c0,
const SPC::CORE_Color &  c1,
float  f 
)

interpolate the color : c=c0+(f-1)*(c1-co)

void CORE_Color::setColor ( int  r,
int  g,
int  b 
)

interpolate the color : c=c0+(f-1)*(c1-co)

void CORE_Color::setColor ( double  r,
double  g,
double  b 
)
inline

interpolate the color : c=c0+(f-1)*(c1-co)

void CORE_Color::setCyan ( )
inline

set color to Cyan

void CORE_Color::setGreen ( )
inline

set color to green #00ff00

void CORE_Color::setOpacity ( const int &  opacity)
inline

set the opacity in [0,100]

Referenced by setColor().

Here is the caller graph for this function:

void CORE_Color::setOrange ( )
inline

set color to orange #ff6c00

static void CORE_Object::setOutput ( ostream &  out)
inlinestaticinherited

set output

void CORE_Color::setPink ( )
inline

set color to Pink

void CORE_Color::setPurple ( )
inline

set color to Purple

void CORE_Color::setRed ( )
inline

set color to red #ff0000

void CORE_Color::setRGB ( const int &  rgb)
inline

set rgb

void CORE_Object::setThis ( SP::CORE_Object  p)
inlineprotectedinherited

set this weak shared pointer called toDoAfterThis setting method

References CORE_Object::toDoAfterThisSetting().

Here is the call graph for this function:

virtual void CORE_Object::setType ( tString  type)
inlineprotectedvirtualinherited
void CORE_Color::setWhite ( )
inline

set color to white #ffffff

void CORE_Color::setYellow ( )
inline

set color to yellow

void CORE_Color::toColor ( const tReal tau,
const SPC::CORE_Color &  fromColor,
const SP::CORE_Color &  color 
) const
inline

set the color as an intermediare between from color and this color

void CORE_Color::toColor ( const tReal tau,
const CORE_Color fromColor,
CORE_Color color 
) const

set the color as an intermediare between from color and this color

References getBlue(), getGreen(), getRed(), and setColor().

Here is the call graph for this function:

virtual void CORE_Object::toDoAfterThisSetting ( )
inlineprotectedvirtualinherited
virtual string CORE_Color::toString ( ) const
inlinevirtual

return the string representation of the color

Returns
the string representation of the color

Reimplemented from CORE_Object.

Referenced by setColor().

Here is the caller graph for this function:

string CORE_Color::toString ( const tString format) const

return the string representation of the color

Returns
the string representation of the color

References getBlue(), getGreen(), getOpacity(), getRed(), CORE_Integer::toHexString(), and CORE_Integer::toString().

Here is the call graph for this function:

Member Data Documentation

tBoolean CORE_Object::mIsMemoryTesting =false
staticinherited

indicator to store all classes created and deleted only for debuging version

Referenced by CORE_Object::CORE_Object(), main(), CORE_Object::printObjectsInMemory(), and CORE_Object::~CORE_Object().


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