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

Function liq_image_create_rgba

imagequant-sys/src/ffi.rs:626–636  ·  view source on GitHub ↗
(attr: &liq_attr, pixels: *const liq_color, width: c_uint, height: c_uint, gamma: f64)

Source from the content-addressed store, hash-verified

624#[no_mangle]
625#[inline(never)]
626pub unsafe extern "C" fn liq_image_create_rgba<'pixels>(attr: &liq_attr, pixels: *const liq_color, width: c_uint, height: c_uint, gamma: f64) -> Option<Box<liq_image<'pixels>>> {
627 if liq_received_invalid_pointer(pixels.cast()) { return None; }
628 if !check_image_size(attr, width, height) { return None; }
629 let rows = (0..height as usize).map(move |i| pixels.add(width as usize * i)).collect();
630 liq_image_create_rgba_bitmap_impl(&attr.inner, rows, width as _, height as _, gamma)
631 .map(move |inner| Box::new(liq_image {
632 magic_header: LIQ_IMAGE_MAGIC,
633 inner: ManuallyDrop::new(inner),
634 c_api_free: attr.c_api_free,
635 }))
636}
637
638#[no_mangle]
639#[inline(never)]

Callers 6

MainMethod · 0.85
mainFunction · 0.85
test_abortFunction · 0.85
test_histogramFunction · 0.85
test_fixed_colorsFunction · 0.85
test_fixed_colors_orderFunction · 0.85

Calls 4

check_image_sizeFunction · 0.85
newFunction · 0.85

Tested by 4

test_abortFunction · 0.68
test_histogramFunction · 0.68
test_fixed_colorsFunction · 0.68
test_fixed_colors_orderFunction · 0.68