Struct ndk::native_window::NativeWindowBufferLockGuard
source · pub struct NativeWindowBufferLockGuard<'a> { /* private fields */ }
Expand description
Lock holding the next drawing surface for writing. It is unlocked and posted on drop()
.
Implementations§
source§impl<'a> NativeWindowBufferLockGuard<'a>
impl<'a> NativeWindowBufferLockGuard<'a>
pub fn height(&self) -> usize
sourcepub fn stride(&self) -> usize
pub fn stride(&self) -> usize
The number of pixels that a line in the buffer takes in memory.
This may be >= width
.
sourcepub fn format(&self) -> HardwareBufferFormat
pub fn format(&self) -> HardwareBufferFormat
The format of the buffer. One of HardwareBufferFormat
.
sourcepub fn bytes(&mut self) -> Option<&mut [MaybeUninit<u8>]>
pub fn bytes(&mut self) -> Option<&mut [MaybeUninit<u8>]>
Safe write access to likely uninitialized pixel buffer data.
Returns None
when there is no HardwareBufferFormat::bytes_per_pixel()
size
available for this format()
.
The returned slice consists of stride()
* height()
* HardwareBufferFormat::bytes_per_pixel()
bytes.
Only width()
pixels are visible for each stride()
line of pixels in the buffer.
Trait Implementations§
source§impl<'a> Debug for NativeWindowBufferLockGuard<'a>
impl<'a> Debug for NativeWindowBufferLockGuard<'a>
Auto Trait Implementations§
impl<'a> Freeze for NativeWindowBufferLockGuard<'a>
impl<'a> RefUnwindSafe for NativeWindowBufferLockGuard<'a>
impl<'a> !Send for NativeWindowBufferLockGuard<'a>
impl<'a> !Sync for NativeWindowBufferLockGuard<'a>
impl<'a> Unpin for NativeWindowBufferLockGuard<'a>
impl<'a> UnwindSafe for NativeWindowBufferLockGuard<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more