Fold get_bitmap_handle

Signed-off-by: Dude so hot <djohn@fbi.gov>
This commit is contained in:
Dude so hot authored and renovate[bot] committed 2024-09-14 20:08:51 +08:00
1 parent c3c5fbfc79
commit 70fc964b4d
1 file changed
+1 -5
+1 -5
View File
@@ -146,7 +146,7 @@ fn with_bitmap_content<F, R>(env: &mut JNIEnv, bitmap: jobject, f: F) -> Result<
where
F: FnOnce(&ImageBuffer<Rgba<u8>, &[u8]>) -> Result<R>,
{
let handle = get_bitmap_handle(env, bitmap);
let handle = unsafe { Bitmap::from_jni(env.get_raw(), bitmap) };
let info = handle.info()?;
let (width, height) = (info.width(), info.height());
let ptr = handle.lock_pixels()? as *const u8;
@@ -159,10 +159,6 @@ where
result
}
fn get_bitmap_handle(env: &mut JNIEnv, bitmap: jobject) -> Bitmap {
unsafe { Bitmap::from_jni(env.get_raw(), bitmap) }
}
#[no_mangle]
pub extern "system" fn JNI_OnLoad(_: JavaVM, _: *mut c_void) -> jint {
android_logger::init_once(Config::default().with_max_level(LevelFilter::Debug));