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

Function links_and_runs

imagequant-sys/src/ffi.rs:680–699  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

678
679#[test]
680fn links_and_runs() {
681 use std::ptr;
682 unsafe {
683 assert!(liq_version() >= 40000);
684 let attr = liq_attr_create().unwrap();
685 let mut hist = liq_histogram_create(&attr).unwrap();
686 assert_eq!(LIQ_OK, liq_histogram_add_fixed_color(&mut hist, liq_color {r: 0, g: 0, b: 0, a: 0}, 0.));
687 liq_histogram_add_colors(&mut hist, &attr, ptr::null(), 0, 0.);
688
689 let mut res = MaybeUninit::uninit();
690
691 // this is fine, because there is 1 fixed color to generate
692 assert_eq!(LIQ_OK, liq_histogram_quantize(&mut hist, &attr, &mut res));
693 let res = res.assume_init().unwrap();
694
695 liq_result_destroy(Some(res));
696 liq_histogram_destroy(Some(hist));
697 liq_attr_destroy(Some(attr));
698 }
699}
700
701#[test]
702#[allow(deprecated)]

Callers

nothing calls this directly

Calls 7

liq_attr_createFunction · 0.85
liq_histogram_createFunction · 0.85
liq_histogram_add_colorsFunction · 0.85
liq_result_destroyFunction · 0.85
liq_histogram_destroyFunction · 0.85
liq_attr_destroyFunction · 0.85
assume_initMethod · 0.80

Tested by

no test coverage detected