pub struct Image { /* private fields */ }
Available on crate features media and api-level-24 only.
Expand description

A native AImage *

Implementations

Available on crate feature api-level-26 only.

Get the hardware buffer handle of the input image intended for GPU and/or hardware access.

Note that no reference on the returned HardwareBuffer handle is acquired automatically. Once the Image or the parent ImageReader is deleted, the HardwareBuffer handle from previous Image::get_hardware_buffer() becomes invalid.

If the caller ever needs to hold on a reference to the HardwareBuffer handle after the Image or the parent ImageReader is deleted, it must call HardwareBuffer::acquire() to acquire an extra reference, and drop() it when finished using it in order to properly deallocate the underlying memory managed by HardwareBuffer. If the caller has acquired an extra reference on a HardwareBuffer returned from this function, it must also register a listener using ImageReader::set_buffer_removed_listener() to be notified when the buffer is no longer used by ImageReader.

Available on crate feature api-level-26 only.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.