diff options
author | gennyble <gen@nyble.dev> | 2024-06-10 17:07:56 -0500 |
---|---|---|
committer | gennyble <gen@nyble.dev> | 2024-06-10 17:07:56 -0500 |
commit | a57cb34b513876313c755be2bbebb63138b4932b (patch) | |
tree | 4efd794c2e5df183da0852044e6038912048c9c5 /src | |
parent | 67eefd43795320043915d3527fd2716986e049d7 (diff) | |
download | colorsquash-a57cb34b513876313c755be2bbebb63138b4932b.tar.gz colorsquash-a57cb34b513876313c755be2bbebb63138b4932b.zip |
Add HighestBits selector to cli
Diffstat (limited to 'src')
-rw-r--r-- | src/nih_kmeans.rs | 2 | ||||
-rw-r--r-- | src/selection.rs | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/nih_kmeans.rs b/src/nih_kmeans.rs index ee752bc..36b17d1 100644 --- a/src/nih_kmeans.rs +++ b/src/nih_kmeans.rs @@ -91,7 +91,7 @@ impl KMeans { .unwrap() } - #[cfg(rand)] + #[cfg(feature = "rand")] fn get_centroid_seeds_random(&self, k: usize) -> Vec<RGB<f32>> { if k >= self.samples.len() { return self.samples.iter().map(|&v| v.into()).collect(); diff --git a/src/selection.rs b/src/selection.rs index 41e0254..84d5ea3 100644 --- a/src/selection.rs +++ b/src/selection.rs @@ -339,6 +339,7 @@ impl Selector for HighestBits { fn select(&mut self, max_colors: usize, image: ImageData) -> Vec<RGB8> { let max_bits = max_colors.next_power_of_two().ilog2() / 3; let shift = 8 - max_bits; + image .0 .iter() |