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

Function store_boxed_result

imagequant-sys/src/ffi.rs:574–579  ·  view source on GitHub ↗
(res: Result<T, liq_error>, out: &mut MaybeUninit<Option<Box<T>>>)

Source from the content-addressed store, hash-verified

572
573#[inline]
574fn store_boxed_result<T>(res: Result<T, liq_error>, out: &mut MaybeUninit<Option<Box<T>>>) -> liq_error {
575 match res {
576 Ok(res) => { out.write(Some(Box::new(res))); LIQ_OK },
577 Err(err) => { out.write(None); err },
578 }
579}
580
581pub(crate) fn check_image_size(attr: &liq_attr, width: u32, height: u32) -> bool {
582 if bad_object!(attr, LIQ_ATTR_MAGIC) { return false; }

Callers 3

liq_image_quantizeFunction · 0.85
liq_histogram_quantizeFunction · 0.85
liq_result_from_paletteFunction · 0.85

Calls 2

newFunction · 0.85
writeMethod · 0.80

Tested by

no test coverage detected