Home
|
Main Page
|
Modules
|
Namespace List
|
Class Hierarchy
|
Alphabetical List
|
Data Structures
|
File List
|
Namespace Members
|
Data Fields
|
Globals
|
Related Pages
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
:
37
39
typedef
OpenCLImageFormat
Self
;
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
90
enum
ChannelOrder
{
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
133
enum
ChannelType
{
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
154
OpenCLImageFormat
();
155
158
OpenCLImageFormat
(
159
const
OpenCLImageFormat::ChannelOrder
channelOrder,
160
const
OpenCLImageFormat::ChannelType
channelType );
161
164
OpenCLImageFormat
(
165
const
OpenCLImageFormat::ImageType
imageType,
166
const
OpenCLImageFormat::ChannelOrder
channelOrder,
167
const
OpenCLImageFormat::ChannelType
channelType );
168
170
bool
IsNull
()
const
;
171
174
OpenCLImageFormat::ImageType
GetImageType
()
const
;
175
178
OpenCLImageFormat::ChannelOrder
GetChannelOrder
()
const
;
179
182
OpenCLImageFormat::ChannelType
GetChannelType
()
const
;
183
184
private
:
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
197
bool
ITKOpenCL_EXPORT
operator==
(
const
OpenCLImageFormat
& lhs,
const
OpenCLImageFormat
& rhs );
198
202
bool
ITKOpenCL_EXPORT
operator!=
(
const
OpenCLImageFormat
& lhs,
const
OpenCLImageFormat
& rhs );
203
205
template
<
typename
char
T,
typename
traits >
206
inline
207
std::basic_ostream< charT, traits > &
208
operator<<
( 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
{
220
case
OpenCLImageFormat::BUFFER
:
221
strm <<
"BUFFER, "
;
break
;
222
case
OpenCLImageFormat::IMAGE2D
:
223
strm <<
"IMAGE2D, "
;
break
;
224
case
OpenCLImageFormat::IMAGE3D
:
225
strm <<
"IMAGE3D, "
;
break
;
226
case
OpenCLImageFormat::IMAGE2D_ARRAY
:
227
strm <<
"IMAGE2D_ARRAY, "
;
break
;
228
case
OpenCLImageFormat::IMAGE1D
:
229
strm <<
"IMAGE1D, "
;
break
;
230
case
OpenCLImageFormat::IMAGE1D_ARRAY
:
231
strm <<
"IMAGE1D_ARRAY, "
;
break
;
232
case
OpenCLImageFormat::IMAGE1D_BUFFER
:
233
strm <<
"IMAGE1D_BUFFER, "
;
break
;
234
default
:
235
strm <<
int
( format.
GetImageType
() ) <<
", "
;
break
;
236
}
237
switch
(
int
( format.
GetChannelOrder
() ) )
238
{
239
case
OpenCLImageFormat::R
:
240
strm <<
"R, "
;
break
;
241
case
OpenCLImageFormat::A
:
242
strm <<
"A, "
;
break
;
243
case
OpenCLImageFormat::RG
:
244
strm <<
"RG, "
;
break
;
245
case
OpenCLImageFormat::RA
:
246
strm <<
"RA, "
;
break
;
247
case
OpenCLImageFormat::RGB
:
248
strm <<
"RGB, "
;
break
;
249
case
OpenCLImageFormat::RGBA
:
250
strm <<
"RGBA, "
;
break
;
251
case
OpenCLImageFormat::BGRA
:
252
strm <<
"BGRA, "
;
break
;
253
case
OpenCLImageFormat::ARGB
:
254
strm <<
"ARGB, "
;
break
;
255
case
OpenCLImageFormat::INTENSITY
:
256
strm <<
"INTENSITY, "
;
break
;
257
case
OpenCLImageFormat::LUMINANCE
:
258
strm <<
"LUMINANCE, "
;
break
;
259
case
OpenCLImageFormat::Rx
:
260
strm <<
"Rx, "
;
break
;
261
case
OpenCLImageFormat::RGx
:
262
strm <<
"RGx, "
;
break
;
263
case
OpenCLImageFormat::RGBx
:
264
strm <<
"RGBx, "
;
break
;
265
case
OpenCLImageFormat::DEPTH
:
266
strm <<
"DEPTH, "
;
break
;
267
case
OpenCLImageFormat::DEPTH_STENCIL
:
268
strm <<
"DEPTH_STENCIL, "
;
break
;
269
default
:
270
strm <<
int
( format.
GetChannelOrder
() ) <<
", "
;
break
;
271
}
272
switch
(
int
( format.
GetChannelType
() ) )
273
{
274
case
OpenCLImageFormat::SNORM_INT8
:
275
strm <<
"SNORM_INT8"
;
break
;
276
case
OpenCLImageFormat::SNORM_INT16
:
277
strm <<
"SNORM_INT16"
;
break
;
278
case
OpenCLImageFormat::UNORM_INT8
:
279
strm <<
"UNORM_INT8"
;
break
;
280
case
OpenCLImageFormat::UNORM_INT16
:
281
strm <<
"UNORM_INT16"
;
break
;
282
case
OpenCLImageFormat::UNORM_SHORT_565
:
283
strm <<
"UNORM_SHORT_565"
;
break
;
284
case
OpenCLImageFormat::UNORM_SHORT_555
:
285
strm <<
"UNORM_SHORT_555"
;
break
;
286
case
OpenCLImageFormat::UNORM_INT_101010
:
287
strm <<
"UNORM_INT_101010"
;
break
;
288
case
OpenCLImageFormat::SIGNED_INT8
:
289
strm <<
"SIGNED_INT8"
;
break
;
290
case
OpenCLImageFormat::SIGNED_INT16
:
291
strm <<
"SIGNED_INT16"
;
break
;
292
case
OpenCLImageFormat::SIGNED_INT32
:
293
strm <<
"SIGNED_INT32"
;
break
;
294
case
OpenCLImageFormat::UNSIGNED_INT8
:
295
strm <<
"UNSIGNED_INT8"
;
break
;
296
case
OpenCLImageFormat::UNSIGNED_INT16
:
297
strm <<
"UNSIGNED_INT16"
;
break
;
298
case
OpenCLImageFormat::UNSIGNED_INT32
:
299
strm <<
"UNSIGNED_INT32"
;
break
;
300
case
OpenCLImageFormat::HALF_FLOAT
:
301
strm <<
"HALF_FLOAT"
;
break
;
302
case
OpenCLImageFormat::FLOAT
:
303
strm <<
"FLOAT"
;
break
;
304
case
OpenCLImageFormat::UNORM_INT24
:
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 */
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:186
itk::OpenCLImageFormat::m_Format
cl_image_format m_Format
Definition:
itkOpenCLImageFormat.h:187
itk::OpenCLImageFormat::ChannelOrder
ChannelOrder
Definition:
itkOpenCLImageFormat.h:90
itk::OpenCLImageFormat::ARGB
@ ARGB
Definition:
itkOpenCLImageFormat.h:98
itk::OpenCLImageFormat::RA
@ RA
Definition:
itkOpenCLImageFormat.h:94
itk::OpenCLImageFormat::LUMINANCE
@ LUMINANCE
Definition:
itkOpenCLImageFormat.h:100
itk::OpenCLImageFormat::BGRA
@ BGRA
Definition:
itkOpenCLImageFormat.h:97
itk::OpenCLImageFormat::INTENSITY
@ INTENSITY
Definition:
itkOpenCLImageFormat.h:99
itk::OpenCLImageFormat::DEPTH_STENCIL
@ DEPTH_STENCIL
Definition:
itkOpenCLImageFormat.h:105
itk::OpenCLImageFormat::RG
@ RG
Definition:
itkOpenCLImageFormat.h:93
itk::OpenCLImageFormat::RGB
@ RGB
Definition:
itkOpenCLImageFormat.h:95
itk::OpenCLImageFormat::RGBx
@ RGBx
Definition:
itkOpenCLImageFormat.h:103
itk::OpenCLImageFormat::DEPTH
@ DEPTH
Definition:
itkOpenCLImageFormat.h:104
itk::OpenCLImageFormat::R
@ R
Definition:
itkOpenCLImageFormat.h:91
itk::OpenCLImageFormat::Rx
@ Rx
Definition:
itkOpenCLImageFormat.h:101
itk::OpenCLImageFormat::A
@ A
Definition:
itkOpenCLImageFormat.h:92
itk::OpenCLImageFormat::RGx
@ RGx
Definition:
itkOpenCLImageFormat.h:102
itk::OpenCLImageFormat::RGBA
@ RGBA
Definition:
itkOpenCLImageFormat.h:96
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:133
itk::OpenCLImageFormat::UNORM_SHORT_555
@ UNORM_SHORT_555
Definition:
itkOpenCLImageFormat.h:139
itk::OpenCLImageFormat::UNORM_SHORT_565
@ UNORM_SHORT_565
Definition:
itkOpenCLImageFormat.h:138
itk::OpenCLImageFormat::SIGNED_INT16
@ SIGNED_INT16
Definition:
itkOpenCLImageFormat.h:142
itk::OpenCLImageFormat::SIGNED_INT32
@ SIGNED_INT32
Definition:
itkOpenCLImageFormat.h:143
itk::OpenCLImageFormat::UNORM_INT24
@ UNORM_INT24
Definition:
itkOpenCLImageFormat.h:149
itk::OpenCLImageFormat::UNORM_INT_101010
@ UNORM_INT_101010
Definition:
itkOpenCLImageFormat.h:140
itk::OpenCLImageFormat::UNSIGNED_INT8
@ UNSIGNED_INT8
Definition:
itkOpenCLImageFormat.h:144
itk::OpenCLImageFormat::SNORM_INT8
@ SNORM_INT8
Definition:
itkOpenCLImageFormat.h:134
itk::OpenCLImageFormat::UNSIGNED_INT32
@ UNSIGNED_INT32
Definition:
itkOpenCLImageFormat.h:146
itk::OpenCLImageFormat::SNORM_INT16
@ SNORM_INT16
Definition:
itkOpenCLImageFormat.h:135
itk::OpenCLImageFormat::FLOAT
@ FLOAT
Definition:
itkOpenCLImageFormat.h:148
itk::OpenCLImageFormat::UNORM_INT8
@ UNORM_INT8
Definition:
itkOpenCLImageFormat.h:136
itk::OpenCLImageFormat::UNORM_INT16
@ UNORM_INT16
Definition:
itkOpenCLImageFormat.h:137
itk::OpenCLImageFormat::SIGNED_INT8
@ SIGNED_INT8
Definition:
itkOpenCLImageFormat.h:141
itk::OpenCLImageFormat::HALF_FLOAT
@ HALF_FLOAT
Definition:
itkOpenCLImageFormat.h:147
itk::OpenCLImageFormat::UNSIGNED_INT16
@ UNSIGNED_INT16
Definition:
itkOpenCLImageFormat.h:145
itk::OpenCLImageFormat::Self
OpenCLImageFormat Self
Definition:
itkOpenCLImageFormat.h:39
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:31
itkOpenCL.h
itk
Definition:
itkAdvancedImageToImageMetric.h:42
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:116
Generated on 1667476801 for elastix by
1.9.4