Imagine++
Public Member Functions | List of all members
Imagine::RGBA< T > Class Template Reference

RED GREEN BLUE Alpha color. More...

#include "Imagine/Common.h"

Inheritance diagram for Imagine::RGBA< T >:
Imagine::FVector< T, 4 > Imagine::FArray< T, dim >

Public Member Functions

 RGBA ()
 Empty constructor. More...
 
 RGBA (T x)
 Constructor with constant value. More...
 
 RGBA (T r, T g, T b, T a)
 Constructor with r,g,b,a values Constructs a RGBA of type T. More...
 
 RGBA (T r, T g, T b)
 Constructor with r,g,b values Constructs a RGBA of type T. More...
 
 RGBA (const T t[4])
 Constructor from C array. More...
 
 RGBA (const Base &x)
 Copy constructor. More...
 
template<typename T2 >
 RGBA (const FArray< T2, 4 > &x)
 Constructor from other value type Constructs from RGBA with different type. More...
 
template<typename T2 >
 RGBA (const FArray< T2, 3 > &x)
 Constructor from RGB. More...
 
const T & a () const
 Read alpha alias. More...
 
T & a ()
 Write alpha alias. More...
 
const T & b () const
 Read BLUE alias. More...
 
T & b ()
 Write BLUE alias. More...
 
const T & g () const
 Read GREEN alias. More...
 
T & g ()
 Write GREEN alias. More...
 
 operator T () const
 To greyscale. More...
 
const T & r () const
 Read RED alias. More...
 
T & r ()
 Write RED alias. More...
 
- Public Member Functions inherited from Imagine::FVector< T, 4 >
 FVector ()
 Empty constructor. More...
 
 FVector (const T &v)
 Constructor with constant value. More...
 
 FVector (const T2 t[dim])
 Constructor from C array. More...
 
 FVector (const FArray< T2, dim > &a)
 Copy constructor. More...
 
 FVector (T x, T y)
 2D alias. More...
 
 FVector (T x, T y, T z)
 3D alias. More...
 
FVectorfill (const T &v)
 Filling. More...
 
FVectornormalize ()
 Euclidean in-place normalization. More...
 
operator* (const FVector &v) const
 Scalar product. More...
 
FVector operator* (T s) const
 Scalar multiplication. More...
 
FVectoroperator*= (T s)
 Scalar in place multiplication. More...
 
FVector operator+ (const FVector &v) const
 Addition. More...
 
FVector operator+ (T s) const
 Scalar Addition. More...
 
FVectoroperator+= (const FVector &v)
 In place Addition. More...
 
FVectoroperator+= (T s)
 Scalar in place Addition. More...
 
FVector operator- (const FVector &v) const
 Substraction. More...
 
FVector operator- (T s) const
 Scalar Substraction. More...
 
FVector operator- () const
 Opposite. More...
 
FVectoroperator-= (const FVector &v)
 In place Substraction. More...
 
FVectoroperator-= (T s)
 Scalar in place substractrion. More...
 
FVector operator/ (T s) const
 Scalar division. More...
 
FVectoroperator/= (T s)
 Scalar in place division. More...
 
FVectoroperator= (const FArray< T2, dim > &b)
 Assignment. More...
 
operator^ (const FVector< T, 2 > &v) const
 2D cross product. More...
 
FVector< T, 3 > operator^ (const FVector< T, 3 > &v) const
 3D cross product. More...
 
const T & x () const
 Read alias. More...
 
T & x ()
 Write alias. More...
 
const T & y () const
 Read alias. More...
 
T & y ()
 Write alias. More...
 
const T & z () const
 Read alias. More...
 
T & z ()
 Write alias. More...
 
- Public Member Functions inherited from Imagine::FArray< T, dim >
 FArray ()
 Empty constructor. More...
 
 FArray (const T &v)
 Constructor with constant value. More...
 
 FArray (const T2 t[S])
 Constructor from C array. More...
 
 FArray (const FArray< T2, S > &a)
 Copy constructor. More...
 
 FArray (T v0, T v1)
 2D alias. More...
 
 FArray (T v0, T v1, T v2)
 3D alias. More...
 
 FArray (T v0, T v1, T v2, T v3)
 4D alias. More...
 
iterator begin ()
 Begin iterator. More...
 
const_iterator begin () const
 Begin const iterator. More...
 
FArraycopy (const T2 t[S])
 C array of different type copy. More...
 
FArraycopy (const FArray< T2, S > &b)
 Copy. More...
 
const T * data () const
 Data pointer (read). More...
 
T * data ()
 Data pointer (write). More...
 
bool empty () const
 Is empty. More...
 
iterator end ()
 End iterator. More...
 
const_iterator end () const
 End const iterator. More...
 
FArrayfill (const T &v)
 Filling. More...
 
bool operator!= (const FArray &b) const
 Inequality test. More...
 
FArrayoperator= (const FArray< T2, S > &b)
 Assignment. More...
 
bool operator== (const FArray &b) const
 Equality test. More...
 
const T & operator[] (int i) const
 Read access. More...
 
T & operator[] (int i)
 Write access. More...
 
int size () const
 Size. More...
 

Additional Inherited Members

- Public Types inherited from Imagine::FArray< T, dim >
typedef const T * const_iterator
 Const iterator type.
 
typedef T * iterator
 Iterator type.
 
- Static Public Member Functions inherited from Imagine::FVector< T, 4 >
static FVector Zero ()
 Zero vector Vector with constant 0 value. More...
 
- Protected Attributes inherited from Imagine::FArray< T, dim >
_data [S]
 internal storage.
 

Detailed Description

template<typename T>
class Imagine::RGBA< T >

RED GREEN BLUE Alpha color

Parameters
Tvalue type
Examples:
Common/test/test.cpp, and Graphics/test/test.cpp.

Constructor & Destructor Documentation

◆ RGBA() [1/8]

template<typename T>
Imagine::RGBA< T >::RGBA ( )
inline

Constructs an uninitialized RGB of type T

RGBA<double> j; // uninitialized rgba

◆ RGBA() [2/8]

template<typename T>
Imagine::RGBA< T >::RGBA ( x)
inlineexplicit

Constructs a RGBA of type T, rgb initialized to a constant, a to 1

Parameters
xvalue used for initialization
RGBA<double> k(.6); // rgb filled with constant value, a=1

◆ RGBA() [3/8]

template<typename T>
Imagine::RGBA< T >::RGBA ( r,
g,
b,
a 
)
inline
Parameters
r,g,b,aRED, GREEN, BLUE, ALPHA values
RGBA<double> l(.12,.3,.43,.9); // rgba values

◆ RGBA() [4/8]

template<typename T>
Imagine::RGBA< T >::RGBA ( r,
g,
b 
)
inline
Parameters
r,g,bRED, GREEN, BLUE values puts 255 in ALPHA value
RGBA<double> q(.12,.3,.43); // rgba values from r, g, b

◆ RGBA() [5/8]

template<typename T>
Imagine::RGBA< T >::RGBA ( const T  t[4])
inline

Constructs a RGBA of type T, and copies values to it

Parameters
tC array used for initialization
double t2[]={.2,1.,.23,.3}; // rgba filled from C array
RGBA<double> m(t2); // ...

◆ RGBA() [6/8]

template<typename T>
Imagine::RGBA< T >::RGBA ( const Base x)
inline

Constructs from another RGBA

Parameters
xRGBA to copy
RGBA<double> n(l); // rgba copy constructor

◆ RGBA() [7/8]

template<typename T>
template<typename T2 >
Imagine::RGBA< T >::RGBA ( const FArray< T2, 4 > &  x)
inline
Parameters
xRGBA to copy
Template Parameters
T2value type of x
RGBA<float> o(l); // rgba from another type

◆ RGBA() [8/8]

template<typename T>
template<typename T2 >
Imagine::RGBA< T >::RGBA ( const FArray< T2, 3 > &  x)
inline

Constructs from RGB (a=1)

Parameters
xRGB to copy
Template Parameters
T2value type of x
RGBA<double>p(e); // RGB -> RGBA

Member Function Documentation

◆ a() [1/2]

template<typename T>
const T& Imagine::RGBA< T >::a ( ) const
inline

Read alpha alias

Returns
const ref. to alpha
x=n.a(); // RGBA Read alpha alias

◆ a() [2/2]

template<typename T>
T& Imagine::RGBA< T >::a ( )
inline

Write alpha alias

Returns
ref. to alpha
n.a()=x; // RGBA Write alpha alias

◆ b() [1/2]

template<typename T>
const T& Imagine::RGBA< T >::b ( ) const
inline

Read BLUE alias

Returns
const ref. to BLUE
x=n.b(); // RGBA Read BLUE alias

◆ b() [2/2]

template<typename T>
T& Imagine::RGBA< T >::b ( )
inline

Write BLUE alias

Returns
ref. to BLUE
n.b()=x; // RGBA Write BLUE alias

◆ g() [1/2]

template<typename T>
const T& Imagine::RGBA< T >::g ( ) const
inline

Read GREEN alias

Returns
const ref. to GREEN
x=n.g(); // RGBA Read GREEN alias

◆ g() [2/2]

template<typename T>
T& Imagine::RGBA< T >::g ( )
inline

Write GREEN alias

Returns
ref. to GREEN
n.g()=x; // RGBA Write GREEN alias

◆ operator T()

template<typename T>
Imagine::RGBA< T >::operator T ( ) const
inline

Convert to greyscale (grey=0.3*r+0.59*g+0.11*b)

Returns
greyscale value
grey=float(o); // RGBA to greyscale

◆ r() [1/2]

template<typename T>
const T& Imagine::RGBA< T >::r ( ) const
inline

Read RED alias

Returns
const ref. to RED
x=n.r(); // RGBA Read RED alias

◆ r() [2/2]

template<typename T>
T& Imagine::RGBA< T >::r ( )
inline

Write RED alias

Returns
ref. to RED
n.r()=x; // RGBA Write RED alias


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