MCPcopy Create free account
hub / github.com/ImageOptim/libimagequant / liq_image_create_custom

Function liq_image_create_custom

imagequant-sys/src/ffi.rs:599–608  ·  view source on GitHub ↗
(attr: &liq_attr, row_callback: liq_image_get_rgba_row_callback, user_info: AnySyncSendPtr, width: c_uint, height: c_uint, gamma: f64)

Source from the content-addressed store, hash-verified

597#[no_mangle]
598#[inline(never)]
599pub unsafe extern "C" fn liq_image_create_custom(attr: &liq_attr, row_callback: liq_image_get_rgba_row_callback, user_info: AnySyncSendPtr, width: c_uint, height: c_uint, gamma: f64)
600 -> Option<Box<liq_image<'static>>> {
601 let cb: Box<dyn Fn(&mut [MaybeUninit<RGBA>], usize) + Send + Sync> = Box::new(move |row, y| row_callback(row.as_mut_ptr(), y as _, row.len() as _, user_info));
602 liq_image_create_custom_impl(&attr.inner, cb, width as _, height as _, gamma)
603 .map(move |inner| Box::new(liq_image {
604 magic_header: LIQ_IMAGE_MAGIC,
605 inner: ManuallyDrop::new(inner),
606 c_api_free: attr.c_api_free,
607 }))
608}
609
610#[no_mangle]
611#[inline(never)]

Callers 2

c_callback_test_cFunction · 0.85

Calls 3

newFunction · 0.85
lenMethod · 0.45

Tested by 1

c_callback_test_cFunction · 0.68