![]() |
VR-Forces Development_Version Class Documentation
|
DtSdcColor represents colors for Draw Control Objects. More...
Public Member Functions | |
| DtSdcColor () | |
| Defaultconstructor. | |
| DtSdcColor (unsigned r, unsigned g, unsigned b, unsigned a=255) | |
| Parameterized constructor. | |
| DtSdcColor (const DtSdcColor &orig) | |
| Copy constructor. | |
| DtSdcColor | operator= (const DtSdcColor &orig) |
| Assignment operator. | |
| const unsigned & | operator[] (int index) const |
| const RGBA Component Accessor | |
| unsigned & | operator[] (int index) |
| RGBA Component Accessor. | |
| bool | operator== (const DtSdcColor &rhs) const |
| Equality operator. | |
| bool | operator!= (const DtSdcColor &rhs) const |
| Inequality operator. | |
| void | setHSV (unsigned hue, double saturation, double value, unsigned alpha=255) |
| Set via HSV. | |
| unsigned | red () const |
| Red accessor. | |
| void | setRed (unsigned red) |
| Red mutator. | |
| unsigned | green () const |
| Green accessor. | |
| void | setGreen (unsigned green) |
| Green mutator. | |
| unsigned | blue () const |
| Blue accessor. | |
| void | setBlue (unsigned blue) |
| Blue mutator. | |
| unsigned | hue () const |
| Hue accessor. | |
| void | setHue (unsigned hue) |
| Hue mutator. | |
| double | saturation () const |
| Saturation accessor. | |
| void | setSaturation (double saturation) |
| Saturation mutator. | |
| double | value () const |
| Value accessor. | |
| void | setValue (double value) |
| Value mutator. | |
| unsigned | alpha () const |
| Alpha accessor. | |
| void | setAlpha (unsigned alpha) |
| Alpha mutator. | |
Static Public Attributes | |
| static const DtSdcColor | DtSdcWhite |
| Constant for the color White. | |
| static const DtSdcColor | DtSdcBlack |
| Constant for the color Black. | |
| static const DtSdcColor | DtSdcRed |
| Constant for the color Red. | |
| static const DtSdcColor | DtSdcGreen |
| Constant for the color Green. | |
| static const DtSdcColor | DtSdcBlue |
| Constant for the color Blue. | |
| static const DtSdcColor | DtSdcYellow |
| Constant for the color Yellow. | |
| static const DtSdcColor | DtSdcPurple |
| Constant for the color Purple. | |
| static const DtSdcColor | DtSdcOrange |
| Constant for the color Orange. | |
Protected Member Functions | |
| void | toHSV () |
| void | fromHSV () |
Protected Attributes | |
| unsigned | myRed |
| unsigned | myGreen |
| unsigned | myBlue |
| unsigned | myAlpha |
| unsigned | myHue |
| double | mySaturation |
| double | myValue |
DtSdcColor represents colors for Draw Control Objects.
DtSdcColor is a container class that hold rgba values representing a color (and transparency). It also has methods to support working with HSV color representations, although colors are always represented as rgba values on the network.
| DtSdcColor::DtSdcColor | ( | ) |
Defaultconstructor.
| DtSdcColor::DtSdcColor | ( | unsigned | r, |
| unsigned | g, | ||
| unsigned | b, | ||
| unsigned | a = 255 |
||
| ) |
Parameterized constructor.
Construct a color object with the specified red, green, blue and alpha values
| r | The red component value, from 0 to 255 |
| g | The green component value, from 0 to 255 |
| b | The blue compoment value, from 0 to 255 |
| a | The alpha (transparency) value, from 0 to 255 |
| DtSdcColor::DtSdcColor | ( | const DtSdcColor & | orig | ) |
Copy constructor.
| DtSdcColor DtSdcColor::operator= | ( | const DtSdcColor & | orig | ) |
Assignment operator.
| const unsigned& DtSdcColor::operator[] | ( | int | index | ) | const |
const RGBA Component Accessor
Get a single rgba component value
| index | 0 = red, 1 = green, 2 = blue, 3 = alpha |
| unsigned& DtSdcColor::operator[] | ( | int | index | ) |
RGBA Component Accessor.
Get a single rgba component value
| index | 0 = red, 1 = green, 2 = blue, 3 = alpha |
| bool DtSdcColor::operator== | ( | const DtSdcColor & | rhs | ) | const |
Equality operator.
| bool DtSdcColor::operator!= | ( | const DtSdcColor & | rhs | ) | const |
Inequality operator.
| void DtSdcColor::setHSV | ( | unsigned | hue, |
| double | saturation, | ||
| double | value, | ||
| unsigned | alpha = 255 |
||
| ) |
Set via HSV.
Set the rgba value using HSV(a) values
| hue | Hue component, 0 to 360 |
| saturation | Saturation component, 0. to 1. |
| value | Value component, 0. to 1. |
| alpha | Alpha (transparency) component, 0 to 255 |
| unsigned DtSdcColor::red | ( | ) | const |
Red accessor.
Get the red component value
| void DtSdcColor::setRed | ( | unsigned | red | ) |
Red mutator.
Set the red component value
| red | The red component, 0 to 255 |
| unsigned DtSdcColor::green | ( | ) | const |
Green accessor.
Get the green component value
| void DtSdcColor::setGreen | ( | unsigned | green | ) |
Green mutator.
Set the green component value
| green | The green component, 0 to 255 |
| unsigned DtSdcColor::blue | ( | ) | const |
Blue accessor.
Get the blue component value
| void DtSdcColor::setBlue | ( | unsigned | blue | ) |
Blue mutator.
Set the blue component value
| blue | The blue component, 0 to 255 |
| unsigned DtSdcColor::hue | ( | ) | const |
Hue accessor.
Get the Hue associated with this color
| void DtSdcColor::setHue | ( | unsigned | hue | ) |
Hue mutator.
Change the color by setting its Hue
| hue | The Hue value, 0 to 360 |
| double DtSdcColor::saturation | ( | ) | const |
Saturation accessor.
Get the Saturation associated with this color
| void DtSdcColor::setSaturation | ( | double | saturation | ) |
Saturation mutator.
Change the color by modifying its saturation value
| saturation | The Saturation value, 0. to 1. |
| double DtSdcColor::value | ( | ) | const |
Value accessor.
Get the (brightness) Value associated with this color
| void DtSdcColor::setValue | ( | double | value | ) |
Value mutator.
Change the color by modifying its (brightness) value
| value | The (brightness) value, 0. to 1. |
| unsigned DtSdcColor::alpha | ( | ) | const |
Alpha accessor.
Get the alpha (transparency) component value
| void DtSdcColor::setAlpha | ( | unsigned | alpha | ) |
Alpha mutator.
Set the alpha (transparency) component value
| alpha | The alpha component, 0 to 255 |
|
protected |
|
protected |
|
static |
Constant for the color White.
|
static |
Constant for the color Black.
|
static |
Constant for the color Red.
|
static |
Constant for the color Green.
|
static |
Constant for the color Blue.
|
static |
Constant for the color Yellow.
|
static |
Constant for the color Purple.
|
static |
Constant for the color Orange.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |