ADTF Display Toolbox
|
Color class. More...
Public Member Functions | |
cColor () | |
default constructor | |
cColor (const IColor *pColor) | |
constructor from IColor More... | |
cColor (const tColor &oColor) | |
Constructor. More... | |
cColor (tInt nRedLocal, tInt nGreenLocal, tInt nBlueLocal, tInt nAlphaLocal=255) | |
constructor with several init parameters. More... | |
cColor (tUInt8 nRed, tUInt8 nGreen, tUInt8 nBlue, tUInt8 nAlpha=255) | |
constructor with several init parameters. More... | |
cColor (tFloat32 fRed, tFloat32 fGreen, tFloat32 fBlue, tFloat32 fAlpha=1.0f) | |
constructor with several init parameters. More... | |
cColor (tUInt32 nRGBA) | |
Constructor with a bitfield containing the encoded rgba-values. More... | |
cColor (tUInt32 nRGBA, tInt oPixelFormat) | |
Constructor with a bitfield containing the encoded rgba-values and another parameter which describes the format. More... | |
tVoid | Release () |
Releases this color. | |
tVoid | Set (tInt nRedLocal, tInt nGreenLocal, tInt nBlueLocal, tInt nAlphaLocal=255) |
Method to set color and transparency information. More... | |
tVoid | Set (tUInt8 nRedLocal, tUInt8 nGreenLocal, tUInt8 nBlueLocal, tUInt8 nAlphaLocal=255) |
Method to set color and transparency information. More... | |
tVoid | Set (tFloat32 fRed, tFloat32 fGreen, tFloat32 fBlue, tFloat32 fAlpha=1.0f) |
Method to set color and transparency information. More... | |
tVoid | SetRGBA (tUInt32 nRGBA) |
method to set color and transparency with a combined parameter (3 color channels and the alphachannel) More... | |
tVoid | SetRGBA (tUInt32 nRGBA, tInt oPixelFormat) |
Method which decodes the rgba-values stored in nRGBA depending on the given pixelformat. More... | |
tUInt32 | GetRGBA () const |
Gets a four Byte value containing the 3 color channels and the alphachannel. More... | |
tUInt32 | GetRGBA (tInt oPixelFormat) const |
Gets a four byte balue containing the current rgba-values encoded in the given pixel format. More... | |
operator tUInt32 () | |
Casting operator which converts an RGBA structure into an tUInt32 For conversion, the format PF_RGBA_8888 is assumed. More... | |
tVoid | SetRed (tUInt8 nRedValue) |
Sets the value of the red channel. More... | |
tUInt8 | GetRed () const |
Returns the value for the red channel. More... | |
tVoid | SetGreen (tUInt8 nGreenValue) |
Sets the value of the green channel. More... | |
tUInt8 | GetGreen () const |
Returns the value for the green channel. More... | |
tVoid | SetBlue (tUInt8 nBlueValue) |
Sets the value of the blue channel. More... | |
tUInt8 | GetBlue () const |
Returns the value for the green channel. More... | |
tVoid | SetAlpha (tUInt8 nAlphaValue) |
Sets the value of the alpha channel. More... | |
tUInt8 | GetAlpha () const |
This function returns the value for the alpha channel. More... | |
tUInt8 | GetBrightness () const |
This function returns the brightness value. More... | |
operator IColor * () | |
instance of IColor More... | |
operator const IColor * () const | |
instance of IColor More... | |
![]() | |
virtual | ~IColor () |
virtual destructor to ensure proper cleanup. | |
Static Public Member Functions | |
static cColor | Scale (const cColor &c, tInt nAlpha) |
scales a color with an alpha channel More... | |
static cColor | Scale (const cColor &c, tFloat32 fAlpha) |
scales a color with an alpha channel More... | |
static cColor | Blend (const cColor &c1, const cColor &c2, tInt nAlpha) |
blends two colors with an alpha channel More... | |
static cColor | Blend (const cColor &c1, const cColor &c2, tFloat32 fAlpha) |
blends two colors with an alpha channel More... | |
static tResult | ColorFromString (const tChar *strColor, cColor &oColor) |
Converts a hexadecimal color value into a cColor object The input format is like the HTML color definition (red: #ff0000, green: #00ff00, blue: #0000ff...) The leading # must exist. More... | |
Static Public Attributes | |
static const cColor | Black |
definition of color black | |
static const cColor | White |
definition of color white | |
static const cColor | Red |
definition of color red | |
static const cColor | Green |
definition of color green | |
static const cColor | Blue |
definition of color blue | |
static const cColor | Yellow |
definition of color yellow | |
static const cColor | Cyan |
definition of color cyan | |
static const cColor | Purple |
definition of color purple | |
constructor from IColor
[in] | pColor | pColor |
Definition at line 49 of file color.h.
References IColor::GetAlpha(), IColor::GetBlue(), IColor::GetGreen(), and IColor::GetRed().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Constructor with a bitfield containing the encoded rgba-values.
The default format is PF_BGRA_8888
[in] | nRGBA | combined parameter, first byte represents red, second green, third blue and the last the alpha channel |
Definition at line 121 of file color.h.
References cColor::SetRGBA().
|
inline |
Constructor with a bitfield containing the encoded rgba-values and another parameter which describes the format.
[in] | nRGBA | color value. The color positions and sizes are defined with the second parameter oPixelFormat |
[in] | oPixelFormat | combined parameter. The color positions of nRGBA and sizes are defined with the second parameter oPixelFormat |
Definition at line 132 of file color.h.
References cColor::SetRGBA().
blends two colors with an alpha channel
[in] | c1 | first color |
[in] | c2 | second color |
[in] | fAlpha | alpha channel |
Definition at line 416 of file color.h.
References cColor::cColor().
blends two colors with an alpha channel
[in] | c1 | first color |
[in] | c2 | second color |
[in] | nAlpha | alpha channel |
Definition at line 399 of file color.h.
References cColor::cColor().
|
static |
Converts a hexadecimal color value into a cColor object The input format is like the HTML color definition (red: #ff0000, green: #00ff00, blue: #0000ff...) The leading # must exist.
If a fourth byte is provided than this will be treaded as alpha value.
strColor | [in] The string which contains the color definition (#rrggbbaa, whereby aa is optional) |
oColor | [out] The passed color receives the result |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Gets a four Byte value containing the 3 color channels and the alphachannel.
Implements IColor.
Definition at line 230 of file color.h.
References IImage::PF_BGRA_8888.
Referenced by cColor::operator tUInt32().
tUInt32 GetRGBA | ( | tInt | oPixelFormat | ) | const |
Gets a four byte balue containing the current rgba-values encoded in the given pixel format.
oPixelFormat | [in] one of PF_RGB_444 | PF_RGBA_4444 | PF_RGB_555 | PF_RGB_565 | PF_RGB_888 | PF_BGR_888 | PF_RGBA_8888 | PF_BGRA_8888 | PF_ARGB_8888 | PF_ABGR_8888 All values have to be preceeded with adtf_util::IImage:: |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
Casting operator which converts an RGBA structure into an tUInt32 For conversion, the format PF_RGBA_8888 is assumed.
Better use GetRGBA(tInt oPixelFormat)
Definition at line 251 of file color.h.
References cColor::GetRGBA(), and IImage::PF_RGBA_8888.
scales a color with an alpha channel
[in] | c | given color |
[in] | fAlpha | given alpha channel |
Definition at line 386 of file color.h.
References cColor::cColor().
scales a color with an alpha channel
[in] | c | given color |
[in] | nAlpha | given alpha channel |
Definition at line 372 of file color.h.
References cColor::cColor().
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
method to set color and transparency with a combined parameter (3 color channels and the alphachannel)
[in] | nRGBA | combined parameter, first byte represents red, second green, third blue and the last the alpha channel |
Implements IColor.
Definition at line 206 of file color.h.
References IImage::PF_BGRA_8888.
Referenced by cColor::cColor().
tVoid SetRGBA | ( | tUInt32 | nRGBA, |
tInt | oPixelFormat | ||
) |
Method which decodes the rgba-values stored in nRGBA depending on the given pixelformat.
nRGBA | [in] Bitfield containing the encoded rgba-data |
oPixelFormat | [in] one of PF_RGB_444 | PF_RGBA_4444 | PF_RGB_555 | PF_RGB_565 | PF_RGB_888 | PF_BGR_888 | PF_RGBA_8888 | PF_BGRA_8888 | PF_ARGB_8888 | PF_ABGR_8888 All values have to be preceeded with adtf_util::IImage |