1 //! Vector quantisation routines.
5 pub trait VQElement: Sized+Copy+PartialEq {
6 fn dist(&self, rval: Self) -> u32;
9 fn min(&self, rval: Self) -> Self;
10 fn max(&self, rval: Self) -> Self;
11 fn num_components() -> usize;
12 fn sort_by_component(arr: &mut [Self], component: usize);
13 fn max_dist_component(min: &Self, max: &Self) -> usize;
16 pub trait VQElementSum<T: VQElement> {
18 fn add(&mut self, rval: T, count: u64);
19 fn get_centroid(&self) -> T;
22 pub use self::generic_elbg::ELBG;
23 pub use self::generic_mediancut::quantise_median_cut;