This class implements basic functionality for color handling in itom. \detail 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. \detail 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
◆ RGBSelectionFlags
Enumerator |
---|
RGBA_B | blue
|
RGBA_G | green
|
RGBA_R | red
|
RGBA_A | alpha
|
RGBA_Y | gray
|
◆ Rgba32() [1/4]
< Constructor for basic values
◆ Rgba32() [2/4]
ito::Rgba32::Rgba32 |
( |
const uint8 & | a, |
|
|
const uint8 & | r, |
|
|
const uint8 & | g, |
|
|
const uint8 & | b ) |
|
inline |
< Constructor for ARGB by 4 channels
◆ Rgba32() [3/4]
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'. |
◆ Rgba32() [4/4]
ito::Rgba32::Rgba32 |
( |
const Rgba32 & | rhs | ) |
|
|
inline |
< Copy-Constructor for lvalues
◆ alpha()
uint8 ito::Rgba32::alpha |
( |
| ) |
const |
|
inline |
◆ argb() [1/2]
uint32 & ito::Rgba32::argb |
( |
| ) |
|
|
inline |
◆ argb() [2/2]
uint32 ito::Rgba32::argb |
( |
| ) |
const |
|
inline |
◆ blue() [1/2]
uint8 & ito::Rgba32::blue |
( |
| ) |
|
|
inline |
< Access to green-Channel
◆ blue() [2/2]
uint8 ito::Rgba32::blue |
( |
| ) |
const |
|
inline |
◆ fromUnsignedLong()
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) |
◆ gray()
float32 ito::Rgba32::gray |
( |
| ) |
const |
|
inline |
< Return the gray-value of the current RGB-Value
◆ green() [1/2]
uint8 & ito::Rgba32::green |
( |
| ) |
|
|
inline |
◆ green() [2/2]
uint8 ito::Rgba32::green |
( |
| ) |
const |
|
inline |
◆ operator!=()
bool ito::Rgba32::operator!= |
( |
const Rgba32 & | rhs | ) |
const |
|
inline |
< Implementation of != operator comparing each element including alpha channel, true if one is different
◆ operator*() [1/2]
Rgba32 ito::Rgba32::operator* |
( |
const ito::float32 & | second | ) |
const |
|
inline |
< Implementation of * operator using *= operator
◆ operator*() [2/2]
Rgba32 ito::Rgba32::operator* |
( |
const Rgba32 & | second | ) |
const |
|
inline |
< Implementation of * operator using *= operator
◆ operator*=() [1/2]
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 |
◆ operator*=() [2/2]
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
◆ operator+()
Rgba32 ito::Rgba32::operator+ |
( |
const Rgba32 & | second | ) |
const |
|
inline |
< Implementation of + operator using += operator
◆ operator+=()
< Implementation of += operator with overflow handling
◆ operator-()
Rgba32 ito::Rgba32::operator- |
( |
const Rgba32 & | second | ) |
const |
|
inline |
< Implementation of - operator using -= operator
◆ operator-=()
< Implementation of -= operator with overflow handling
◆ operator/()
Rgba32 ito::Rgba32::operator/ |
( |
const Rgba32 & | second | ) |
const |
|
inline |
< Implementation of * operator using *= operator
◆ operator/=()
< Implementation of /= operator with overflow handling and normalisation
◆ operator=() [1/2]
< Implementation of = operator
◆ operator=() [2/2]
Rgba32 & ito::Rgba32::operator= |
( |
const uint32 & | rhs | ) |
|
|
inline |
< Implementation of = for uint32 by direct copy
◆ operator==()
bool ito::Rgba32::operator== |
( |
const Rgba32 & | rhs | ) |
const |
|
inline |
< Implementation of == operator comparing each element including alpha channel, true if all are equal
◆ red() [1/2]
uint8 & ito::Rgba32::red |
( |
| ) |
|
|
inline |
< Access to alpha-Channel
◆ red() [2/2]
uint8 ito::Rgba32::red |
( |
| ) |
const |
|
inline |
◆ u32ptr()
uint32 * ito::Rgba32::u32ptr |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file:
- C:/Workspace/itom_development_VS2019_Qt5.15.2_x64/itomProject/itom/common/color.h