Struct opencl3::memory::Image [−][src]
pub struct Image { /* fields omitted */ }
Expand description
An OpenCL image.
Has methods to return information from calls to clGetImageInfo with the
appropriate parameters.
Implements the Drop trait to call release_mem_object when the object is dropped.
Implementations
pub fn create(
context: &Context,
flags: cl_mem_flags,
image_format: *const cl_image_format,
image_desc: *const cl_image_desc,
host_ptr: *mut c_void
) -> Result<Image>
pub fn create(
context: &Context,
flags: cl_mem_flags,
image_format: *const cl_image_format,
image_desc: *const cl_image_desc,
host_ptr: *mut c_void
) -> Result<Image>
Create an OpenCL image object for a context.
context
- a valid OpenCL context.flags
- a bit-field used to specify allocation and usage information about the image memory object being created, see: Memory Flags.image_format
- a pointer to a structure that describes format properties of the image to be allocated.image_desc
- a pointer to a structure that describes type and dimensions of the image to be allocated.host_ptr
- a pointer to the image data that may already be allocated by the application.
returns a Result containing the new OpenCL image object or the error code from the OpenCL C API function.
pub fn create_from_gl_texture(
context: &Context,
flags: cl_mem_flags,
texture_target: gl_enum,
miplevel: gl_int,
texture: gl_uint
) -> Result<Image>
pub fn create_from_gl_texture(
context: &Context,
flags: cl_mem_flags,
texture_target: gl_enum,
miplevel: gl_int,
texture: gl_uint
) -> Result<Image>
Create an OpenCL image object, image array object, or image buffer object for a context from an OpenGL texture object, texture array object, texture buffer object, or a single face of an OpenGL cubemap texture object.
context
- a valid OpenCL context created from an OpenGL context.flags
- a bit-field used to specify allocation and usage information about the image memory object being created, see: Memory Flags.texture_target
- used to define the image type of texture.miplevel
- used to define the mipmap level.texture
- the name of a GL buffer texture object.
returns a Result containing the new OpenCL image object or the error code from the OpenCL C API function.
pub fn create_from_gl_render_buffer(
context: &Context,
flags: cl_mem_flags,
renderbuffer: gl_uint
) -> Result<Image>
pub fn create_from_gl_render_buffer(
context: &Context,
flags: cl_mem_flags,
renderbuffer: gl_uint
) -> Result<Image>
Create an OpenCL 2D image object from an OpenGL renderbuffer object.
context
- a valid OpenCL context created from an OpenGL context.flags
- a bit-field used to specify allocation and usage information about the image memory object being created, see: Memory Flags.renderbuffer
- a GL renderbuffer object.
returns a Result containing the new OpenCL image object or the error code from the OpenCL C API function.
pub fn create_from_gl_texture_2d(
context: &Context,
flags: cl_mem_flags,
texture_target: gl_enum,
miplevel: gl_int,
texture: gl_uint
) -> Result<Image>
pub fn create_from_gl_texture_2d(
context: &Context,
flags: cl_mem_flags,
texture_target: gl_enum,
miplevel: gl_int,
texture: gl_uint
) -> Result<Image>
Create an OpenCL 2D image object from an OpenGL 2D texture object,
or a single face of an OpenGL cubemap texture object.
Deprecated in CL_VERSION_1_2, use create_from_gl_texture.
context
- a valid OpenCL context created from an OpenGL context.flags
- a bit-field used to specify allocation and usage information about the image memory object being created, see: Memory Flags.texture_target
- used to define the image type of texture.miplevel
- used to define the mipmap level.texture
- the name of a GL 2D, cubemap or rectangle texture object.
returns a Result containing the new OpenCL image object or the error code from the OpenCL C API function.
pub fn create_from_gl_texture_3d(
context: &Context,
flags: cl_mem_flags,
texture_target: gl_enum,
miplevel: gl_int,
texture: gl_uint
) -> Result<Image>
pub fn create_from_gl_texture_3d(
context: &Context,
flags: cl_mem_flags,
texture_target: gl_enum,
miplevel: gl_int,
texture: gl_uint
) -> Result<Image>
Create an OpenCL 3D image object from an OpenGL 3D texture object.
Deprecated in CL_VERSION_1_2, use create_from_gl_texture.
context
- a valid OpenCL context created from an OpenGL context.flags
- a bit-field used to specify allocation and usage information about the image memory object being created, see: Memory Flags.texture_target
- used to define the image type of texture.miplevel
- used to define the mipmap level.texture
- the name of a GL buffer texture object.
returns a Result containing the new OpenCL image object or the error code from the OpenCL C API function.
Get data about an OpenCL image object. Calls clGetImageInfo to get the desired data about the image object.
Get information about the GL texture target associated with a memory object.
Get information about the GL mipmap level associated with a memory object.
Get information about the GL number of samples associated with a memory object.
Get GL texture information associated with a memory object.
Trait Implementations
CL_VERSION_3_0
Get memory data about an OpenCL memory object. Calls clGetMemObjectInfo to get the desired data about the memory object. Read more