30 #ifndef _CCL_IMAGE_WRAPPER_H_
31 #define _CCL_IMAGE_WRAPPER_H_
120 #define CCL_IMAGE_DESC_BLANK {0, 0, 0, 0, 0, 0, 0, 0, 0, NULL}
213 const cl_image_format* image_format,
const CCLImageDesc* img_dsc,
214 void* host_ptr,
CCLErr** err);
220 const cl_image_format* image_format,
void* host_ptr,
CCLErr** err,
226 cl_bool blocking_read,
const size_t* origin,
const size_t* region,
227 size_t row_pitch,
size_t slice_pitch,
void *ptr,
233 cl_bool blocking_read,
const size_t* origin,
const size_t* region,
234 size_t input_row_pitch,
size_t input_slice_pitch,
void *ptr,
241 CCLQueue* cq,
const size_t* src_origin,
const size_t* dst_origin,
248 const size_t *region,
size_t dst_offset,
255 cl_bool blocking_map, cl_map_flags map_flags,
const size_t* origin,
256 const size_t* region,
size_t *image_row_pitch,
264 const void *fill_color,
const size_t *origin,
const size_t *region,
283 #define ccl_image_enqueue_unmap(img, cq, ptr, ewl, err) \
284 ccl_memobj_enqueue_unmap((CCLMemObj*) img, cq, ptr, ewl, err)
297 #define ccl_image_get_info(img, param_name, err) \
298 ccl_wrapper_get_info((CCLWrapper*) img, NULL, param_name, 0, \
299 CCL_INFO_IMAGE, CL_FALSE, err)
317 #define ccl_image_get_info_scalar(img, param_name, param_type, err) \
318 *((param_type*) ccl_wrapper_get_info_value((CCLWrapper*) img, \
319 NULL, param_name, sizeof(param_type), CCL_INFO_IMAGE, CL_FALSE, err))
337 #define ccl_image_get_info_array(img, param_name, param_type, err) \
338 (param_type) ccl_wrapper_get_info_value((CCLWrapper*) img, \
339 NULL, param_name, sizeof(param_type), CCL_INFO_IMAGE, CL_FALSE, err)
346 #define ccl_image_ref(img) \
347 ccl_wrapper_ref((CCLWrapper*) img)
355 #define ccl_image_unref(img) ccl_image_destroy(img)
363 #define ccl_image_unwrap(img) \
364 ((cl_mem) ccl_wrapper_unwrap((CCLWrapper*) img))
size_t image_height
Height of the image in pixels.
void * ccl_image_enqueue_map(CCLImage *img, CCLQueue *cq, cl_bool blocking_map, cl_map_flags map_flags, const size_t *origin, const size_t *region, size_t *image_row_pitch, size_t *image_slice_pitch, CCLEventWaitList *evt_wait_lst, CCLEvent **evt, CCLErr **err)
Map a region of the image into the host address space and return a pointer to this mapped region...
size_t image_array_size
Number of images in the image array.
size_t image_width
Width of the image in pixels.
CCLImage * ccl_image_new_v(CCLContext *ctx, cl_mem_flags flags, const cl_image_format *image_format, const CCLImageDesc *img_dsc, void *host_ptr, CCLErr **err)
Creates a new image wrapper object.
GPtrArray * CCLEventWaitList
A list of event objects on which enqueued commands can wait.
CCLEvent * ccl_image_enqueue_copy_to_buffer(CCLImage *src_img, CCLBuffer *dst_buf, CCLQueue *cq, const size_t *src_origin, const size_t *region, size_t dst_offset, CCLEventWaitList *evt_wait_lst, CCLErr **err)
Copy an image object to a buffer object.
The context wrapper class.
CCLEvent * ccl_image_enqueue_write(CCLImage *img, CCLQueue *cq, cl_bool blocking_write, const size_t *origin, const size_t *region, size_t input_row_pitch, size_t input_slice_pitch, void *ptr, CCLEventWaitList *evt_wait_lst, CCLErr **err)
Write to an image or image array object from host memory.
Base class for memory object wrappers, i.e., CCLBuffer and CCLImage.
Command queue wrapper class.
Describes the type and dimensions of the image or image array independently of the OpenCL version...
void ccl_image_destroy(CCLImage *img)
Decrements the reference count of the wrapper object.
CCLEvent * ccl_image_enqueue_read(CCLImage *img, CCLQueue *cq, cl_bool blocking_read, const size_t *origin, const size_t *region, size_t row_pitch, size_t slice_pitch, void *ptr, CCLEventWaitList *evt_wait_lst, CCLErr **err)
Read from an image or image array object to host memory.
size_t image_depth
Depth of the image in pixels.
size_t image_row_pitch
Scan-line pitch in bytes.
size_t image_slice_pitch
Size in bytes of each 2D slice in the 3D image or the size in bytes of each image in a 1D or 2D image...
CCLEvent * ccl_image_enqueue_copy(CCLImage *src_img, CCLImage *dst_img, CCLQueue *cq, const size_t *src_origin, const size_t *dst_origin, const size_t *region, CCLEventWaitList *evt_wait_lst, CCLErr **err)
Copy image objects.
CCLEvent * ccl_image_enqueue_fill(CCLImage *img, CCLQueue *cq, const void *fill_color, const size_t *origin, const size_t *region, CCLEventWaitList *evt_wait_lst, CCLErr **err)
Fill an image object with a specified color.
CCLImage * ccl_image_new(CCLContext *ctx, cl_mem_flags flags, const cl_image_format *image_format, void *host_ptr, CCLErr **err,...)
Creates a new image wrapper object using a variable list of key-value pairs which describe the image...
struct ccl_image_desc CCLImageDesc
Describes the type and dimensions of the image or image array independently of the OpenCL version...
cl_uint num_mip_levels
Unused up to OpenCL 2.0.
cl_mem_object_type image_type
The type of image, must be supported by the underlying OpenCL version.
GError CCLErr
Error handling class.
Definition of a wrapper class and its methods for OpenCL memory objects.
CCLImage * ccl_image_new_wrap(cl_mem mem_object)
Get the image wrapper for the given OpenCL image.
cl_uint num_samples
Unused up to OpenCL 2.0.
CCLMemObj * memobj
A memory object wrapper.