Home
|
Main Page
|
Modules
|
Namespace List
|
Class Hierarchy
|
Alphabetical List
|
Data Structures
|
File List
|
Namespace Members
|
Data Fields
|
Globals
|
Related Pages
Src
E
elastix
Common
OpenCL
ITKimprovements
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
24
namespace
itk
25
{
31
// Forward declaration
32
class
OpenCLContext;
33
34
class
ITKOpenCL_EXPORT
OpenCLImageFormat
35
{
36
public
:
38
using
Self
=
OpenCLImageFormat
;
39
49
enum
ImageType
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
90
enum
ChannelOrder
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
134
enum
ChannelType
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
156
OpenCLImageFormat
();
157
160
OpenCLImageFormat
(
const
OpenCLImageFormat::ChannelOrder
channelOrder,
161
const
OpenCLImageFormat::ChannelType
channelType);
162
165
OpenCLImageFormat
(
const
OpenCLImageFormat::ImageType
imageType,
166
const
OpenCLImageFormat::ChannelOrder
channelOrder,
167
const
OpenCLImageFormat::ChannelType
channelType);
168
170
bool
171
IsNull
()
const
;
172
175
OpenCLImageFormat::ImageType
176
GetImageType
()
const
;
177
180
OpenCLImageFormat::ChannelOrder
181
GetChannelOrder
()
const
;
182
185
OpenCLImageFormat::ChannelType
186
GetChannelType
()
const
;
187
188
private
:
189
cl_mem_object_type
m_ImageType
;
190
cl_image_format
m_Format
;
191
193
friend
class
OpenCLContext
;
194
friend
class
OpenCLImage
;
195
};
196
200
bool
ITKOpenCL_EXPORT
201
operator==
(
const
OpenCLImageFormat
& lhs,
const
OpenCLImageFormat
& rhs);
202
206
bool
ITKOpenCL_EXPORT
207
operator!=
(
const
OpenCLImageFormat
& lhs,
const
OpenCLImageFormat
& rhs);
208
210
template
<
typename
char
T,
typename
traits>
211
inline
std::basic_ostream<charT, traits> &
212
operator<<
(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
{
223
case
OpenCLImageFormat::BUFFER
:
224
strm <<
"BUFFER, "
;
225
break
;
226
case
OpenCLImageFormat::IMAGE2D
:
227
strm <<
"IMAGE2D, "
;
228
break
;
229
case
OpenCLImageFormat::IMAGE3D
:
230
strm <<
"IMAGE3D, "
;
231
break
;
232
case
OpenCLImageFormat::IMAGE2D_ARRAY
:
233
strm <<
"IMAGE2D_ARRAY, "
;
234
break
;
235
case
OpenCLImageFormat::IMAGE1D
:
236
strm <<
"IMAGE1D, "
;
237
break
;
238
case
OpenCLImageFormat::IMAGE1D_ARRAY
:
239
strm <<
"IMAGE1D_ARRAY, "
;
240
break
;
241
case
OpenCLImageFormat::IMAGE1D_BUFFER
:
242
strm <<
"IMAGE1D_BUFFER, "
;
243
break
;
244
default
:
245
strm <<
int
(format.
GetImageType
()) <<
", "
;
246
break
;
247
}
248
switch
(
int
(format.
GetChannelOrder
()))
249
{
250
case
OpenCLImageFormat::R
:
251
strm <<
"R, "
;
252
break
;
253
case
OpenCLImageFormat::A
:
254
strm <<
"A, "
;
255
break
;
256
case
OpenCLImageFormat::RG
:
257
strm <<
"RG, "
;
258
break
;
259
case
OpenCLImageFormat::RA
:
260
strm <<
"RA, "
;
261
break
;
262
case
OpenCLImageFormat::RGB
:
263
strm <<
"RGB, "
;
264
break
;
265
case
OpenCLImageFormat::RGBA
:
266
strm <<
"RGBA, "
;
267
break
;
268
case
OpenCLImageFormat::BGRA
:
269
strm <<
"BGRA, "
;
270
break
;
271
case
OpenCLImageFormat::ARGB
:
272
strm <<
"ARGB, "
;
273
break
;
274
case
OpenCLImageFormat::INTENSITY
:
275
strm <<
"INTENSITY, "
;
276
break
;
277
case
OpenCLImageFormat::LUMINANCE
:
278
strm <<
"LUMINANCE, "
;
279
break
;
280
case
OpenCLImageFormat::Rx
:
281
strm <<
"Rx, "
;
282
break
;
283
case
OpenCLImageFormat::RGx
:
284
strm <<
"RGx, "
;
285
break
;
286
case
OpenCLImageFormat::RGBx
:
287
strm <<
"RGBx, "
;
288
break
;
289
case
OpenCLImageFormat::DEPTH
:
290
strm <<
"DEPTH, "
;
291
break
;
292
case
OpenCLImageFormat::DEPTH_STENCIL
:
293
strm <<
"DEPTH_STENCIL, "
;
294
break
;
295
default
:
296
strm <<
int
(format.
GetChannelOrder
()) <<
", "
;
297
break
;
298
}
299
switch
(
int
(format.
GetChannelType
()))
300
{
301
case
OpenCLImageFormat::SNORM_INT8
:
302
strm <<
"SNORM_INT8"
;
303
break
;
304
case
OpenCLImageFormat::SNORM_INT16
:
305
strm <<
"SNORM_INT16"
;
306
break
;
307
case
OpenCLImageFormat::UNORM_INT8
:
308
strm <<
"UNORM_INT8"
;
309
break
;
310
case
OpenCLImageFormat::UNORM_INT16
:
311
strm <<
"UNORM_INT16"
;
312
break
;
313
case
OpenCLImageFormat::UNORM_SHORT_565
:
314
strm <<
"UNORM_SHORT_565"
;
315
break
;
316
case
OpenCLImageFormat::UNORM_SHORT_555
:
317
strm <<
"UNORM_SHORT_555"
;
318
break
;
319
case
OpenCLImageFormat::UNORM_INT_101010
:
320
strm <<
"UNORM_INT_101010"
;
321
break
;
322
case
OpenCLImageFormat::SIGNED_INT8
:
323
strm <<
"SIGNED_INT8"
;
324
break
;
325
case
OpenCLImageFormat::SIGNED_INT16
:
326
strm <<
"SIGNED_INT16"
;
327
break
;
328
case
OpenCLImageFormat::SIGNED_INT32
:
329
strm <<
"SIGNED_INT32"
;
330
break
;
331
case
OpenCLImageFormat::UNSIGNED_INT8
:
332
strm <<
"UNSIGNED_INT8"
;
333
break
;
334
case
OpenCLImageFormat::UNSIGNED_INT16
:
335
strm <<
"UNSIGNED_INT16"
;
336
break
;
337
case
OpenCLImageFormat::UNSIGNED_INT32
:
338
strm <<
"UNSIGNED_INT32"
;
339
break
;
340
case
OpenCLImageFormat::HALF_FLOAT
:
341
strm <<
"HALF_FLOAT"
;
342
break
;
343
case
OpenCLImageFormat::FLOAT
:
344
strm <<
"FLOAT"
;
345
break
;
346
case
OpenCLImageFormat::UNORM_INT24
:
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 */
int
itk::OpenCLContext
The OpenCLContext class represents an OpenCL context.
Definition
itkOpenCLContext.h:77
itk::OpenCLImageFormat
The OpenCLImageFormat class represents the format of a OpenCLImage.
Definition
itkOpenCLImageFormat.h:35
itk::OpenCLImageFormat::OpenCLImageFormat
OpenCLImageFormat()
itk::OpenCLImageFormat::OpenCLImageFormat
OpenCLImageFormat(const OpenCLImageFormat::ImageType imageType, const OpenCLImageFormat::ChannelOrder channelOrder, const OpenCLImageFormat::ChannelType channelType)
itk::OpenCLImageFormat::m_ImageType
cl_mem_object_type m_ImageType
Definition
itkOpenCLImageFormat.h:189
itk::OpenCLImageFormat::m_Format
cl_image_format m_Format
Definition
itkOpenCLImageFormat.h:190
itk::OpenCLImageFormat::ChannelOrder
ChannelOrder
Definition
itkOpenCLImageFormat.h:91
itk::OpenCLImageFormat::ARGB
@ ARGB
Definition
itkOpenCLImageFormat.h:99
itk::OpenCLImageFormat::RA
@ RA
Definition
itkOpenCLImageFormat.h:95
itk::OpenCLImageFormat::LUMINANCE
@ LUMINANCE
Definition
itkOpenCLImageFormat.h:101
itk::OpenCLImageFormat::BGRA
@ BGRA
Definition
itkOpenCLImageFormat.h:98
itk::OpenCLImageFormat::INTENSITY
@ INTENSITY
Definition
itkOpenCLImageFormat.h:100
itk::OpenCLImageFormat::DEPTH_STENCIL
@ DEPTH_STENCIL
Definition
itkOpenCLImageFormat.h:106
itk::OpenCLImageFormat::RG
@ RG
Definition
itkOpenCLImageFormat.h:94
itk::OpenCLImageFormat::RGB
@ RGB
Definition
itkOpenCLImageFormat.h:96
itk::OpenCLImageFormat::RGBx
@ RGBx
Definition
itkOpenCLImageFormat.h:104
itk::OpenCLImageFormat::DEPTH
@ DEPTH
Definition
itkOpenCLImageFormat.h:105
itk::OpenCLImageFormat::R
@ R
Definition
itkOpenCLImageFormat.h:92
itk::OpenCLImageFormat::Rx
@ Rx
Definition
itkOpenCLImageFormat.h:102
itk::OpenCLImageFormat::A
@ A
Definition
itkOpenCLImageFormat.h:93
itk::OpenCLImageFormat::RGx
@ RGx
Definition
itkOpenCLImageFormat.h:103
itk::OpenCLImageFormat::RGBA
@ RGBA
Definition
itkOpenCLImageFormat.h:97
itk::OpenCLImageFormat::OpenCLImageFormat
OpenCLImageFormat(const OpenCLImageFormat::ChannelOrder channelOrder, const OpenCLImageFormat::ChannelType channelType)
itk::OpenCLImageFormat::GetChannelType
OpenCLImageFormat::ChannelType GetChannelType() const
itk::OpenCLImageFormat::IsNull
bool IsNull() const
itk::OpenCLImageFormat::GetChannelOrder
OpenCLImageFormat::ChannelOrder GetChannelOrder() const
itk::OpenCLImageFormat::GetImageType
OpenCLImageFormat::ImageType GetImageType() const
itk::OpenCLImageFormat::ImageType
ImageType
Definition
itkOpenCLImageFormat.h:50
itk::OpenCLImageFormat::IMAGE2D
@ IMAGE2D
Definition
itkOpenCLImageFormat.h:52
itk::OpenCLImageFormat::IMAGE1D
@ IMAGE1D
Definition
itkOpenCLImageFormat.h:55
itk::OpenCLImageFormat::IMAGE1D_ARRAY
@ IMAGE1D_ARRAY
Definition
itkOpenCLImageFormat.h:56
itk::OpenCLImageFormat::BUFFER
@ BUFFER
Definition
itkOpenCLImageFormat.h:51
itk::OpenCLImageFormat::IMAGE1D_BUFFER
@ IMAGE1D_BUFFER
Definition
itkOpenCLImageFormat.h:57
itk::OpenCLImageFormat::IMAGE2D_ARRAY
@ IMAGE2D_ARRAY
Definition
itkOpenCLImageFormat.h:54
itk::OpenCLImageFormat::IMAGE3D
@ IMAGE3D
Definition
itkOpenCLImageFormat.h:53
itk::OpenCLImageFormat::ChannelType
ChannelType
Definition
itkOpenCLImageFormat.h:135
itk::OpenCLImageFormat::UNORM_SHORT_555
@ UNORM_SHORT_555
Definition
itkOpenCLImageFormat.h:141
itk::OpenCLImageFormat::UNORM_SHORT_565
@ UNORM_SHORT_565
Definition
itkOpenCLImageFormat.h:140
itk::OpenCLImageFormat::SIGNED_INT16
@ SIGNED_INT16
Definition
itkOpenCLImageFormat.h:144
itk::OpenCLImageFormat::SIGNED_INT32
@ SIGNED_INT32
Definition
itkOpenCLImageFormat.h:145
itk::OpenCLImageFormat::UNORM_INT24
@ UNORM_INT24
Definition
itkOpenCLImageFormat.h:151
itk::OpenCLImageFormat::UNORM_INT_101010
@ UNORM_INT_101010
Definition
itkOpenCLImageFormat.h:142
itk::OpenCLImageFormat::UNSIGNED_INT8
@ UNSIGNED_INT8
Definition
itkOpenCLImageFormat.h:146
itk::OpenCLImageFormat::SNORM_INT8
@ SNORM_INT8
Definition
itkOpenCLImageFormat.h:136
itk::OpenCLImageFormat::UNSIGNED_INT32
@ UNSIGNED_INT32
Definition
itkOpenCLImageFormat.h:148
itk::OpenCLImageFormat::SNORM_INT16
@ SNORM_INT16
Definition
itkOpenCLImageFormat.h:137
itk::OpenCLImageFormat::FLOAT
@ FLOAT
Definition
itkOpenCLImageFormat.h:150
itk::OpenCLImageFormat::UNORM_INT8
@ UNORM_INT8
Definition
itkOpenCLImageFormat.h:138
itk::OpenCLImageFormat::UNORM_INT16
@ UNORM_INT16
Definition
itkOpenCLImageFormat.h:139
itk::OpenCLImageFormat::SIGNED_INT8
@ SIGNED_INT8
Definition
itkOpenCLImageFormat.h:143
itk::OpenCLImageFormat::HALF_FLOAT
@ HALF_FLOAT
Definition
itkOpenCLImageFormat.h:149
itk::OpenCLImageFormat::UNSIGNED_INT16
@ UNSIGNED_INT16
Definition
itkOpenCLImageFormat.h:147
itk::OpenCLImage
The OpenCLImage class represents an image object is used to store a one, two or three dimensional tex...
Definition
itkOpenCLImage.h:39
ITKOpenCL_EXPORT
#define ITKOpenCL_EXPORT
Definition
itkOpenCLExport.h:33
itkOpenCL.h
itk
Definition
itkAdvancedImageToImageMetric.h:43
itk::operator==
bool ITKOpenCL_EXPORT operator==(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
itk::operator!=
bool ITKOpenCL_EXPORT operator!=(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
itk::operator<<
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &strm, const OpenCLCommandQueue &queue)
Definition
itkOpenCLCommandQueue.h:135
Generated on 2024-07-17 for elastix by
1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d)