INNER CODE UNIT · Rust
dec
FooIbar/EhViewer · app/src/main/rust/src/ffi/android.rs:44
let dec = decoder as *mut WebPAnimDecoder;
let (buf, timestamp) = unsafe { decode_next_frame(dec, reset != 0) };
if !buf.is_null() {
let info = unsafe { get_image_info(dec) };
let handle = unsafe { Bitmap::from_jni(env.get_raw(), bitmap) };
let dst = handle.lock_pixels()? as *mut u8;
let size = info.canvas_width * info.canvas_height * 4;
unsafe { copy_nonoverlapping(buf, dst, size as usize) };
handle.unlock_pixels()?;
}
Ok(timestamp)
})
}
fn ptr_as_image<'local, P: CustomPixel>(
ptr: *const !,
w: u32,
h: u32,