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:
37
40
50 enum ImageType {
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 R = 0x10B0,
92 A = 0x10B1,
93 RG = 0x10B2,
94 RA = 0x10B3,
95 RGB = 0x10B4,
96 RGBA = 0x10B5,
97 BGRA = 0x10B6,
98 ARGB = 0x10B7,
99 INTENSITY = 0x10B8,
100 LUMINANCE = 0x10B9,
101 Rx = 0x10BA,
102 RGx = 0x10BB,
103 RGBx = 0x10BC,
104 DEPTH = 0x10BD,
105 DEPTH_STENCIL = 0x10BE
106 };
107
134 SNORM_INT8 = 0x10D0,
135 SNORM_INT16 = 0x10D1,
136 UNORM_INT8 = 0x10D2,
137 UNORM_INT16 = 0x10D3,
138 UNORM_SHORT_565 = 0x10D4,
139 UNORM_SHORT_555 = 0x10D5,
140 UNORM_INT_101010 = 0x10D6,
141 SIGNED_INT8 = 0x10D7,
142 SIGNED_INT16 = 0x10D8,
143 SIGNED_INT32 = 0x10D9,
144 UNSIGNED_INT8 = 0x10DA,
145 UNSIGNED_INT16 = 0x10DB,
146 UNSIGNED_INT32 = 0x10DC,
147 HALF_FLOAT = 0x10DD,
148 FLOAT = 0x10DE,
149 UNORM_INT24 = 0x10DF
150 };
151
155
159 const OpenCLImageFormat::ChannelOrder channelOrder,
160 const OpenCLImageFormat::ChannelType channelType );
161
165 const OpenCLImageFormat::ImageType imageType,
166 const OpenCLImageFormat::ChannelOrder channelOrder,
167 const OpenCLImageFormat::ChannelType channelType );
168
170 bool IsNull() const;
171
175
179
183
184private:
185
186 cl_mem_object_type m_ImageType;
187 cl_image_format m_Format;
188
190 friend class OpenCLContext;
191 friend class OpenCLImage;
192};
193
198
203
205template< typename charT, typename traits >
206inline
207std::basic_ostream< charT, traits > &
208operator<<( std::basic_ostream< charT, traits > & strm,
209 const OpenCLImageFormat & format )
210{
211 if( format.IsNull() )
212 {
213 strm << "OpenCLImageFormat(null)";
214 return strm;
215 }
216
217 strm << "OpenCLImageFormat(";
218 switch( int( format.GetImageType() ) )
219 {
221 strm << "BUFFER, "; break;
223 strm << "IMAGE2D, "; break;
225 strm << "IMAGE3D, "; break;
227 strm << "IMAGE2D_ARRAY, "; break;
229 strm << "IMAGE1D, "; break;
231 strm << "IMAGE1D_ARRAY, "; break;
233 strm << "IMAGE1D_BUFFER, "; break;
234 default:
235 strm << int( format.GetImageType() ) << ", "; break;
236 }
237 switch( int( format.GetChannelOrder() ) )
238 {
240 strm << "R, "; break;
242 strm << "A, "; break;
244 strm << "RG, "; break;
246 strm << "RA, "; break;
248 strm << "RGB, "; break;
250 strm << "RGBA, "; break;
252 strm << "BGRA, "; break;
254 strm << "ARGB, "; break;
256 strm << "INTENSITY, "; break;
258 strm << "LUMINANCE, "; break;
260 strm << "Rx, "; break;
262 strm << "RGx, "; break;
264 strm << "RGBx, "; break;
266 strm << "DEPTH, "; break;
268 strm << "DEPTH_STENCIL, "; break;
269 default:
270 strm << int( format.GetChannelOrder() ) << ", "; break;
271 }
272 switch( int( format.GetChannelType() ) )
273 {
275 strm << "SNORM_INT8"; break;
277 strm << "SNORM_INT16"; break;
279 strm << "UNORM_INT8"; break;
281 strm << "UNORM_INT16"; break;
283 strm << "UNORM_SHORT_565"; break;
285 strm << "UNORM_SHORT_555"; break;
287 strm << "UNORM_INT_101010"; break;
289 strm << "SIGNED_INT8"; break;
291 strm << "SIGNED_INT16"; break;
293 strm << "SIGNED_INT32"; break;
295 strm << "UNSIGNED_INT8"; break;
297 strm << "UNSIGNED_INT16"; break;
299 strm << "UNSIGNED_INT32"; break;
301 strm << "HALF_FLOAT"; break;
303 strm << "FLOAT"; break;
305 strm << "UNORM_INT24"; break;
306 default:
307 strm << int( format.GetChannelType() ); break;
308 }
309
310 strm << ')' << std::endl;
311 return strm;
312}
313
314
315} // end namespace itk
316
317#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 1667476801 for elastix by doxygen 1.9.4 elastix logo