go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Public Types | Public Member Functions | Protected Member Functions | Friends
itk::OpenCLImage Class Reference

#include <itkOpenCLImage.h>

Detailed Description

The OpenCLImage class represents an image object is used to store a one, two or three dimensional texture, frame-buffer or image.

Definition at line 38 of file itkOpenCLImage.h.

+ Inheritance diagram for itk::OpenCLImage:

Public Types

typedef OpenCLImage Self
 
typedef OpenCLMemoryObject Superclass
 
- Public Types inherited from itk::OpenCLMemoryObject
enum  Access { ReadWrite = 0x0001 , WriteOnly = 0x0002 , ReadOnly = 0x0004 }
 
typedef Point< std::vcl_size_t, 2 > PointType
 
typedef Size< 4 > RectangleType
 
typedef OpenCLMemoryObject Self
 
typedef Size< 2 > SizeType
 

Public Member Functions

bool Copy (const OpenCLBuffer &dest, const OpenCLSize &origin, const OpenCLSize &region, const std::vcl_size_t dst_offset=0)
 
bool Copy (const OpenCLImage &dest, const OpenCLSize &origin, const OpenCLSize &region, const OpenCLSize &destOrigin)
 
OpenCLEvent CopyAsync (const OpenCLBuffer &dest, const OpenCLSize &origin, const OpenCLSize &region, const OpenCLEventList &event_list=OpenCLEventList(), const std::vcl_size_t dst_offset=0)
 
OpenCLEvent CopyAsync (const OpenCLImage &dest, const OpenCLSize &origin, const OpenCLSize &region, const OpenCLSize &destOrigin, const OpenCLEventList &event_list=OpenCLEventList())
 
std::vcl_size_t GetDepth () const
 
std::vcl_size_t GetDimension () const
 
std::vcl_size_t GetElementSizeInBytes () const
 
OpenCLImageFormat GetFormat () const
 
std::vcl_size_t GetHeight () const
 
std::vcl_size_t GetRowSizeInBytes () const
 
std::vcl_size_t GetSliceSizeInBytes () const
 
std::vcl_size_t GetWidth () const
 
void * Map (const OpenCLMemoryObject::Access access, const OpenCLSize &origin, const OpenCLSize &region, std::vcl_size_t *rowPitch=0, std::vcl_size_t *slicePitch=0)
 
OpenCLEvent MapAsync (void **data, const OpenCLMemoryObject::Access access, const OpenCLSize &origin, const OpenCLSize &region, const OpenCLEventList &event_list=OpenCLEventList(), std::vcl_size_t *rowPitch=0, std::vcl_size_t *slicePitch=0)
 
 OpenCLImage ()
 
 OpenCLImage (const OpenCLImage &other)
 
 OpenCLImage (OpenCLContext *context, const cl_mem id)
 
OpenCLImageoperator= (const OpenCLImage &other)
 
bool Read (void *data, const OpenCLSize &origin, const OpenCLSize &region, const std::vcl_size_t rowPitch=0, const std::vcl_size_t slicePitch=0)
 
OpenCLEvent ReadAsync (void *data, const OpenCLSize &origin, const OpenCLSize &region, const OpenCLEventList &event_list=OpenCLEventList(), const std::vcl_size_t rowPitch=0, const std::vcl_size_t slicePitch=0)
 
bool Write (const void *data, const OpenCLSize &origin, const OpenCLSize &region, const std::vcl_size_t rowPitch=0, const std::vcl_size_t slicePitch=0)
 
OpenCLEvent WriteAsync (const void *data, const OpenCLSize &origin, const OpenCLSize &region, const OpenCLEventList &event_list=OpenCLEventList(), const std::vcl_size_t rowPitch=0, const std::vcl_size_t slicePitch=0)
 
- Public Member Functions inherited from itk::OpenCLMemoryObject
OpenCLMemoryObject::Access GetAccess () const
 
OpenCLContextGetContext () const
 
cl_mem_flags GetFlags () const
 
void * GetHostPointer () const
 
cl_uint GetMapCount () const
 
cl_mem GetMemoryId () const
 
cl_mem_object_type GetMemoryType () const
 
cl_uint GetReferenceCount () const
 
std::vcl_size_t GetSize () const
 
bool IsNull () const
 
cl_int SetDestructorCallback (void(CL_CALLBACK *pfn_notify)(cl_mem, void *), void *user_data=nullptr)
 
void Unmap (void *ptr, const bool wait=false)
 
OpenCLEvent UnmapAsync (void *ptr, const OpenCLEventList &event_list=OpenCLEventList())
 

Protected Member Functions

std::vcl_size_t GetImageInfo (const cl_image_info name) const
 
void SetOrigin (std::vcl_size_t *origin_t, const OpenCLSize &origin) const
 
void SetRegion (std::vcl_size_t *region_t, const OpenCLSize &region) const
 
void SetSize (std::vcl_size_t *region_t, const OpenCLSize &region, const std::vcl_size_t value) const
 
- Protected Member Functions inherited from itk::OpenCLMemoryObject
cl_map_flags GetMapFlags (const OpenCLMemoryObject::Access access)
 
 OpenCLMemoryObject (OpenCLContext *context, const cl_mem id)
 
 OpenCLMemoryObject (OpenCLContext *context=0)
 
void SetId (OpenCLContext *context, const cl_mem id)
 
 ~OpenCLMemoryObject ()
 

Friends

class OpenCLBuffer
 

Member Typedef Documentation

◆ Self

Standard class typedefs.

Definition at line 43 of file itkOpenCLImage.h.

◆ Superclass

Definition at line 44 of file itkOpenCLImage.h.

Constructor & Destructor Documentation

◆ OpenCLImage() [1/3]

itk::OpenCLImage::OpenCLImage ( )
inline

Constructs a null OpenCL image object.

Definition at line 47 of file itkOpenCLImage.h.

◆ OpenCLImage() [2/3]

itk::OpenCLImage::OpenCLImage ( OpenCLContext context,
const cl_mem  id 
)
inline

Constructs a OpenCL image object that is initialized with the native OpenCL identifier id, and associates it with context. This class will take over ownership of id and will release it in the destructor.

Definition at line 53 of file itkOpenCLImage.h.

◆ OpenCLImage() [3/3]

itk::OpenCLImage::OpenCLImage ( const OpenCLImage other)

Constructs a copy of other.

Member Function Documentation

◆ Copy() [1/2]

bool itk::OpenCLImage::Copy ( const OpenCLBuffer dest,
const OpenCLSize origin,
const OpenCLSize region,
const std::vcl_size_t  dst_offset = 0 
)

Copies a region of an image object starting at origin and range region to destOrigin in dest. Returns true if the copy was successful, false otherwise. This function will block until the request finishes. The request is executed on the active command queue for context().

See also
CopyAsync()

◆ Copy() [2/2]

bool itk::OpenCLImage::Copy ( const OpenCLImage dest,
const OpenCLSize origin,
const OpenCLSize region,
const OpenCLSize destOrigin 
)

Copies a region of an image object starting at origin and range region to destOrigin in dest. Returns true if the copy was successful, false otherwise. This function will block until the request finishes. The request is executed on the active command queue for context().

See also
CopyAsync()

◆ CopyAsync() [1/2]

OpenCLEvent itk::OpenCLImage::CopyAsync ( const OpenCLBuffer dest,
const OpenCLSize origin,
const OpenCLSize region,
const OpenCLEventList event_list = OpenCLEventList(),
const std::vcl_size_t  dst_offset = 0 
)

Asynchronous version of the Copy() method. This function will queue the request and return immediately. Returns an OpenCLEvent object that can be used to wait for the request to finish. The request will not start until all of the events in event_list have been signaled as completed.

See also
Copy()

◆ CopyAsync() [2/2]

OpenCLEvent itk::OpenCLImage::CopyAsync ( const OpenCLImage dest,
const OpenCLSize origin,
const OpenCLSize region,
const OpenCLSize destOrigin,
const OpenCLEventList event_list = OpenCLEventList() 
)

Asynchronous version of the Copy() method. This function will queue the request and return immediately. Returns an OpenCLEvent object that can be used to wait for the request to finish. The request will not start until all of the events in event_list have been signaled as completed.

See also
Copy()

◆ GetDepth()

std::vcl_size_t itk::OpenCLImage::GetDepth ( ) const

Return depth of the image in pixels.

Note
For a 1D image, 1D image buffer, 2D image or 1D and 2D image array object, depth = 0
See also
GetWidth(), GetHeight()

◆ GetDimension()

std::vcl_size_t itk::OpenCLImage::GetDimension ( ) const

Returns the dimension for this image, 1, 2, or 3.

◆ GetElementSizeInBytes()

std::vcl_size_t itk::OpenCLImage::GetElementSizeInBytes ( ) const

Return size of each element of the image memory object given by image. An element is made up of n channels. The value of n is given in cl_image_format descriptor.

◆ GetFormat()

OpenCLImageFormat itk::OpenCLImage::GetFormat ( ) const

Return image format descriptor specified when image is created.

◆ GetHeight()

std::vcl_size_t itk::OpenCLImage::GetHeight ( ) const

Return height of image in pixels.

Note
For a 1D image, 1D image buffer and 1D image array object, height = 0.
See also
GetWidth(), GetDepth()

◆ GetImageInfo()

std::vcl_size_t itk::OpenCLImage::GetImageInfo ( const cl_image_info  name) const
protected

Get information specific to an image object created with clCreateImage

◆ GetRowSizeInBytes()

std::vcl_size_t itk::OpenCLImage::GetRowSizeInBytes ( ) const

Return size in bytes of a row of elements of the image object given by image.

◆ GetSliceSizeInBytes()

std::vcl_size_t itk::OpenCLImage::GetSliceSizeInBytes ( ) const

Return calculated slice pitch in bytes of a 2D slice for the 3D image object or size of each image in a 1D or 2D image array given by image.

Note
For a 1D image, 1D image buffer and 2D image object return 0.

◆ GetWidth()

std::vcl_size_t itk::OpenCLImage::GetWidth ( ) const

Return width of image in pixels.

See also
GetHeight(), GetDepth()

◆ Map()

void * itk::OpenCLImage::Map ( const OpenCLMemoryObject::Access  access,
const OpenCLSize origin,
const OpenCLSize region,
std::vcl_size_t *  rowPitch = 0,
std::vcl_size_t *  slicePitch = 0 
)

Map a region of an image object starting at origin and range region into the host address space for the specified access mode and returns a pointer to this mapped region. This method does not return until the specified region in image is mapped into the host address space and the application can access the contents of the mapped region.

See also
Read(), ReadAsync(), Write(), WriteAsync(), MapAsync()

◆ MapAsync()

OpenCLEvent itk::OpenCLImage::MapAsync ( void **  data,
const OpenCLMemoryObject::Access  access,
const OpenCLSize origin,
const OpenCLSize region,
const OpenCLEventList event_list = OpenCLEventList(),
std::vcl_size_t *  rowPitch = 0,
std::vcl_size_t *  slicePitch = 0 
)

Asynchronous version of the Map() method. This function will queue the request and return immediately. Returns an OpenCLEvent object that can be used to wait for the request to finish. The request will not start until all of the events in event_list have been signaled as completed.

See also
Read(), ReadAsync(), Write(), WriteAsync(), Map()

◆ operator=()

OpenCLImage & itk::OpenCLImage::operator= ( const OpenCLImage other)

Assigns other to this object.

◆ Read()

bool itk::OpenCLImage::Read ( void *  data,
const OpenCLSize origin,
const OpenCLSize region,
const std::vcl_size_t  rowPitch = 0,
const std::vcl_size_t  slicePitch = 0 
)

Reads from an image or image array object to host memory, starting at origin and range region into data. Returns true if the read was successful, false otherwise. This method does not return until the buffer data has been read into memory pointed to data.

See also
ReadAsync(), Write(), WriteAsync()

◆ ReadAsync()

OpenCLEvent itk::OpenCLImage::ReadAsync ( void *  data,
const OpenCLSize origin,
const OpenCLSize region,
const OpenCLEventList event_list = OpenCLEventList(),
const std::vcl_size_t  rowPitch = 0,
const std::vcl_size_t  slicePitch = 0 
)

Asynchronous version of the Read() method. This function will queue the request and return immediately. Returns an OpenCLEvent object that can be used to wait for the request to finish. The request will not start until all of the events in event_list have been signaled as completed.

See also
Read(), Write(), WriteAsync()

◆ SetOrigin()

void itk::OpenCLImage::SetOrigin ( std::vcl_size_t *  origin_t,
const OpenCLSize origin 
) const
protected

Set the image origin information

◆ SetRegion()

void itk::OpenCLImage::SetRegion ( std::vcl_size_t *  region_t,
const OpenCLSize region 
) const
protected

Set the image region information

◆ SetSize()

void itk::OpenCLImage::SetSize ( std::vcl_size_t *  region_t,
const OpenCLSize region,
const std::vcl_size_t  value 
) const
protected

Set the image size information

◆ Write()

bool itk::OpenCLImage::Write ( const void *  data,
const OpenCLSize origin,
const OpenCLSize region,
const std::vcl_size_t  rowPitch = 0,
const std::vcl_size_t  slicePitch = 0 
)

Write an image or image array object from host memory, starting at origin and range region into data. Returns true if the read was successful, false otherwise. This method does not return until the buffer data has been written into memory pointed to data.

See also
Read(), ReadAsync(), WriteAsync()

◆ WriteAsync()

OpenCLEvent itk::OpenCLImage::WriteAsync ( const void *  data,
const OpenCLSize origin,
const OpenCLSize region,
const OpenCLEventList event_list = OpenCLEventList(),
const std::vcl_size_t  rowPitch = 0,
const std::vcl_size_t  slicePitch = 0 
)

Asynchronous version of the Write() method. This function will queue the request and return immediately. Returns an OpenCLEvent object that can be used to wait for the request to finish. The request will not start until all of the events in event_list have been signaled as completed.

See also
Read(), ReadAsync(), Write()

Friends And Related Function Documentation

◆ OpenCLBuffer

friend class OpenCLBuffer
friend

friends from OpenCL core

Definition at line 223 of file itkOpenCLImage.h.



Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo