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

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

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

A pixel class to hold hue-saturation-value color components.

Examples:
tests/test-GenericImage.C, tests/test-Image.C, tests/test-rgb2hsv-Image_vs_Blitz_vs_OpenCV.C, and tests/test-Traits.C.

Definition at line 188 of file PixelTypes.H.

Inherits nrt::PixelBase< T, numChans, PixType >.

Public Member Functions

 PixHSV ()
 Default Constructor. More...
 
template<class T2 >
 PixHSV (PixHSV< T2 > const &other)
 Copy Constructor.
 
template<typename T1 >
 PixHSV (T1 val)
 initialize with a POD type or pixel
 
 PixHSV (T h, T s, T v)
 Value Constructor. More...
 
template<class hType , class sType , class vType >
 PixHSV (hType h, sType s, vType v)
 Clamping Value Constructor. More...
 
h () const
 Read the hue channel.
 
s () const
 Read the saturation channel.
 
v () const
 Read the value channel.
 
void setH (T value)
 Set the hue channel.
 
void setS (T value)
 Set the saturation channel.
 
void setV (T value)
 Set the value channel.
 
template<class T2 >
void setH (T2 value)
 Set the hue channel and clamp/round if necessary.
 
template<class T2 >
void setS (T2 value)
 Set the saturation channel and clamp/round if necessary.
 
template<class T2 >
void setV (T2 value)
 Set the value channel and clamp/round if necessary.
 
PixRGB< T > toRGB () const
 Convert this color space to RGB.
 
template<typename T1 >
 PixHSV (T1 value)
 
template<class T >
 PixHSV (T h, T s, T v)
 
template<class T2 >
 PixHSV (PixHSV< T2 > const &other)
 
template<class hType , class sType , class vType >
 PixHSV (hType h, sType s, vType v)
 
template<class T >
void setH (T value)
 
template<class T >
void setS (T value)
 
template<class T >
void setV (T value)
 
template<class T2 >
void setH (T2 value)
 
template<class T2 >
void setS (T2 value)
 
template<class T2 >
void setV (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 PixHSV< 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, PixHSV< T > pix)
 Stream out as PixHSV(h,s,v) 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::PixHSV< T >::PixHSV ( )

Default Constructor.

All components will be uninitialized

template<class T>
nrt::PixHSV< T >::PixHSV ( h,
s,
v 
)

Value Constructor.

All components will be initialized to the given values

template<class T>
template<class hType , class sType , class vType >
nrt::PixHSV< T >::PixHSV ( hType  h,
sType  s,
vType  v 
)

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

Stream out as PixHSV(h,s,v)

Definition at line 243 of file PixelTypes.H.


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