remove extraneous colour index stuff

This commit is contained in:
Max Bradbury 2020-11-07 16:27:27 +00:00
parent 31d7ff52ca
commit db3cdf42ff
1 changed files with 0 additions and 11 deletions

View File

@ -186,17 +186,6 @@ fn render_preview(state: &State) -> DynamicImage {
.expect("indexed color out-of-range") .expect("indexed color out-of-range")
.into() .into()
}); });
let mut indexed = buffer.clone();
for (i, pixel) in buffer.pixels().enumerate() {
// todo get rid of magic numbers! what about Bitsy HD?
let mut pixel = image::Rgba::from(pixel.0);
colour_map.map_color(&mut pixel);
indexed.put_pixel(
(i % 128) as u32,
(i / 128) as u32,
pixel
);
}
} }
image::DynamicImage::ImageRgba8(buffer) image::DynamicImage::ImageRgba8(buffer)