pub struct Image { /* private fields */ }
media
and api-level-24
only.Expand description
A native AImage *
Implementations
sourceimpl Image
impl Image
pub fn get_plane_data(&self, plane_idx: i32) -> Result<&[u8]>
pub fn get_plane_pixel_stride(&self, plane_idx: i32) -> Result<i32>
pub fn get_plane_row_stride(&self, plane_idx: i32) -> Result<i32>
pub fn get_crop_rect(&self) -> Result<CropRect>
pub fn get_width(&self) -> Result<i32>
pub fn get_height(&self) -> Result<i32>
pub fn get_format(&self) -> Result<ImageFormat>
pub fn get_timestamp(&self) -> Result<i64>
pub fn get_number_of_planes(&self) -> Result<i32>
sourcepub fn get_hardware_buffer(&self) -> Result<HardwareBuffer>
Available on crate feature api-level-26
only.
pub fn get_hardware_buffer(&self) -> Result<HardwareBuffer>
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
.
pub fn delete_async(self, release_fence_fd: RawFd)
api-level-26
only.Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Image
impl !Send for Image
impl !Sync for Image
impl Unpin for Image
impl UnwindSafe for Image
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more