ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkScalarToRGBPixelFunctor.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkScalarToRGBPixelFunctor_h
19#define itkScalarToRGBPixelFunctor_h
20
21#include "itkRGBPixel.h"
22
23namespace itk::Functor
24{
41template <typename TScalar>
42class ITK_TEMPLATE_EXPORT ScalarToRGBPixelFunctor
43{
44public:
47
48 using RGBComponentType = unsigned char;
50 using ScalarType = TScalar;
51
53 operator()(const TScalar &) const;
54
55 void
57 {
58 m_UseMSBForHashing = false;
59 }
60
61 void
63 {
64 m_UseMSBForHashing = true;
65 }
66
67 void
69 {
70 m_UseMSBForHashing = value;
71 }
72
73 [[nodiscard]] bool
75 {
76 return m_UseMSBForHashing;
77 }
78
79 void
81 {
82 m_UseMSBForHashing = true;
83 }
84
85 void
87 {
88 m_UseMSBForHashing = false;
89 }
90
91
92private:
94 unsigned int m_ColorIndex[3];
95};
96} // namespace itk::Functor
97
98#ifndef ITK_MANUAL_INSTANTIATION
99# include "itkScalarToRGBPixelFunctor.hxx"
100#endif
101
102#endif
RGBPixelType operator()(const TScalar &) const
Represent Red, Green and Blue components for color images.
Definition itkRGBPixel.h:59