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

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

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

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

Examples:
tests/test-GenericImage.C, tests/test-Geometry.C, tests/test-Image.C, tests/test-ImagePolyIter.C, tests/test-Pixel.C, tests/test-Pyramid.C, tests/test-rgb2hsv-Image_vs_Blitz_vs_OpenCV.C, and tests/test-Traits.C.

Definition at line 52 of file PixelBase.H.

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

Public Member Functions

 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)
 

Static Public Member Functions

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, PixRGB< T > pix)
 Stream out as PixRGB(r,g,b) More...
 

Additional Inherited Members

- Public Types inherited from nrt::PixelBase< T, numChans, PixType >
typedef T PODType
 The type of data stored in the channels.
 
- Public Attributes inherited from nrt::PixelBase< T, numChans, PixType >
std::array< T, numChans > channels
 The actual data held by this pixel type.
 
- 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::PixRGB< T >::PixRGB ( )

Default Constructor.

All components will be uninitialized

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

Value Constructor.

All components will be initialized to the given values

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

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,
PixRGB< T >  pix 
)
related

Stream out as PixRGB(r,g,b)

Definition at line 103 of file PixelTypes.H.


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