#include <itkOpenCLImage.h>
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.
Public Types | |
using | Self = OpenCLImage |
using | Superclass = OpenCLMemoryObject |
Public Types inherited from itk::OpenCLMemoryObject | |
enum | Access { ReadWrite = 0x0001 , WriteOnly = 0x0002 , ReadOnly = 0x0004 } |
using | PointType = Point<std::vcl_size_t, 2> |
using | RectangleType = Size<4> |
using | Self = OpenCLMemoryObject |
using | SizeType = Size<2> |
Public Member Functions | |
bool | Copy (const OpenCLBuffer &dest, const OpenCLSize &origin, const OpenCLSize ®ion, const std::vcl_size_t dst_offset=0) |
bool | Copy (const OpenCLImage &dest, const OpenCLSize &origin, const OpenCLSize ®ion, const OpenCLSize &destOrigin) |
OpenCLEvent | CopyAsync (const OpenCLBuffer &dest, const OpenCLSize &origin, const OpenCLSize ®ion, const OpenCLEventList &event_list=OpenCLEventList(), const std::vcl_size_t dst_offset=0) |
OpenCLEvent | CopyAsync (const OpenCLImage &dest, const OpenCLSize &origin, const OpenCLSize ®ion, 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 ®ion, 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 ®ion, const OpenCLEventList &event_list=OpenCLEventList(), std::vcl_size_t *rowPitch=0, std::vcl_size_t *slicePitch=0) |
OpenCLImage ()=default | |
OpenCLImage (const OpenCLImage &other) | |
OpenCLImage (OpenCLContext *context, const cl_mem id) | |
OpenCLImage & | operator= (const OpenCLImage &other) |
bool | Read (void *data, const OpenCLSize &origin, const OpenCLSize ®ion, const std::vcl_size_t rowPitch=0, const std::vcl_size_t slicePitch=0) |
OpenCLEvent | ReadAsync (void *data, const OpenCLSize &origin, const OpenCLSize ®ion, 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 ®ion, const std::vcl_size_t rowPitch=0, const std::vcl_size_t slicePitch=0) |
OpenCLEvent | WriteAsync (const void *data, const OpenCLSize &origin, const OpenCLSize ®ion, 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 |
OpenCLContext * | GetContext () 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 ®ion) const |
void | SetSize (std::vcl_size_t *region_t, const OpenCLSize ®ion, 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 |
using itk::OpenCLImage::Self = OpenCLImage |
Standard class typedefs.
Definition at line 42 of file itkOpenCLImage.h.
Definition at line 43 of file itkOpenCLImage.h.
|
default |
Constructs a null OpenCL image object.
|
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 52 of file itkOpenCLImage.h.
itk::OpenCLImage::OpenCLImage | ( | const OpenCLImage & | other | ) |
Constructs a copy of other.
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().
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().
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.
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.
std::vcl_size_t itk::OpenCLImage::GetDepth | ( | ) | const |
Return depth of the image in pixels.
std::vcl_size_t itk::OpenCLImage::GetDimension | ( | ) | const |
Returns the dimension for this image, 1, 2, or 3.
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.
OpenCLImageFormat itk::OpenCLImage::GetFormat | ( | ) | const |
Return image format descriptor specified when image is created.
std::vcl_size_t itk::OpenCLImage::GetHeight | ( | ) | const |
Return height of image in pixels.
|
protected |
Get information specific to an image object created with clCreateImage
std::vcl_size_t itk::OpenCLImage::GetRowSizeInBytes | ( | ) | const |
Return size in bytes of a row of elements of the image object given by image.
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.
std::vcl_size_t itk::OpenCLImage::GetWidth | ( | ) | const |
Return width of image in pixels.
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.
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.
OpenCLImage & itk::OpenCLImage::operator= | ( | const OpenCLImage & | other | ) |
Assigns other to this object.
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.
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.
|
protected |
Set the image origin information
|
protected |
Set the image region information
|
protected |
Set the image size information
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.
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.
|
friend |
friends from OpenCL core
Definition at line 258 of file itkOpenCLImage.h.
Generated on 2024-07-17 for elastix by 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) |