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 (laure.nosp@m.nt.g.nosp@m.om@gm.nosp@m.ail..nosp@m.com)
More...
#include <color.h>
|
union { |
struct { |
ito::uint8 b |
|
ito::uint8 g |
|
ito::uint8 r |
|
ito::uint8 a |
|
} | |
|
ito::uint8 items [4] |
|
ito::uint32 rgba |
|
}; | |
|
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 (laure.nosp@m.nt.g.nosp@m.om@gm.nosp@m.ail..nosp@m.com)
- Author
- lyda
- Date
- 2013
- See also
- ito::rgba32
Enumerator |
---|
RGBA_B |
blue
|
RGBA_G |
green
|
RGBA_R |
red
|
RGBA_A |
alpha
|
RGBA_Y |
gray
|
< 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 | ) |
|
|
inlineexplicit |
Constructor which will set color channels to gray uint8 and alpha to 255.
- Parameters
-
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 |
( |
| ) |
const |
|
inline |
uint32& ito::Rgba32::argb |
( |
| ) |
|
|
inline |
uint32 ito::Rgba32::argb |
( |
| ) |
const |
|
inline |
uint8& ito::Rgba32::blue |
( |
| ) |
|
|
inline |
< Access to green-Channel
uint8 ito::Rgba32::blue |
( |
| ) |
const |
|
inline |
static Rgba32 ito::Rgba32::fromUnsignedLong |
( |
const uint32 |
val | ) |
|
|
inlinestatic |
static constructor to create Rgba32 from uint32 containing the values argb
- Parameters
-
val | is the uint32 value that is defined as (alpha << 24 + red << 16 + green << 8 + blue) |
float32 ito::Rgba32::gray |
( |
| ) |
const |
|
inline |
< Return the gray-value of the current RGB-Value
uint8& ito::Rgba32::green |
( |
| ) |
|
|
inline |
uint8 ito::Rgba32::green |
( |
| ) |
const |
|
inline |
bool ito::Rgba32::operator!= |
( |
const Rgba32 & |
rhs | ) |
const |
|
inline |
< Implementation of != operator comparing each element including alpha channel, true if one is different
Rgba32 ito::Rgba32::operator* |
( |
const Rgba32 & |
second | ) |
const |
|
inline |
< Implementation of * operator using *= operator
Rgba32 ito::Rgba32::operator* |
( |
const ito::float32 & |
second | ) |
const |
|
inline |
< Implementation of * operator using *= operator
Multiplication by another Rgba32 value.
- Parameters
-
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
Rgba32& ito::Rgba32::operator*= |
( |
const ito::float32 & |
grayFactor | ) |
|
|
inline |
Multiplication by a float32 grayFactor (alpha is unchanged).
- Parameters
-
The | channels R,G and B are multiplied by the given grayFactor and cropped to the range [0,255] |
- Exceptions
-
runtime_error | if grayFactor < 0 |
Rgba32 ito::Rgba32::operator+ |
( |
const Rgba32 & |
second | ) |
const |
|
inline |
< Implementation of + operator using += operator
< Implementation of += operator with overflow handling
Rgba32 ito::Rgba32::operator- |
( |
const Rgba32 & |
second | ) |
const |
|
inline |
< Implementation of - operator using -= operator
< Implementation of -= operator with overflow handling
Rgba32 ito::Rgba32::operator/ |
( |
const Rgba32 & |
second | ) |
const |
|
inline |
< Implementation of * operator using *= operator
< Implementation of /= operator with overflow handling and normalisation
< Implementation of = operator
Rgba32& ito::Rgba32::operator= |
( |
const uint32 & |
rhs | ) |
|
|
inline |
< Implementation of = for uint32 by direct copy
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 |
uint32* ito::Rgba32::u32ptr |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file:
- C:/itom/sources/itom/common/color.h