ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkConvertPixelBuffer.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 itkConvertPixelBuffer_h
19#define itkConvertPixelBuffer_h
20#include "ITKIOImageBaseExport.h"
21
22#include "itkObject.h"
23#include "itkNumericTraits.h"
24#include <type_traits> // for enable_if
25
26namespace itk
27{
45template <typename InputPixelType, typename OutputPixelType, typename OutputConvertTraits>
46class ITK_TEMPLATE_EXPORT ConvertPixelBuffer
47{
48public:
50 using OutputComponentType = typename OutputConvertTraits::ComponentType;
52
53 // Remove all constructor/ destructor / assignments for class with only static member functions.
57 operator=(const ConvertPixelBuffer &) = delete;
60 virtual ~ConvertPixelBuffer() = delete;
61
63 static void
64 Convert(const InputPixelType * inputData, int inputNumberOfComponents, OutputPixelType * outputData, size_t size);
65
66 static void
67 ConvertVectorImage(const InputPixelType * inputData,
68 int inputNumberOfComponents,
69 OutputPixelType * outputData,
70 size_t size);
71
72protected:
75 static void
76 ConvertGrayToGray(const InputPixelType * inputData, OutputPixelType * outputData, size_t size);
77
82 static void
83 ConvertRGBToGray(const InputPixelType * inputData, OutputPixelType * outputData, size_t size);
84
89 static void
90 ConvertRGBAToGray(const InputPixelType * inputData, OutputPixelType * outputData, size_t size);
91
92 static void
93 ConvertMultiComponentToGray(const InputPixelType * inputData,
94 int inputNumberOfComponents,
95 OutputPixelType * outputData,
96 size_t size);
97
101 static void
102 ConvertGrayToRGB(const InputPixelType * inputData, OutputPixelType * outputData, size_t size);
103
105 static void
106 ConvertRGBToRGB(const InputPixelType * inputData, OutputPixelType * outputData, size_t size);
107
109 static void
110 ConvertRGBAToRGB(const InputPixelType * inputData, OutputPixelType * outputData, size_t size);
111
120 static void
121 ConvertMultiComponentToRGB(const InputPixelType * inputData,
122 int inputNumberOfComponents,
123 OutputPixelType * outputData,
124 size_t size);
125
127 static void
128 ConvertGrayToRGBA(const InputPixelType * inputData, OutputPixelType * outputData, size_t size);
129
130 static void
131 ConvertRGBToRGBA(const InputPixelType * inputData, OutputPixelType * outputData, size_t size);
132
133 static void
134 ConvertRGBAToRGBA(const InputPixelType * inputData, OutputPixelType * outputData, size_t size);
135
136 static void
137 ConvertMultiComponentToRGBA(const InputPixelType * inputData,
138 int inputNumberOfComponents,
139 OutputPixelType * outputData,
140 size_t size);
141
143 static void
144 ConvertVectorToVector(const InputPixelType * inputData,
145 int inputNumberOfComponents,
146 OutputPixelType * outputData,
147 size_t size);
148
151 static void
152 ConvertTensor6ToTensor6(const InputPixelType * inputData, OutputPixelType * outputData, size_t size);
153
154 static void
155 ConvertTensor9ToTensor6(const InputPixelType * inputData, OutputPixelType * outputData, size_t size);
156
158 static void
159 ConvertGrayToComplex(const InputPixelType * inputData, OutputPixelType * outputData, size_t size);
160
161 static void
162 ConvertComplexToComplex(const InputPixelType * inputData, OutputPixelType * outputData, size_t size);
163
164 static void
165 ConvertMultiComponentToComplex(const InputPixelType * inputData,
166 int inputNumberOfComponents,
167 OutputPixelType * outputData,
168 size_t size);
169
176 template <typename UComponentType>
177 static std::enable_if_t<!std::is_integral_v<UComponentType>, UComponentType>
179
180 template <typename UComponentType>
181 static std::enable_if_t<std::is_integral_v<UComponentType>, UComponentType>
183};
184} // namespace itk
185
186#ifndef ITK_MANUAL_INSTANTIATION
187# include "itkConvertPixelBuffer.hxx"
188#endif
189
190#endif // itkConvertPixelBuffer_h
ConvertPixelBuffer & operator=(ConvertPixelBuffer &&)=delete
ConvertPixelBuffer & operator=(const ConvertPixelBuffer &)=delete
static std::enable_if_t< std::is_integral_v< UComponentType >, UComponentType > DefaultAlphaValue()
static void ConvertVectorToVector(const InputPixelType *inputData, int inputNumberOfComponents, OutputPixelType *outputData, vcl_size_t size)
static void ConvertVectorImage(const InputPixelType *inputData, int inputNumberOfComponents, OutputPixelType *outputData, vcl_size_t size)
static void ConvertRGBToRGBA(const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size)
static void ConvertGrayToRGB(const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size)
static void ConvertRGBAToRGB(const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size)
static void Convert(const InputPixelType *inputData, int inputNumberOfComponents, OutputPixelType *outputData, vcl_size_t size)
static void ConvertGrayToRGBA(const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size)
static void ConvertComplexToComplex(const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size)
static void ConvertMultiComponentToRGBA(const InputPixelType *inputData, int inputNumberOfComponents, OutputPixelType *outputData, vcl_size_t size)
static void ConvertGrayToGray(const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size)
static void ConvertMultiComponentToRGB(const InputPixelType *inputData, int inputNumberOfComponents, OutputPixelType *outputData, vcl_size_t size)
static void ConvertRGBAToGray(const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size)
ConvertPixelBuffer(const ConvertPixelBuffer &)=delete
static void ConvertTensor6ToTensor6(const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size)
static void ConvertRGBToRGB(const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size)
typename OutputConvertTraits::ComponentType OutputComponentType
static void ConvertMultiComponentToComplex(const InputPixelType *inputData, int inputNumberOfComponents, OutputPixelType *outputData, vcl_size_t size)
virtual ~ConvertPixelBuffer()=delete
static void ConvertTensor9ToTensor6(const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size)
static void ConvertGrayToComplex(const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size)
ConvertPixelBuffer(ConvertPixelBuffer &&)=delete
static void ConvertRGBToGray(const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size)
static void ConvertRGBAToRGBA(const InputPixelType *inputData, OutputPixelType *outputData, vcl_size_t size)
static void ConvertMultiComponentToGray(const InputPixelType *inputData, int inputNumberOfComponents, OutputPixelType *outputData, vcl_size_t size)
static std::enable_if_t<!std::is_integral_v< UComponentType >, UComponentType > DefaultAlphaValue()
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....