]> git.imager.perl.org - imager.git/blobdiff - quant.c
update TODO
[imager.git] / quant.c
diff --git a/quant.c b/quant.c
index 9d3abc50cdc9ebf3d52faf6c644d663b0cb8d90b..52942d10c3d3e31642fbefd995a8389c4b3d51ab 100644 (file)
--- a/quant.c
+++ b/quant.c
@@ -6,6 +6,7 @@
 
 static void makemap_addi(i_quantize *, i_img **imgs, int count);
 static void makemap_mediancut(i_quantize *, i_img **imgs, int count);
+static void makemap_mono(i_quantize *);
 
 static
 void
@@ -71,6 +72,10 @@ i_quant_makemap(i_quantize *quant, i_img **imgs, int count) {
     makemap_mediancut(quant, imgs, count);
     break;
 
+  case mc_mono:
+    makemap_mono(quant);
+    break;
+
   case mc_addi:
   default:
     makemap_addi(quant, imgs, count);
@@ -697,6 +702,19 @@ makemap_mediancut(i_quantize *quant, i_img **imgs, int count) {
   i_mempool_destroy(&mp);
 }
 
+static void
+makemap_mono(i_quantize *quant) {
+  quant->mc_colors[0].rgba.r = 0;
+  quant->mc_colors[0].rgba.g = 0;
+  quant->mc_colors[0].rgba.b = 0;
+  quant->mc_colors[0].rgba.a = 255;
+  quant->mc_colors[1].rgba.r = 255;
+  quant->mc_colors[1].rgba.g = 255;
+  quant->mc_colors[1].rgba.b = 255;
+  quant->mc_colors[1].rgba.a = 255;
+  quant->mc_count = 2;
+}
+
 #define pboxjump 32
 
 /* Define one of the following 4 symbols to choose a colour search method