18 #ifndef __itkLabelToRGBFunctor_h
19 #define __itkLabelToRGBFunctor_h
49 template<
typename TLabel,
typename TRGBPixel >
58 typedef typename TRGBPixel::ValueType ValueType;
124 void AddColor(
unsigned char r,
unsigned char g,
unsigned char b)
129 typedef typename TRGBPixel::ValueType ValueType;
133 rgbPixel[0] =
static_cast< ValueType
>(
static_cast< double >( r ) / 255 * m );
134 rgbPixel[1] =
static_cast< ValueType
>(
static_cast< double >( g ) / 255 * m );
135 rgbPixel[2] =
static_cast< ValueType
>(
static_cast< double >( b ) / 255 * m );
161 for (
typename std::vector< TRGBPixel >::size_type i = 0; i <
m_Colors.size(); ++i )
173 return !( *
this != other );
void SetBackgroundColor(TRGBPixel rgb)
TRGBPixel m_BackgroundColor
bool operator==(const Self &other) const
bool operator!=(const Self &l) const
void SetBackgroundValue(TLabel v)
std::vector< TRGBPixel > m_Colors
static void SetLength(T &m, const unsigned int s)
Functor for converting labels into RGB triplets.
unsigned int GetNumberOfColors() const
Define additional traits for native types such as int or float.
TRGBPixel operator()(const TLabel &p) const
void AddColor(unsigned char r, unsigned char g, unsigned char b)