# Struct ocl::Image [−] [src]

    pub struct Image<T: OclPrm> { /* fields omitted */ }

A section of device memory which represents one or many images.

Use `::builder` for an easy way to create. [UNIMPLEMENTED]

## Methods

### `impl<T: OclPrm> Image<T>`
[src]

#### `pub fn supported_formats(
context: &Context,
flags: MemFlags,
mem_obj_type: MemObjectType
) -> OclCoreResult<Vec<ImageFormatParseResult>>`
[src]

Returns a list of supported image formats.

#### `pub fn builder<'a>() -> ImageBuilder<'a, T>`
[src]

Returns an `ImageBuilder`. This is the recommended method to create a new `Image`.

#### `pub unsafe fn new<'o, Q>(
que_ctx: Q,
flags: MemFlags,
image_format: ImageFormat,
image_desc: ImageDescriptor,
host_data: Option<&[T]>
) -> OclCoreResult<Image<T>> where
Q: Into<QueCtx<'o>>,`
[src]

Returns a new `Image`.

Prefer `::builder` to create a new image.

#### `pub fn from_gl_texture<'o, Q>(
que_ctx: Q,
flags: MemFlags,
image_desc: ImageDescriptor,
texture_target: GlTextureTarget,
miplevel: cl_GLint,
texture: cl_GLuint
) -> OclCoreResult<Image<T>> where
Q: Into<QueCtx<'o>>,`
[src]

Returns a new `Image` from an existant GL texture2D/3D.

#### `pub fn from_gl_renderbuffer<'o, Q>(
que_ctx: Q,
flags: MemFlags,
image_desc: ImageDescriptor,
renderbuffer: cl_GLuint
) -> OclCoreResult<Image<T>> where
Q: Into<QueCtx<'o>>,`
[src]

Returns a new `Image` from an existant renderbuffer.

#### `pub fn cmd(&self) -> ImageCmd<T>`
[src]

Returns an image command builder used to read, write, copy, etc.

Call `.enq()` to enqueue the command.

See the command builder documentation for more details.

#### `pub fn read<'c, 'd>(&'c self, data: &'d mut [T]) -> ImageCmd<'c, T> where
'd: 'c,`
[src]

Returns an image command builder set to read.

Call `.enq()` to enqueue the command.

See the command builder documentation for more details.

#### `pub fn write<'c, 'd>(&'c self, data: &'d [T]) -> ImageCmd<'c, T> where
'd: 'c,`
[src]

Returns an image command builder set to write.

Call `.enq()` to enqueue the command.

See the command builder documentation for more details.

#### `pub unsafe fn map<'c>(&'c self) -> ImageMapCmd<'c, T>`
[src]

Returns a command builder used to map data for reading or writing.

Call `.enq()` to enqueue the command.

## Safety

The caller must ensure that only one mapping of a particular memory region exists at a time.

See the command builder documentation for more details.

#### `pub fn set_default_queue<'a>(&'a mut self, queue: Queue) -> &'a mut Image<T>`
[src]

Changes the default queue.

Returns a ref for chaining i.e.:

`image.set_default_queue(queue).write(....);`

[NOTE]: Even when used as above, the queue is changed permanently, not just for the one call. Changing the queue is cheap so feel free to change as often as needed.

The new queue must be associated with a valid device.

#### `pub fn default_queue(&self) -> Option<&Queue>`
[src]

Returns a reference to the default queue.

#### `pub fn dims(&self) -> &SpatialDims`
[src]

Returns this image's dimensions.

#### `pub fn pixel_count(&self) -> usize`
[src]

Returns the total number of pixels in this image.

#### `pub fn pixel_element_len(&self) -> usize`
[src]

Returns the length of each pixel element.

#### `pub fn element_count(&self) -> usize`
[src]

Returns the total number of pixel elements in this image. Equivalent to its length.

#### `pub fn info(&self, info_kind: ImageInfo) -> OclCoreResult<ImageInfoResult>`
[src]

Get information about this image.

#### `pub fn mem_info(&self, info_kind: MemInfo) -> OclCoreResult<MemInfoResult>`
[src]

Returns info about this image's memory.

#### `pub fn as_core(&self) -> &MemCore`
[src]

Returns a reference to the core pointer wrapper, usable by functions in the `core` module.

## Methods from Deref<Target = MemCore>

#### `pub fn as_ptr(&self) -> *mut c_void`
[src]

Returns a pointer, do not store it.

## Trait Implementations

### `impl<T: Clone + OclPrm> Clone for Image<T>`
[src]

#### `fn clone(&self) -> Image<T>`
[src]

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`
1.0.0
[src]

Performs copy-assignment from `source`. Read more

### `impl<T: Debug + OclPrm> Debug for Image<T>`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`
[src]

Formats the value using the given formatter. Read more

### `impl<T: OclPrm> Display for Image<T>`
[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`
[src]

Formats the value using the given formatter. Read more

### `impl<T: OclPrm> Deref for Image<T>`
[src]

#### `type Target = MemCore`

The resulting type after dereferencing.

#### `fn deref(&self) -> &MemCore`
[src]

Dereferences the value.

### `impl<T: OclPrm> DerefMut for Image<T>`
[src]

#### `fn deref_mut(&mut self) -> &mut MemCore`
[src]

Mutably dereferences the value.

### `impl<T: OclPrm> AsMem<T> for Image<T>`
[src]

#### `fn as_mem(&self) -> &MemCore`
[src]

### `impl<'a, T> MemCmdRw for Image<T> where
T: OclPrm,`
[src]

### `impl<'a, T> MemCmdRw for &'a Image<T> where
T: OclPrm,`
[src]

### `impl<'a, T> MemCmdRw for &'a mut Image<T> where
T: OclPrm,`
[src]

### `impl<'a, T> MemCmdAll for Image<T> where
T: OclPrm,`
[src]

### `impl<'a, T> MemCmdAll for &'a Image<T> where
T: OclPrm,`
[src]

### `impl<'a, T> MemCmdAll for &'a mut Image<T> where
T: OclPrm,`
[src]

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)