Loading...
Searching...
No Matches
itkOpenCLImageFormat.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkOpenCLImageFormat_h
#define itkOpenCLImageFormat_h
#include "itkOpenCL.h"
#include <ostream>
namespace itk
{
// Forward declaration
class OpenCLContext;
class ITKOpenCL_EXPORT OpenCLImageFormat
{
public:
using Self = OpenCLImageFormat;
enum ImageType
{
BUFFER = 0x10F0,
IMAGE2D = 0x10F1,
IMAGE3D = 0x10F2,
IMAGE2D_ARRAY = 0x10F3,
IMAGE1D = 0x10F4,
IMAGE1D_ARRAY = 0x10F5,
IMAGE1D_BUFFER = 0x10F6
};
enum ChannelOrder
{
R = 0x10B0,
A = 0x10B1,
RG = 0x10B2,
RA = 0x10B3,
RGB = 0x10B4,
RGBA = 0x10B5,
BGRA = 0x10B6,
ARGB = 0x10B7,
INTENSITY = 0x10B8,
LUMINANCE = 0x10B9,
Rx = 0x10BA,
RGx = 0x10BB,
RGBx = 0x10BC,
DEPTH = 0x10BD,
DEPTH_STENCIL = 0x10BE
};
enum ChannelType
{
SNORM_INT8 = 0x10D0,
SNORM_INT16 = 0x10D1,
UNORM_INT8 = 0x10D2,
UNORM_INT16 = 0x10D3,
UNORM_SHORT_565 = 0x10D4,
UNORM_SHORT_555 = 0x10D5,
UNORM_INT_101010 = 0x10D6,
SIGNED_INT8 = 0x10D7,
SIGNED_INT16 = 0x10D8,
SIGNED_INT32 = 0x10D9,
UNSIGNED_INT8 = 0x10DA,
UNSIGNED_INT16 = 0x10DB,
UNSIGNED_INT32 = 0x10DC,
HALF_FLOAT = 0x10DD,
FLOAT = 0x10DE,
UNORM_INT24 = 0x10DF
};
OpenCLImageFormat();
OpenCLImageFormat(const OpenCLImageFormat::ChannelOrder channelOrder,
const OpenCLImageFormat::ChannelType channelType);
OpenCLImageFormat(const OpenCLImageFormat::ImageType imageType,
const OpenCLImageFormat::ChannelOrder channelOrder,
const OpenCLImageFormat::ChannelType channelType);
bool
IsNull() const;
OpenCLImageFormat::ImageType
GetImageType() const;
OpenCLImageFormat::ChannelOrder
GetChannelOrder() const;
OpenCLImageFormat::ChannelType
GetChannelType() const;
private:
cl_mem_object_type m_ImageType;
cl_image_format m_Format;
friend class OpenCLContext;
friend class OpenCLImage;
};
bool ITKOpenCL_EXPORT
operator==(const OpenCLImageFormat & lhs, const OpenCLImageFormat & rhs);
bool ITKOpenCL_EXPORT
operator!=(const OpenCLImageFormat & lhs, const OpenCLImageFormat & rhs);
template <typename charT, typename traits>
inline std::basic_ostream<charT, traits> &
operator<<(std::basic_ostream<charT, traits> & strm, const OpenCLImageFormat & format)
{
if (format.IsNull())
{
strm << "OpenCLImageFormat(null)";
return strm;
}
strm << "OpenCLImageFormat(";
switch (int(format.GetImageType()))
{
case OpenCLImageFormat::BUFFER:
strm << "BUFFER, ";
break;
case OpenCLImageFormat::IMAGE2D:
strm << "IMAGE2D, ";
break;
case OpenCLImageFormat::IMAGE3D:
strm << "IMAGE3D, ";
break;
case OpenCLImageFormat::IMAGE2D_ARRAY:
strm << "IMAGE2D_ARRAY, ";
break;
case OpenCLImageFormat::IMAGE1D:
strm << "IMAGE1D, ";
break;
case OpenCLImageFormat::IMAGE1D_ARRAY:
strm << "IMAGE1D_ARRAY, ";
break;
case OpenCLImageFormat::IMAGE1D_BUFFER:
strm << "IMAGE1D_BUFFER, ";
break;
default:
strm << int(format.GetImageType()) << ", ";
break;
}
switch (int(format.GetChannelOrder()))
{
case OpenCLImageFormat::R:
strm << "R, ";
break;
case OpenCLImageFormat::A:
strm << "A, ";
break;
case OpenCLImageFormat::RG:
strm << "RG, ";
break;
case OpenCLImageFormat::RA:
strm << "RA, ";
break;
case OpenCLImageFormat::RGB:
strm << "RGB, ";
break;
case OpenCLImageFormat::RGBA:
strm << "RGBA, ";
break;
case OpenCLImageFormat::BGRA:
strm << "BGRA, ";
break;
case OpenCLImageFormat::ARGB:
strm << "ARGB, ";
break;
case OpenCLImageFormat::INTENSITY:
strm << "INTENSITY, ";
break;
case OpenCLImageFormat::LUMINANCE:
strm << "LUMINANCE, ";
break;
case OpenCLImageFormat::Rx:
strm << "Rx, ";
break;
case OpenCLImageFormat::RGx:
strm << "RGx, ";
break;
case OpenCLImageFormat::RGBx:
strm << "RGBx, ";
break;
case OpenCLImageFormat::DEPTH:
strm << "DEPTH, ";
break;
case OpenCLImageFormat::DEPTH_STENCIL:
strm << "DEPTH_STENCIL, ";
break;
default:
strm << int(format.GetChannelOrder()) << ", ";
break;
}
switch (int(format.GetChannelType()))
{
case OpenCLImageFormat::SNORM_INT8:
strm << "SNORM_INT8";
break;
case OpenCLImageFormat::SNORM_INT16:
strm << "SNORM_INT16";
break;
case OpenCLImageFormat::UNORM_INT8:
strm << "UNORM_INT8";
break;
case OpenCLImageFormat::UNORM_INT16:
strm << "UNORM_INT16";
break;
case OpenCLImageFormat::UNORM_SHORT_565:
strm << "UNORM_SHORT_565";
break;
case OpenCLImageFormat::UNORM_SHORT_555:
strm << "UNORM_SHORT_555";
break;
case OpenCLImageFormat::UNORM_INT_101010:
strm << "UNORM_INT_101010";
break;
case OpenCLImageFormat::SIGNED_INT8:
strm << "SIGNED_INT8";
break;
case OpenCLImageFormat::SIGNED_INT16:
strm << "SIGNED_INT16";
break;
case OpenCLImageFormat::SIGNED_INT32:
strm << "SIGNED_INT32";
break;
case OpenCLImageFormat::UNSIGNED_INT8:
strm << "UNSIGNED_INT8";
break;
case OpenCLImageFormat::UNSIGNED_INT16:
strm << "UNSIGNED_INT16";
break;
case OpenCLImageFormat::UNSIGNED_INT32:
strm << "UNSIGNED_INT32";
break;
case OpenCLImageFormat::HALF_FLOAT:
strm << "HALF_FLOAT";
break;
case OpenCLImageFormat::FLOAT:
strm << "FLOAT";
break;
case OpenCLImageFormat::UNORM_INT24:
strm << "UNORM_INT24";
break;
default:
strm << int(format.GetChannelType());
break;
}
strm << ')' << std::endl;
return strm;
}
} // end namespace itk
#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::OpenCLImage
friend class OpenCLImage
Definition itkOpenCLImageFormat.h:194
itk::OpenCLImageFormat::OpenCLContext
friend class OpenCLContext
Definition itkOpenCLImageFormat.h:193
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::OpenCLImageFormat::Self
OpenCLImageFormat Self
Definition itkOpenCLImageFormat.h:38
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 1768596610 for elastix by 1.15.0 |