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

Method palette_vec

src/quant.rs:276–283  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

274 /// It's slighly better if you get palette from the [`remapped()`][Self::remapped] call instead
275 #[must_use]
276 pub fn palette_vec(&mut self) -> Vec<RGBA> {
277 let pal = self.palette();
278 let mut out: Vec<RGBA> = Vec::new();
279 if out.try_reserve_exact(pal.len()).is_ok() {
280 out.extend_from_slice(pal);
281 }
282 out
283 }
284
285 /// Expected length of the palette
286 ///

Callers 1

remap_into_vecMethod · 0.80

Calls 3

newFunction · 0.85
paletteMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected