C++ main module for gpm Package
1.0
|
this class describes color More...
#include <CORE_Color.h>
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... | |
this class describes color
Attributes:
FACTOR is a factor of the color
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 | ) |
CORE_Color::CORE_Color | ( | ) |
create a color
|
virtual |
destroy an object node.
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.
Color
object that is a brighter version of this Color
. References getBlue(), getGreen(), and getRed().
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.
Color
object that is a darker version of this Color
. References getBlue(), getGreen(), and getRed().
int CORE_Color::getAlpha | ( | ) | const |
int CORE_Color::getBlue | ( | ) | const |
Returns the blue component in the range 0-255 in the default sRGB space.
References getRGB().
Referenced by brighter(), darker(), getRGBToArray(), New(), toColor(), and toString().
return the class name of the object using only the identity string
Referenced by CORE_Object::printObjectsInMemory().
|
inherited |
return the class name of the object
References tString.
Referenced by CORE_Object::getIdentityString().
get default color string
References tString.
|
inlinestatic |
get default color string
|
inlinestatic |
get default color string
|
inlinestatic |
get default color string
int CORE_Color::getGreen | ( | ) | const |
Returns the green component in the range 0-255 in the default sRGB space.
References getRGB().
Referenced by brighter(), darker(), getRGBToArray(), New(), toColor(), and toString().
|
inlineinherited |
return the identity string of the object of the form className_at_address
References CORE_Object::getClassName(), CORE_Object::pointer2String(), and tString.
Referenced by CORE_Object::toString().
|
inline |
|
inlinestaticinherited |
get output
|
inlineinherited |
return the identity string of the object
References CORE_Object::pointer2String().
int CORE_Color::getRed | ( | ) | const |
Returns the red component in the range 0-255 in the default sRGB space.
References getRGB().
Referenced by brighter(), darker(), getRGBToArray(), New(), toColor(), and toString().
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).
ColorModel
. Referenced by getAlpha(), getBlue(), getGreen(), and getRed().
|
inline |
get the rgdb color
|
inline |
get the rgdb color
|
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().
|
inlineinherited |
get the shared pointer of this class into p
Referenced by MATH_ParentExpression::addArgument(), GPMG_EnvironmentPanel::componentClicked(), GPM_GraphElement::copy(), CORE_Map< Key, Value >::getSharedPointer(), CORE_Array< T >::getSharedPointer(), CORE_Vector< T >::getSharedPointer(), CORE_Matrix< T >::getSharedPointer(), CORE_Object::printObjectsInMemory(), MATH_ParentExpression::setArgument(), GPMG_EnvironmentPanel::setEnvironment(), GPM_GraphElement::setGraph(), GPMG_GraphElementWindow::setGraphElement(), GPMG_ShowGraphDrawPanel::showGraph(), and GPMG_RuleGraphDrawPanel::showRule().
|
inlineinherited |
get the shared pointer of this class into p
|
inlinestaticinherited |
get type name
References tString.
|
inlinestaticinherited |
return true if the machine is a 32 bits machine
References CORE_Object::is64Architecture().
|
staticinherited |
return true if the machine is a 64 bits machine
Referenced by CORE_Object::is32Architecture().
|
inline |
test if two color are identical
|
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().
|
inline |
return the string representation of the color
|
inlinestatic |
create a color with rgb value
|
inlinestatic |
create a color with rgb value in the a base
|
inlinestatic |
create a color with rgb value
|
inlinestatic |
create a color
Referenced by GPMG_Application::GPMG_Application(), GPMG_DrawPanel::GPMG_DrawPanel(), GPMG_RuleGraphDrawPanel::initAttributes(), and GPMG_DrawPanel::initAttributes().
|
inlinestatic |
create a color
|
inlinestatic |
copy a color
References getBlue(), getGreen(), and getRed().
|
inlinestatic |
create a new default color
|
inlinestatic |
create a new default color
|
inlinestatic |
create a new default color
|
staticinherited |
print on output
References null, and CORE_Object::print().
Referenced by CORE_Exception::CORE_Exception().
|
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().
|
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().
|
inlinevirtualinherited |
print the class
References CORE_Object::print(), and CORE_Object::toString().
|
virtualinherited |
print the class
Reimplemented in CORE_Out.
References null, and CORE_Object::print().
|
virtualinherited |
References null.
|
virtualinherited |
References null.
|
inlinestaticinherited |
print the class
|
staticinherited |
print object in memory
References CORE_Object::getClassName(), CORE_Object::getSharedPointer(), and CORE_Object::mIsMemoryTesting.
Referenced by main().
|
inline |
set color to black #000000
|
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().
|
inline |
set the color to color
References null.
|
inline |
|
inline |
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.
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)
|
inline |
interpolate the color : c=c0+(f-1)*(c1-co)
|
inline |
set color to Cyan
|
inline |
set color to green #00ff00
|
inline |
|
inline |
set color to orange #ff6c00
|
inlinestaticinherited |
set output
|
inline |
set color to Pink
|
inline |
set color to Purple
|
inline |
set color to red #ff0000
|
inline |
set rgb
|
inlineprotectedinherited |
set this weak shared pointer called toDoAfterThis setting method
References CORE_Object::toDoAfterThisSetting().
|
inlineprotectedvirtualinherited |
set the type of the object
Referenced by CORE_CommandLine::CORE_CommandLine(), CORE_IO::CORE_IO(), GPM_2DSnowGraph::GPM_2DSnowGraph(), GPM_BGLTest::GPM_BGLTest(), GPM_ClassFactory::GPM_ClassFactory(), GPM_ConwayFunction::GPM_ConwayFunction(), GPM_ConwayGraph::GPM_ConwayGraph(), GPM_CoreRun::GPM_CoreRun(), GPM_CoreTest::GPM_CoreTest(), GPM_Edge::GPM_Edge(), GPM_ExamplesRun::GPM_ExamplesRun(), GPM_Function::GPM_Function(), GPM_Graph::GPM_Graph(), GPM_GraphElement::GPM_GraphElement(), GPM_ModelGraph::GPM_ModelGraph(), GPM_Node::GPM_Node(), GPM_Object::GPM_Object(), GPM_PatternFunction::GPM_PatternFunction(), GPM_Port::GPM_Port(), GPM_PortGraph::GPM_PortGraph(), GPM_Snow2DFunction::GPM_Snow2DFunction(), GPM_Snow3DFunction::GPM_Snow3DFunction(), GPM_Vertex::GPM_Vertex(), and MATH_ExpressionRun::MATH_ExpressionRun().
|
inline |
set color to white #ffffff
|
inline |
set color to yellow
|
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().
|
inlineprotectedvirtualinherited |
method called after setThis() method this method can oly be called once.
Reimplemented in GPM_2DSnowGraph, GPMG_EnvironmentWindow, GPM_GraphElement, GPM_ModelFunction, GPM_ModelGraph, GPMG_RuleGraphWindow, GPMG_MovieGraphWindow, GPMG_ShowGraphWindow, and GPM_Function.
Referenced by CORE_Object::setThis(), GPM_ModelGraph::toDoAfterThisSetting(), GPM_GraphElement::toDoAfterThisSetting(), and GPM_2DSnowGraph::toDoAfterThisSetting().
|
inlinevirtual |
return the string representation of the color
Reimplemented from CORE_Object.
Referenced by setColor().
string CORE_Color::toString | ( | const tString & | format | ) | const |
return the string representation of the color
References getBlue(), getGreen(), getOpacity(), getRed(), CORE_Integer::toHexString(), and CORE_Integer::toString().
|
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().