iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::PixRGBA< T > Struct Template Reference

#include <nrt/Core/Image/PixelTypes.H>

template<class T>
struct nrt::PixRGBA< T >

A pixel class to hold red-green-blue-alpha color components.

Examples:
tests/test-Geometry.C.

Definition at line 295 of file PixelTypes.H.

Inheritance diagram for nrt::PixRGBA< T >:
nrt::PixRGB< T >

Public Types

typedef PixRGB< T > BaseType
 
typedef PixelWithAlpha< T > ExtraType
 
- Public Types inherited from nrt::PixelWithAlpha< T >
typedef T ExtraPODType
 

Public Member Functions

 PixRGBA ()
 Default Constructor. More...
 
template<class T2 >
 PixRGBA (PixRGBA< T2 > const &other)
 Copy Constructor.
 
template<typename T1 >
 PixRGBA (T1 val)
 initialize with a POD type or pixel
 
 PixRGBA (T r, T g, T b, T a)
 Value Constructor. More...
 
template<class rType , class gType , class bType , class aType >
 PixRGBA (rType r, gType g, bType b, aType a)
 Clamping Value Constructor. More...
 
r () const
 Read the red channel.
 
g () const
 Read the green channel.
 
b () const
 Read the blue channel.
 
a () const
 Read the alpha channel.
 
void setR (T value)
 Set the red channel.
 
void setG (T value)
 Set the green channel.
 
void setB (T value)
 Set the blue channel.
 
void setA (T value)
 Set the alpha channel.
 
template<class T2 >
void setR (T2 value)
 Set the red channel and clamp/round if necessary.
 
template<class T2 >
void setG (T2 value)
 Set the green channel and clamp/round if necessary.
 
template<class T2 >
void setB (T2 value)
 Set the blue channel and clamp/round if necessary.
 
template<class T2 >
void setA (T2 value)
 Set the alpha channel and clamp/round if necessary.
 
std::string toString ()
 Convenience function to print out the values as a nicely formatted string.
 
PixRGB< T > toRGB () const
 Convert this color space to RGB.
 
template<class Archive >
void serialize (Archive &ar)
 Serialization.
 
template<typename T1 >
 PixRGBA (T1 value)
 
template<class T >
 PixRGBA (T r, T g, T b, T a)
 
template<class T2 >
 PixRGBA (PixRGBA< T2 > const &other)
 
template<class rType , class gType , class bType , class aType >
 PixRGBA (rType r, gType g, bType b, aType a)
 
template<class T >
void setR (T value)
 
template<class T >
void setG (T value)
 
template<class T >
void setB (T value)
 
template<class T >
void setA (T value)
 
template<class T2 >
void setR (T2 value)
 
template<class T2 >
void setG (T2 value)
 
template<class T2 >
void setB (T2 value)
 
template<class T2 >
void setA (T2 value)
 
- Public Member Functions inherited from nrt::PixRGB< T >
 PixRGB ()
 Default Constructor. More...
 
template<class T2 >
 PixRGB (PixRGB< T2 > const &other)
 Copy Constructor.
 
template<typename T1 >
 PixRGB (T1 val)
 initialize with a POD type or pixel
 
 PixRGB (T r, T g, T b)
 Value Constructor. More...
 
template<class rType , class gType , class bType >
 PixRGB (rType r, gType g, bType b)
 Clamping Value Constructor. More...
 
r () const
 Read the red channel.
 
g () const
 Read the green channel.
 
b () const
 Read the blue channel.
 
void setR (T value)
 Set the red channel.
 
void setG (T value)
 Set the green channel.
 
void setB (T value)
 Set the blue channel.
 
template<class T2 >
void setR (T2 value)
 Set the red channel and clamp/round if necessary.
 
template<class T2 >
void setG (T2 value)
 Set the green channel and clamp/round if necessary.
 
template<class T2 >
void setB (T2 value)
 Set the blue channel and clamp/round if necessary.
 
PixRGB< T > toRGB () const
 Convert this color space to RGB.
 
template<class T >
 PixRGB (T r, T g, T b)
 
template<class T2 >
 PixRGB (PixRGB< T2 > const &other)
 
template<typename T1 >
 PixRGB (T1 value)
 
template<class rType , class gType , class bType >
 PixRGB (rType r, gType g, bType b)
 
template<class T >
void setR (T value)
 
template<class T >
void setG (T value)
 
template<class T >
void setB (T value)
 
template<class T2 >
void setR (T2 value)
 
template<class T2 >
void setG (T2 value)
 
template<class T2 >
void setB (T2 value)
 
- Public Member Functions inherited from nrt::PixelBase< T, numChans, PixType >
T * begin ()
 Access beginning of underlying array.
 
T * end ()
 Access the end of underlying array.
 
T const * begin () const
 Access the beginning of underlying array.
 
T const * end () const
 Access the end of underlying array.
 
std::string toString ()
 Convenience function to print out the values as a nicely formatted string.
 
template<class Archive >
void serialize (Archive &ar)
 
template<typename T1 , typename >
 PixelBase (T1 const &val)
 
template<class T2 >
 PixelBase (PixelBase< T2, numChans, PixType > const &other)
 
template<class T1 , template< typename > class PixType2>
 PixelBase (PixelBase< T1, 1, PixType2 > const &other)
 
template<template< typename...> class PixType2, typename... PixType2Args, typename >
 PixelBase (PixType2< PixType2Args...> const &other)
 
- Public Member Functions inherited from nrt::PixelWithAlpha< T >
template<typename T1 , typename = typename std::enable_if<std::is_arithmetic<T1>::value>::type>
 PixelWithAlpha (T1 const &val)
 
template<typename T1 >
 PixelWithAlpha (PixelWithAlpha< T1 > const &other)
 
a () const
 
void setA (T a)
 
template<class T2 >
void setA (T2 a)
 
template<class Archive >
void serialize (Archive &ar)
 

Static Public Member Functions

static PixRGBA< T > fromRGB (PixRGB< T > const &other)
 Convert to this color space from RGB.
 
- Static Public Member Functions inherited from nrt::PixRGB< T >
static PixRGB< T > fromRGB (PixRGB< T > const &other)
 Convert to this color space from RGB.
 

Related Functions

(Note that these are not member functions.)

template<class T >
std::ostream & operator<< (std::ostream &out, PixRGBA< T > pix)
 Stream out as PixRGBA(r,g,b,a) More...
 

Additional Inherited Members

- Public Attributes inherited from nrt::PixelBase< T, numChans, PixType >
std::array< T, numChans > channels
 The actual data held by this pixel type.
 
- Public Attributes inherited from nrt::PixelWithAlpha< T >
alpha
 
- Static Public Attributes inherited from nrt::PixelBase< T, numChans, PixType >
static const size_t numChannels = numChans
 The number of channels contained in this Pixel.
 
- Protected Member Functions inherited from nrt::PixelBase< T, numChans, PixType >
 PixelBase ()
 Default Constructor.
 
template<typename T1 , typename = typename std::enable_if<std::is_arithmetic<T1>::value>::type>
 PixelBase (T1 const &val)
 Uniform Constructor.
 
 PixelBase (PixelBase< T, numChans, PixType > const &other)=default
 Copy Constructor.
 
template<class T2 >
 PixelBase (PixelBase< T2, numChans, PixType > const &other)
 Conversion Copy Constructor. More...
 
template<class T1 , template< typename > class PixType1>
 PixelBase (PixelBase< T1, 1, PixType1 > const &other)
 construct from a single channel pixel
 
template<template< typename...> class PixType2, typename... PixType2Args, typename = typename std::enable_if<pixel_traits<PixType2<PixType2Args...>>::is_multi_channel>::type>
 PixelBase (PixType2< PixType2Args...> const &other)
 Colorspace Conversion Copy Constructor.
 

Constructor & Destructor Documentation

template<class T>
nrt::PixRGBA< T >::PixRGBA ( )

Default Constructor.

All components will be uninitialized

template<class T>
nrt::PixRGBA< T >::PixRGBA ( r,
g,
b,
a 
)

Value Constructor.

All components will be initialized to the given values

template<class T>
template<class rType , class gType , class bType , class aType >
nrt::PixRGBA< T >::PixRGBA ( rType  r,
gType  g,
bType  b,
aType  a 
)

Clamping Value Constructor.

All components will be initialized to the given values and clamped/rounded if necessary

Friends And Related Function Documentation

template<class T >
std::ostream & operator<< ( std::ostream &  out,
PixRGBA< T >  pix 
)
related

Stream out as PixRGBA(r,g,b,a)

Definition at line 371 of file PixelTypes.H.


The documentation for this struct was generated from the following files: