itom
Loading...
Searching...
No Matches
ito::Rgba32 Class Reference

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>

Inheritance diagram for ito::Rgba32:
ito::RgbaBase32 ito::RGBChannel< _COLOR >

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)
 
Rgba32operator+= (const Rgba32 &rhs)
 
Rgba32operator= (const Rgba32 &rhs)
 
Rgba32operator= (const uint32 &rhs)
 
Rgba32operator-= (const Rgba32 &rhs)
 
Rgba32operator*= (const Rgba32 &rhs)
 Multiplication by another Rgba32 value.
 
Rgba32operator*= (const ito::float32 &grayFactor)
 Multiplication by a float32 grayFactor (alpha is unchanged).
 
Rgba32operator/= (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
 

Additional Inherited Members

- Public Attributes inherited from ito::RgbaBase32
union { 
 
   struct { 
 
      ito::uint8   b 
 
      ito::uint8   g 
 
      ito::uint8   r 
 
      ito::uint8   a 
 
   }  
 
   ito::uint8   items [4] 
 
   ito::uint32   rgba 
 
};  
 

Detailed Description

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

Member Enumeration Documentation

◆ RGBSelectionFlags

Enumerator
RGBA_B 

blue

RGBA_G 

green

RGBA_R 

red

RGBA_A 

alpha

RGBA_Y 

gray

Constructor & Destructor Documentation

◆ Rgba32() [1/4]

ito::Rgba32::Rgba32 ( )
inline

< 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
grayis 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

Member Function Documentation

◆ alpha()

uint8 ito::Rgba32::alpha ( ) const
inline

< Access to blue-Channel

◆ argb() [1/2]

uint32 & ito::Rgba32::argb ( )
inline

< Read out blue-Channel

◆ argb() [2/2]

uint32 ito::Rgba32::argb ( ) const
inline

< Access to argb-Channel

◆ blue() [1/2]

uint8 & ito::Rgba32::blue ( )
inline

< Access to green-Channel

◆ blue() [2/2]

uint8 ito::Rgba32::blue ( ) const
inline

< Read out green-Channel

◆ fromUnsignedLong()

static Rgba32 ito::Rgba32::fromUnsignedLong ( const uint32 val)
inlinestatic

static constructor to create Rgba32 from uint32 containing the values argb

Parameters
valis 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

< Access to red-Channel

◆ green() [2/2]

uint8 ito::Rgba32::green ( ) const
inline

< Read out red-Channel

◆ 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
Thechannels R,G and B are multiplied by the given grayFactor and cropped to the range [0,255]
Exceptions
runtime_errorif grayFactor < 0

◆ operator*=() [2/2]

Rgba32 & ito::Rgba32::operator*= ( const Rgba32 & rhs)
inline

Multiplication by another Rgba32 value.

Parameters
Allchannels 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+=()

Rgba32 & ito::Rgba32::operator+= ( const Rgba32 & rhs)
inline

< Implementation of += operator with overflow handling

◆ operator-()

Rgba32 ito::Rgba32::operator- ( const Rgba32 & second) const
inline

< Implementation of - operator using -= operator

◆ operator-=()

Rgba32 & ito::Rgba32::operator-= ( const Rgba32 & rhs)
inline

< Implementation of -= operator with overflow handling

◆ operator/()

Rgba32 ito::Rgba32::operator/ ( const Rgba32 & second) const
inline

< Implementation of * operator using *= operator

◆ operator/=()

Rgba32 & ito::Rgba32::operator/= ( const Rgba32 & rhs)
inline

< Implementation of /= operator with overflow handling and normalisation

◆ operator=() [1/2]

Rgba32 & ito::Rgba32::operator= ( const Rgba32 & rhs)
inline

< 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

< Read out alpha-Channel

◆ u32ptr()

uint32 * ito::Rgba32::u32ptr ( )
inline

< Read out argb-Channel


The documentation for this class was generated from the following file: