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

Function liq_quantize_image

imagequant-sys/src/ffi.rs:283–293  ·  view source on GitHub ↗
(attr: &mut liq_attr, img: &mut liq_image)

Source from the content-addressed store, hash-verified

281#[no_mangle]
282#[inline(never)]
283pub extern "C" fn liq_quantize_image(attr: &mut liq_attr, img: &mut liq_image) -> Option<Box<liq_result>> {
284 if bad_object!(attr, LIQ_ATTR_MAGIC) ||
285 bad_object!(img, LIQ_IMAGE_MAGIC) { return None; }
286 let img = &mut img.inner;
287 let attr = &mut attr.inner;
288
289 attr.quantize(img).ok().map(|inner| Box::new(liq_result {
290 magic_header: LIQ_RESULT_MAGIC,
291 inner,
292 }))
293}
294
295#[no_mangle]
296#[inline(never)]

Callers 6

MainMethod · 0.85
c_callback_test_cFunction · 0.85
test_abortFunction · 0.85
test_fixed_colorsFunction · 0.85
test_fixed_colors_orderFunction · 0.85

Calls 2

newFunction · 0.85
quantizeMethod · 0.45

Tested by 4

c_callback_test_cFunction · 0.68
test_abortFunction · 0.68
test_fixed_colorsFunction · 0.68
test_fixed_colors_orderFunction · 0.68