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

Method set

src/pal.rs:242–251  ·  view source on GitHub ↗
(&mut self, idx: usize, color: f_pixel, popularity: PalPop)

Source from the content-addressed store, hash-verified

240 }
241
242 pub fn set(&mut self, idx: usize, color: f_pixel, popularity: PalPop) {
243 debug_assert!(idx < self.colors.len() && idx < self.pops.len());
244
245 if let Some(pops_idx) = self.pops.get_mut(idx) {
246 *pops_idx = popularity;
247 }
248 if let Some(colors_idx) = self.colors.get_mut(idx) {
249 *colors_idx = color;
250 }
251 }
252
253 #[inline(always)]
254 pub fn as_slice(&self) -> &[f_pixel] {

Callers 2

with_fixed_colorsMethod · 0.80
replace_unused_colorsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected