Image Component Library (ICL)
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
icl::utils::CLImage2D Class Reference

Wrapper for an OpenCL Image2D. More...

#include <CLImage2D.h>

Inheritance diagram for icl::utils::CLImage2D:
icl::utils::CLMemory

Public Member Functions

 CLImage2D ()
 default constructor (creates null instance) More...
 
 CLImage2D (const CLImage2D &other)
 copy constructor (always performs shallow copy) More...
 
CLImage2Doperator= (const CLImage2D &other)
 assignment operator (always performs a shallow copy) More...
 
 ~CLImage2D ()
 destructor More...
 
void read (void *dst, const utils::Rect &region=utils::Rect::null, bool block=true)
 reads image from graphics memory into given destination pointer More...
 
void write (const void *src, const utils::Rect &region=utils::Rect::null, bool block=true)
 writes source data into the graphics memory More...
 
bool isNull () const
 checks whether image is null More...
 
 operator bool () const
 checks whether image is not null More...
 
icl32s getWidth () const
 
icl32s getHeight () const
 
icl32s getChannelSize () const
 
icl32s getNumChannels () const
 
- Public Member Functions inherited from icl::utils::CLMemory
 CLMemory (CLMemory const &other)
 CLMemory default copy constructor. More...
 
CLMemoryoperator= (CLMemory const &other)
 operator = default assignment operator More...
 
virtual ~CLMemory ()
 Destructor. More...
 
CLBufferasCLBuffer ()
 asCLBuffer Casting function to cast to CLBuffer pointer (reinterpret_cast) More...
 
CLImage2DasCLImage2D ()
 asCLImage2D Casting function to cast to CLImage2D pointer (reinterpret_cast) More...
 
const std::vector< icl32sgetDimensions () const
 returns the dimensions (3Dim-std::vector for x,y,z dimensions) More...
 
const icl64s getSize () const
 returns total size of the memory (x*y*z) More...
 
const icl32s getByteDepth () const
 returns the bytedepth of the used data type (e.g. float32 = 4byte) More...
 

Private Member Functions

 CLImage2D (cl::Context &context, cl::CommandQueue &cmdQueue, const string &accessMode, const size_t width, const size_t height, int depth, int num_channel, const void *src=NULL, std::map< uint32_t, std::set< uint32_t > > const &supported_formats=std::map< uint32_t, std::set< uint32_t > >())
 private constructor (image can only be created by CLProgram instances) More...
 
cl::Image2D getImage2D ()
 provides access to the underlying cl-Image2D object More...
 
const cl::Image2D getImage2D () const
 

Private Attributes

Impl * impl
 internal hidden implementation type More...
 

Friends

class CLProgram
 for tight integration with CLProgram instances More...
 
class CLKernel
 for tight integration with CLKernel instances More...
 
class CLDeviceContext
 for tight integration with CLDeviceContext instances More...
 

Additional Inherited Members

- Public Types inherited from icl::utils::CLMemory
enum  MemoryType { Buffer, Image2D, Invalid }
 Memorys type available. More...
 
typedef SmartPtr< CLMemoryPtr
 smart pointer to this class type More...
 
- Protected Member Functions inherited from icl::utils::CLMemory
 CLMemory (MemoryType const type=Invalid)
 CLMemory Default constructor. Only inherit classes can use this constructor. More...
 
void setDimensions (icl32s const &x, icl32s const &y, icl32s const &z)
 sets the dimensions x,y,z and total size More...
 
- Protected Attributes inherited from icl::utils::CLMemory
std::vector< icl32sm_dimensions
 size of each dimension x,y,z More...
 
icl64s m_size
 size in total x*y*z More...
 
icl32s m_byte_depth
 byte depth of the data type used (e.g. float32 = 4byte) More...
 

Detailed Description

Wrapper for an OpenCL Image2D.

Valid CLImage2D instances can only be created by a CLProgram instance.

See also
CLProgram for more details

Constructor & Destructor Documentation

◆ CLImage2D() [1/3]

icl::utils::CLImage2D::CLImage2D ( cl::Context &  context,
cl::CommandQueue &  cmdQueue,
const string &  accessMode,
const size_t  width,
const size_t  height,
int  depth,
int  num_channel,
const void *  src = NULL,
std::map< uint32_t, std::set< uint32_t > > const &  supported_formats = std::map< uint32_t, std::set< uint32_t > >() 
)
private

private constructor (image can only be created by CLProgram instances)

◆ CLImage2D() [2/3]

icl::utils::CLImage2D::CLImage2D ( )

default constructor (creates null instance)

◆ CLImage2D() [3/3]

icl::utils::CLImage2D::CLImage2D ( const CLImage2D other)

copy constructor (always performs shallow copy)

◆ ~CLImage2D()

icl::utils::CLImage2D::~CLImage2D ( )

destructor

Member Function Documentation

◆ getChannelSize()

icl32s icl::utils::CLImage2D::getChannelSize ( ) const
inline

◆ getHeight()

icl32s icl::utils::CLImage2D::getHeight ( ) const
inline

◆ getImage2D() [1/2]

cl::Image2D icl::utils::CLImage2D::getImage2D ( )
private

provides access to the underlying cl-Image2D object

◆ getImage2D() [2/2]

const cl::Image2D icl::utils::CLImage2D::getImage2D ( ) const
private

◆ getNumChannels()

icl32s icl::utils::CLImage2D::getNumChannels ( ) const
inline

◆ getWidth()

icl32s icl::utils::CLImage2D::getWidth ( ) const
inline

◆ isNull()

bool icl::utils::CLImage2D::isNull ( ) const
inline

checks whether image is null

◆ operator bool()

icl::utils::CLImage2D::operator bool ( ) const
inline

checks whether image is not null

◆ operator=()

CLImage2D& icl::utils::CLImage2D::operator= ( const CLImage2D other)

assignment operator (always performs a shallow copy)

◆ read()

void icl::utils::CLImage2D::read ( void *  dst,
const utils::Rect region = utils::Rect::null,
bool  block = true 
)

reads image from graphics memory into given destination pointer

region defines the accessed image area. When no region is provided the complete image is addressed(initial width, height and (0, 0) as origin

◆ write()

void icl::utils::CLImage2D::write ( const void *  src,
const utils::Rect region = utils::Rect::null,
bool  block = true 
)

writes source data into the graphics memory

region defines the accessed image area. When no region is provided the complete image is addressed(initial width, height and (0, 0) as origin

Friends And Related Function Documentation

◆ CLDeviceContext

friend class CLDeviceContext
friend

for tight integration with CLDeviceContext instances

◆ CLKernel

friend class CLKernel
friend

for tight integration with CLKernel instances

◆ CLProgram

friend class CLProgram
friend

for tight integration with CLProgram instances

Member Data Documentation

◆ impl

Impl* icl::utils::CLImage2D::impl
private

internal hidden implementation type

internal implemetation


The documentation for this class was generated from the following file: