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

Method convert_row_to_f

src/rows.rs:138–145  ·  view source on GitHub ↗
(row_f_pixels: &'f mut [MaybeUninit<f_pixel>], row_pixels: &[RGBA], gamma_lut: &[f32; 256])

Source from the content-addressed store, hash-verified

136 }
137
138 fn convert_row_to_f<'f>(row_f_pixels: &'f mut [MaybeUninit<f_pixel>], row_pixels: &[RGBA], gamma_lut: &[f32; 256]) -> &'f mut [f_pixel] {
139 assert_eq!(row_f_pixels.len(), row_pixels.len());
140 for (dst, src) in row_f_pixels.iter_mut().zip(row_pixels) {
141 dst.write(f_pixel::from_rgba(gamma_lut, *src));
142 }
143 // Safe, just initialized
144 unsafe { slice_assume_init_mut(row_f_pixels) }
145 }
146
147 #[must_use]
148 fn should_use_low_memory(&self) -> bool {

Callers

nothing calls this directly

Calls 3

slice_assume_init_mutFunction · 0.85
iter_mutMethod · 0.80
writeMethod · 0.80

Tested by

no test coverage detected