summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 7edf300..c892d97 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -113,6 +113,18 @@ fn main() {
}
return result;
}
+ // make a 16bpp image into an 8bpp image
+ fn monoize(data: &[u8], width: u32, height: u32) -> Vec<u8> {
+ let mut result = vec![0; (width * height) as usize];
+ for h in 0..height {
+ for w in 0..width {
+ result[(h * width + w) as usize] = data[(h * width + w) as usize * 2];
+ }
+ }
+ return result;
+ }
+ // for 16bpp aka qhy600m
+// let monoed = monoize(data.as_slice(), dimensions.width, dimensions.height);
let scale_factor = 2;
if scale_factor != 1 {
let downscaled = downscale(data.as_slice(), dimensions.width, dimensions.height, scale_factor);