Struct ndk::bitmap::AndroidBitmap
source · [−]pub struct AndroidBitmap { /* private fields */ }
Available on crate feature
bitmap
only.Expand description
An immediate wrapper over android.graphics.Bitmap
Implementations
sourceimpl AndroidBitmap
impl AndroidBitmap
sourcepub unsafe fn from_jni(env: *mut JNIEnv, bitmap: jobject) -> Self
pub unsafe fn from_jni(env: *mut JNIEnv, bitmap: jobject) -> Self
Create an AndroidBitmap
wrapper from JNI pointers
Safety
This function should be called with a healthy JVM pointer and with a non-null
android.graphics.Bitmap
, which must be kept alive on the Java/Kotlin side.
pub fn get_info(&self) -> BitmapResult<AndroidBitmapInfo>
pub fn lock_pixels(&self) -> BitmapResult<*mut c_void>
pub fn unlock_pixels(&self) -> BitmapResult<()>
sourcepub fn get_hardware_buffer(&self) -> BitmapResult<HardwareBufferRef>
Available on crate feature api-level-30
only.
pub fn get_hardware_buffer(&self) -> BitmapResult<HardwareBufferRef>
api-level-30
only.Retrieve the native object associated with a HARDWARE
AndroidBitmap
.
Client must not modify it while an AndroidBitmap
is wrapping it.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for AndroidBitmap
impl !Send for AndroidBitmap
impl !Sync for AndroidBitmap
impl Unpin for AndroidBitmap
impl UnwindSafe for AndroidBitmap
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