| 597 | #[no_mangle] |
| 598 | #[inline(never)] |
| 599 | pub 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)] |