go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkOpenCLImageFormat.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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 * http://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 itkOpenCLImageFormat_h
19#define itkOpenCLImageFormat_h
20
21#include "itkOpenCL.h"
22#include <ostream>
23
24namespace itk
25{
31// Forward declaration
32class OpenCLContext;
33
35{
36public:
39
50 {
51 BUFFER = 0x10F0,
52 IMAGE2D = 0x10F1,
53 IMAGE3D = 0x10F2,
54 IMAGE2D_ARRAY = 0x10F3,
55 IMAGE1D = 0x10F4,
56 IMAGE1D_ARRAY = 0x10F5,
57 IMAGE1D_BUFFER = 0x10F6
58 };
59
91 {
92 R = 0x10B0,
93 A = 0x10B1,
94 RG = 0x10B2,
95 RA = 0x10B3,
96 RGB = 0x10B4,
97 RGBA = 0x10B5,
98 BGRA = 0x10B6,
99 ARGB = 0x10B7,
100 INTENSITY = 0x10B8,
101 LUMINANCE = 0x10B9,
102 Rx = 0x10BA,
103 RGx = 0x10BB,
104 RGBx = 0x10BC,
105 DEPTH = 0x10BD,
106 DEPTH_STENCIL = 0x10BE
107 };
108
135 {
136 SNORM_INT8 = 0x10D0,
137 SNORM_INT16 = 0x10D1,
138 UNORM_INT8 = 0x10D2,
139 UNORM_INT16 = 0x10D3,
140 UNORM_SHORT_565 = 0x10D4,
141 UNORM_SHORT_555 = 0x10D5,
142 UNORM_INT_101010 = 0x10D6,
143 SIGNED_INT8 = 0x10D7,
144 SIGNED_INT16 = 0x10D8,
145 SIGNED_INT32 = 0x10D9,
146 UNSIGNED_INT8 = 0x10DA,
147 UNSIGNED_INT16 = 0x10DB,
148 UNSIGNED_INT32 = 0x10DC,
149 HALF_FLOAT = 0x10DD,
150 FLOAT = 0x10DE,
151 UNORM_INT24 = 0x10DF
152 };
153
157
161 const OpenCLImageFormat::ChannelType channelType);
162
166 const OpenCLImageFormat::ChannelOrder channelOrder,
167 const OpenCLImageFormat::ChannelType channelType);
168
170 bool
171 IsNull() const;
172
177
182
187
188private:
189 cl_mem_object_type m_ImageType;
190 cl_image_format m_Format;
191
193 friend class OpenCLContext;
194 friend class OpenCLImage;
195};
196
202
208
210template <typename charT, typename traits>
211inline std::basic_ostream<charT, traits> &
212operator<<(std::basic_ostream<charT, traits> & strm, const OpenCLImageFormat & format)
213{
214 if (format.IsNull())
215 {
216 strm << "OpenCLImageFormat(null)";
217 return strm;
218 }
219
220 strm << "OpenCLImageFormat(";
221 switch (int(format.GetImageType()))
222 {
224 strm << "BUFFER, ";
225 break;
227 strm << "IMAGE2D, ";
228 break;
230 strm << "IMAGE3D, ";
231 break;
233 strm << "IMAGE2D_ARRAY, ";
234 break;
236 strm << "IMAGE1D, ";
237 break;
239 strm << "IMAGE1D_ARRAY, ";
240 break;
242 strm << "IMAGE1D_BUFFER, ";
243 break;
244 default:
245 strm << int(format.GetImageType()) << ", ";
246 break;
247 }
248 switch (int(format.GetChannelOrder()))
249 {
251 strm << "R, ";
252 break;
254 strm << "A, ";
255 break;
257 strm << "RG, ";
258 break;
260 strm << "RA, ";
261 break;
263 strm << "RGB, ";
264 break;
266 strm << "RGBA, ";
267 break;
269 strm << "BGRA, ";
270 break;
272 strm << "ARGB, ";
273 break;
275 strm << "INTENSITY, ";
276 break;
278 strm << "LUMINANCE, ";
279 break;
281 strm << "Rx, ";
282 break;
284 strm << "RGx, ";
285 break;
287 strm << "RGBx, ";
288 break;
290 strm << "DEPTH, ";
291 break;
293 strm << "DEPTH_STENCIL, ";
294 break;
295 default:
296 strm << int(format.GetChannelOrder()) << ", ";
297 break;
298 }
299 switch (int(format.GetChannelType()))
300 {
302 strm << "SNORM_INT8";
303 break;
305 strm << "SNORM_INT16";
306 break;
308 strm << "UNORM_INT8";
309 break;
311 strm << "UNORM_INT16";
312 break;
314 strm << "UNORM_SHORT_565";
315 break;
317 strm << "UNORM_SHORT_555";
318 break;
320 strm << "UNORM_INT_101010";
321 break;
323 strm << "SIGNED_INT8";
324 break;
326 strm << "SIGNED_INT16";
327 break;
329 strm << "SIGNED_INT32";
330 break;
332 strm << "UNSIGNED_INT8";
333 break;
335 strm << "UNSIGNED_INT16";
336 break;
338 strm << "UNSIGNED_INT32";
339 break;
341 strm << "HALF_FLOAT";
342 break;
344 strm << "FLOAT";
345 break;
347 strm << "UNORM_INT24";
348 break;
349 default:
350 strm << int(format.GetChannelType());
351 break;
352 }
353
354 strm << ')' << std::endl;
355 return strm;
356}
357
358
359} // end namespace itk
360
361#endif /* itkOpenCLImageFormat_h */
The OpenCLContext class represents an OpenCL context.
The OpenCLImageFormat class represents the format of a OpenCLImage.
OpenCLImageFormat(const OpenCLImageFormat::ImageType imageType, const OpenCLImageFormat::ChannelOrder channelOrder, const OpenCLImageFormat::ChannelType channelType)
cl_mem_object_type m_ImageType
OpenCLImageFormat(const OpenCLImageFormat::ChannelOrder channelOrder, const OpenCLImageFormat::ChannelType channelType)
OpenCLImageFormat::ChannelType GetChannelType() const
OpenCLImageFormat::ChannelOrder GetChannelOrder() const
OpenCLImageFormat::ImageType GetImageType() const
The OpenCLImage class represents an image object is used to store a one, two or three dimensional tex...
#define ITKOpenCL_EXPORT
bool ITKOpenCL_EXPORT operator==(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
bool ITKOpenCL_EXPORT operator!=(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &strm, const OpenCLCommandQueue &queue)


Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo