From db3cdf42ff05049eb45ae3789d008dbb46ac7176 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sat, 7 Nov 2020 16:27:27 +0000 Subject: [PATCH] remove extraneous colour index stuff --- src/lib.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index bb1273d..9a6ceaf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -186,17 +186,6 @@ fn render_preview(state: &State) -> DynamicImage { .expect("indexed color out-of-range") .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)