18 #ifndef itkLabelToRGBFunctor_h
19 #define itkLabelToRGBFunctor_h
49 template <
typename TLabel,
typename TRGBPixel>
57 using ValueType =
typename TRGBPixel::ValueType;
70 constexpr
size_t numColors = 30;
71 constexpr
unsigned char colors[numColors][3] = {
72 { 255, 0, 0 }, { 0, 205, 0 }, { 0, 0, 255 }, { 0, 255, 255 }, { 255, 0, 255 }, { 255, 127, 0 },
73 { 0, 100, 0 }, { 138, 43, 226 }, { 139, 35, 35 }, { 0, 0, 128 }, { 139, 139, 0 }, { 255, 62, 150 },
74 { 139, 76, 57 }, { 0, 134, 139 }, { 205, 104, 57 }, { 191, 62, 255 }, { 0, 139, 69 }, { 199, 21, 133 },
75 { 205, 55, 0 }, { 32, 178, 170 }, { 106, 90, 205 }, { 255, 20, 147 }, { 69, 139, 116 }, { 72, 118, 255 },
76 { 205, 79, 57 }, { 0, 0, 205 }, { 139, 34, 82 }, { 139, 0, 139 }, { 238, 130, 238 }, { 139, 0, 0 }
79 for (
auto & color : colors)
81 AddColor(color[0], color[1], color[2]);
107 AddColor(
unsigned char r,
unsigned char g,
unsigned char b)
112 using ValueType =
typename TRGBPixel::ValueType;
116 rgbPixel[0] = static_cast<ValueType>(static_cast<double>(r) / 255 * m);
117 rgbPixel[1] = static_cast<ValueType>(static_cast<double>(g) / 255 * m);
118 rgbPixel[2] = static_cast<ValueType>(static_cast<double>(b) / 255 * m);
133 return static_cast<unsigned int>(
m_Colors.size());
146 for (
typename std::vector<TRGBPixel>::size_type i = 0; i <
m_Colors.size(); ++i)
159 return !(*
this != other);