ViSP  2.9.0

#include <vpRGBa.h>

+ Inheritance diagram for vpRGBa:

Public Member Functions

 vpRGBa ()
 
 vpRGBa (const unsigned char &r, const unsigned char &g, const unsigned char &b, const unsigned char &a=0)
 
 vpRGBa (const unsigned char &v)
 
 vpRGBa (const vpRGBa &v)
 
 vpRGBa (const vpColVector &v)
 
vpRGBaoperator= (const unsigned char &v)
 
vpRGBaoperator= (const vpRGBa &v)
 
vpRGBaoperator= (const vpColVector &v)
 
bool operator== (const vpRGBa &v)
 
bool operator!= (const vpRGBa &v)
 
vpColVector operator- (const vpRGBa &v) const
 
vpRGBa operator+ (const vpRGBa &v) const
 
vpColVector operator- (const vpColVector &v) const
 
vpColVector operator+ (const vpColVector &v) const
 
vpColVector operator* (const float &v) const
 
vpColVector operator* (const double &v) const
 
bool operator< (const vpRGBa &v) const
 
bool operator> (const vpRGBa &v) const
 

Public Attributes

unsigned char R
 
unsigned char G
 
unsigned char B
 
unsigned char A
 

Friends

VISP_EXPORT vpRGBa operator* (const double &x, const vpRGBa &rgb)
 

Detailed Description

Class that defines a RGB 32 bits structure.

Define the object vpRGBa that is used to build color images (it define a RGB 32 bits structure, fourth byte is not used)

See also
vpImage
Examples:
servoMomentImage.cpp, and tutorial-image-manipulation.cpp.

Definition at line 68 of file vpRGBa.h.

Constructor & Destructor Documentation

vpRGBa::vpRGBa ( )
inline

Basic constructor.

Build a black value.

Definition at line 77 of file vpRGBa.h.

vpRGBa::vpRGBa ( const unsigned char &  r,
const unsigned char &  g,
const unsigned char &  b,
const unsigned char &  a = 0 
)
inline

Constructor.

Initialize the color with R, G, B, A values.

Parameters
r: Red value.
g: Green value.
b: Blue value.
a: Additional value.

Definition at line 90 of file vpRGBa.h.

vpRGBa::vpRGBa ( const unsigned char &  v)
inline

Constructor.

Initialize all the R, G, B, A components to v.

Parameters
v: Value to set.

Definition at line 103 of file vpRGBa.h.

vpRGBa::vpRGBa ( const vpRGBa v)
inline

Copy constructor.

Definition at line 109 of file vpRGBa.h.

vpRGBa::vpRGBa ( const vpColVector v)
inline

Create a RGBa value from a 4 dimension column vector.

R=v[0] G=v[1] B=v[2] A=v[3]

Definition at line 120 of file vpRGBa.h.

Member Function Documentation

bool vpRGBa::operator!= ( const vpRGBa v)

Compare two color pixels.

Returns
true if the images are different, false if they are the same.

Definition at line 130 of file vpRGBa.cpp.

References A, B, G, and R.

vpColVector vpRGBa::operator* ( const float &  v) const

Multiplication operator : v * "this".

Parameters
v: Value to multiply.
Returns
v * "this"

Definition at line 215 of file vpRGBa.cpp.

References A, B, G, and R.

vpColVector vpRGBa::operator* ( const double &  v) const

Multiplication operator : v * "this".

Parameters
v: Value to multiply.
Returns
v * "this"

Definition at line 231 of file vpRGBa.cpp.

References A, B, G, and R.

vpRGBa vpRGBa::operator+ ( const vpRGBa v) const

Addition operator : "this" + v.

Parameters
v: Color to add to the current object "this".
Returns
"this" + v
Warning
in case of overflow : e.g. 128+128 returns 0 for all 4 channels

Definition at line 167 of file vpRGBa.cpp.

References A, B, G, and R.

vpColVector vpRGBa::operator+ ( const vpColVector v) const

Addition operator : "this" + v.

Parameters
v: Color to add to the current object "this".
Returns
"this" + v

Definition at line 199 of file vpRGBa.cpp.

References A, B, G, and R.

vpColVector vpRGBa::operator- ( const vpRGBa v) const

Substraction operator : "this" - v.

Parameters
v: Color to substract to the current object "this".
Returns
"this" - v

Definition at line 150 of file vpRGBa.cpp.

References A, B, G, and R.

vpColVector vpRGBa::operator- ( const vpColVector v) const

Substraction operator : "this" - v.

Parameters
v: Color to substract to the current object "this".
Returns
"this" - v

Definition at line 183 of file vpRGBa.cpp.

References A, B, G, and R.

bool vpRGBa::operator< ( const vpRGBa v) const

Definition at line 242 of file vpRGBa.cpp.

References B, G, and R.

vpRGBa & vpRGBa::operator= ( const unsigned char &  v)

Copy operator (from an unsigned char value)

Parameters
v: Input color ( R = G = B = v )

Definition at line 62 of file vpRGBa.cpp.

References A, B, G, and R.

vpRGBa & vpRGBa::operator= ( const vpRGBa v)

Copy operator.

Definition at line 75 of file vpRGBa.cpp.

References A, B, G, and R.

vpRGBa & vpRGBa::operator= ( const vpColVector v)

Cast a vpColVector in a vpRGBa

Parameters
v: Input vector. v[0], v[1], v[2], v[3] are to make into relation with respectively R, G, B and A.
Exceptions
vpException::dimensionError: If v is not a 4 four dimention vector.

Definition at line 94 of file vpRGBa.cpp.

References A, B, vpException::dimensionError, G, vpMatrix::getRows(), R, and vpERROR_TRACE.

bool vpRGBa::operator== ( const vpRGBa v)

Compare two RGBa values.

Returns
true if the values are the same, false otherwise.

Definition at line 112 of file vpRGBa.cpp.

References A, B, G, and R.

bool vpRGBa::operator> ( const vpRGBa v) const

Definition at line 251 of file vpRGBa.cpp.

References B, G, and R.

Friends And Related Function Documentation

VISP_EXPORT vpRGBa operator* ( const double &  x,
const vpRGBa rgb 
)
friend

Definition at line 259 of file vpRGBa.cpp.

Member Data Documentation

unsigned char vpRGBa::A

Additionnal component.

Definition at line 149 of file vpRGBa.h.

Referenced by vpImageConvert::convert(), vpDisplayX::getImage(), operator!=(), operator*(), operator+(), operator-(), operator=(), and operator==().