itom 2.2.0
|
This class implements basic functionality for color handling in itom. This class implements ARGB32 into itom. In openCV-mat this will be represented by an 4channel uint8-plane. The functions of this class are inspired by http://virjo.googlecode.com/svn/trunk/SFML_Windows/src/SFML/Graphics/Color.cpp, written by Laurent Gomila (laurent.gom@gmail.com) More...
#include <color.h>
Public Types | |
enum | RGBSelectionFlags { RGBA_B = 0, RGBA_G = 1, RGBA_R = 2, RGBA_A = 3, RGBA_Y = 4, RGBA_RGB = 5 } |
Public Member Functions | |
Rgba32 () | |
Rgba32 (const uint8 &a, const uint8 &r, const uint8 &g, const uint8 &b) | |
Rgba32 (const uint8 gray) | |
Constructor which will set color channels to gray uint8 and alpha to 255. | |
Rgba32 (const Rgba32 &rhs) | |
Rgba32 & | operator+= (const Rgba32 &rhs) |
Rgba32 & | operator= (const Rgba32 &rhs) |
Rgba32 & | operator= (const uint32 &rhs) |
Rgba32 & | operator-= (const Rgba32 &rhs) |
Rgba32 & | operator*= (const Rgba32 &rhs) |
Multiplication by another Rgba32 value. | |
Rgba32 & | operator*= (const ito::float32 &grayFactor) |
Multiplication by a float32 grayFactor (alpha is unchanged). | |
Rgba32 & | operator/= (const Rgba32 &rhs) |
Rgba32 | operator+ (const Rgba32 &second) const |
Rgba32 | operator- (const Rgba32 &second) const |
Rgba32 | operator* (const Rgba32 &second) const |
Rgba32 | operator* (const ito::float32 &second) const |
Rgba32 | operator/ (const Rgba32 &second) const |
bool | operator== (const Rgba32 &rhs) const |
bool | operator!= (const Rgba32 &rhs) const |
float32 | gray () const |
uint8 & | alpha () |
uint8 & | red () |
uint8 & | green () |
uint8 & | blue () |
uint8 | alpha () const |
uint8 | red () const |
uint8 | green () const |
uint8 | blue () const |
uint32 & | argb () |
uint32 | argb () const |
uint32 * | u32ptr () |
uint8 * | u8ptr () |
Static Public Member Functions | |
static Rgba32 | zeros () |
static Rgba32 | black () |
static Rgba32 | fromUnsignedLong (const uint32 val) |
static constructor to create Rgba32 from uint32 containing the values argb |
This class implements basic functionality for color handling in itom. This class implements ARGB32 into itom. In openCV-mat this will be represented by an 4channel uint8-plane. The functions of this class are inspired by http://virjo.googlecode.com/svn/trunk/SFML_Windows/src/SFML/Graphics/Color.cpp, written by Laurent Gomila (laurent.gom@gmail.com)
ito::Rgba32::Rgba32 | ( | ) | [inline] |
< Constructor for basic values
ito::Rgba32::Rgba32 | ( | const uint8 & | a, |
const uint8 & | r, | ||
const uint8 & | g, | ||
const uint8 & | b | ||
) | [inline] |
< Constructor for ARGB by 4 channels
ito::Rgba32::Rgba32 | ( | const uint8 | gray | ) | [inline, explicit] |
Constructor which will set color channels to gray uint8 and alpha to 255.
gray | is the gray value. Alpha is 255, R=G=B are set to this value 'gray'. |
ito::Rgba32::Rgba32 | ( | const Rgba32 & | rhs | ) | [inline] |
< Copy-Constructor for lvalues
uint8& ito::Rgba32::alpha | ( | ) | [inline] |
< Return the gray-value of the current RGB-Value
uint8 ito::Rgba32::alpha | ( | ) | const [inline] |
< Access to blue-Channel
uint32& ito::Rgba32::argb | ( | ) | [inline] |
< Read out blue-Channel
uint32 ito::Rgba32::argb | ( | ) | const [inline] |
< Access to argb-Channel
uint8& ito::Rgba32::blue | ( | ) | [inline] |
< Access to green-Channel
uint8 ito::Rgba32::blue | ( | ) | const [inline] |
< Read out green-Channel
static Rgba32 ito::Rgba32::fromUnsignedLong | ( | const uint32 | val | ) | [inline, static] |
static constructor to create Rgba32 from uint32 containing the values argb
val | is the uint32 value that is defined as (alpha << 24 + red << 16 + green << 8 + blue) |
uint8& ito::Rgba32::green | ( | ) | [inline] |
< Access to red-Channel
uint8 ito::Rgba32::green | ( | ) | const [inline] |
< Read out red-Channel
bool ito::Rgba32::operator!= | ( | const Rgba32 & | rhs | ) | const [inline] |
< Implementation of != operator comparing each element including alpha channel, true if one is different
< Implementation of * operator using *= operator
Rgba32 ito::Rgba32::operator* | ( | const ito::float32 & | second | ) | const [inline] |
< Implementation of * operator using *= operator
Rgba32& ito::Rgba32::operator*= | ( | const ito::float32 & | grayFactor | ) | [inline] |
Multiplication by a float32 grayFactor (alpha is unchanged).
The | channels R,G and B are multiplied by the given grayFactor and cropped to the range [0,255] |
runtime_error | if grayFactor < 0 |
Multiplication by another Rgba32 value.
All | channels are multiplied by each other and then divided by 255 (integer division leads to a ceil operation in any case) |
< Implementation of *= operator with overflow handling and normalisation
< Implementation of + operator using += operator
< Implementation of += operator with overflow handling
< Implementation of - operator using -= operator
< Implementation of -= operator with overflow handling
< Implementation of * operator using *= operator
< Implementation of /= operator with overflow handling and normalisation
Rgba32& ito::Rgba32::operator= | ( | const uint32 & | rhs | ) | [inline] |
< Implementation of = for uint32 by direct copy
Reimplemented in ito::RGBChannel< _COLOR >.
bool ito::Rgba32::operator== | ( | const Rgba32 & | rhs | ) | const [inline] |
< Implementation of == operator comparing each element including alpha channel, true if all are equal
uint8& ito::Rgba32::red | ( | ) | [inline] |
< Access to alpha-Channel
uint8 ito::Rgba32::red | ( | ) | const [inline] |
< Read out alpha-Channel
uint32* ito::Rgba32::u32ptr | ( | ) | [inline] |
< Read out argb-Channel