ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkCustomColormapFunction.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 itkCustomColormapFunction_h
19#define itkCustomColormapFunction_h
20
21#include "itkColormapFunction.h"
22
23#include <vector>
24
25namespace itk::Function
26{
46template <typename TScalar, typename TRGBPixel>
47class ITK_TEMPLATE_EXPORT CustomColormapFunction : public ColormapFunction<TScalar, TRGBPixel>
48{
49public:
50 ITK_DISALLOW_COPY_AND_MOVE(CustomColormapFunction);
51
56
58 itkNewMacro(Self);
59
60 using typename Superclass::RGBPixelType;
61 using typename Superclass::ScalarType;
62 using typename Superclass::RealType;
63
64 using ChannelType = std::vector<RealType>;
65
67 operator()(const TScalar &) const override;
68
69 void
71 {
72 m_RedChannel = red;
73 }
74
75 ChannelType
77 {
78 return m_RedChannel;
79 }
80
81 void
83 {
84 m_GreenChannel = green;
85 }
86
87 ChannelType
89 {
90 return m_GreenChannel;
91 }
92
93 void
95 {
96 m_BlueChannel = blue;
97 }
98
99 ChannelType
101 {
102 return m_BlueChannel;
103 }
104
105protected:
107 ~CustomColormapFunction() override = default;
108
109private:
113};
114} // namespace itk::Function
115
116#ifndef ITK_MANUAL_INSTANTIATION
117# include "itkCustomColormapFunction.hxx"
118#endif
119
120#endif
typename NumericTraits< ScalarType >::RealType RealType
RGBPixelType operator()(const TScalar &) const override
ColormapFunction< TScalar, TRGBPixel > Superclass
~CustomColormapFunction() override=default
Implements transparent reference counting.