shithub: fnt

Download patch

ref: 4675a2d0c337fef404d6be5a824a8c4de4701e6e
parent: 17c753b3afc975b1e710c7f5c150f01e5f283b3c
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Wed Jul 24 22:12:39 EDT 2024

bitpixel: support 8-bit greyscale

--- a/rast.c
+++ b/rast.c
@@ -694,6 +694,12 @@
 		i = y*bg->pitchBits+x;
 		x &= 7;
 		return (bg->image[i>>3] & (0x80>>x)) ? 255 : 0;
+	}else if(bg->bitDepth == 4){
+		/* FIXME */
+		assert(nil);
+		return 0;
+	}else if(bg->bitDepth == 8){
+		return bg->image[y*bg->pitchBits/8 + x];
 	}
 	return 0;
 }