]> git.seodisparate.com - EN605.617.81.FA21_StephenSeo_DitheringProject/commitdiff
Add check: color-dithering usage on colored Image
authorStephen Seo <seo.disparate@gmail.com>
Sat, 27 Nov 2021 04:17:35 +0000 (13:17 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Sat, 27 Nov 2021 04:17:35 +0000 (13:17 +0900)
src/image.cc

index 73ae9feefdfbe6ca31101b0a70530d5867669077..5ebffc1bc061e33119e23b5bdf6ae40a954a11fc 100644 (file)
@@ -883,6 +883,13 @@ std::unique_ptr<Image> Image::ToColorDitheredWithBlueNoise(Image *blue_noise) {
     return {};
   }
 
+  if (this->IsGrayscale()) {
+    std::cout << "ERROR ToColorDitheredWithBlueNoise: current Image is not "
+                 "non-grayscale"
+              << std::endl;
+    return {};
+  }
+
   auto opencl_handle = GetOpenCLHandle();
   if (!opencl_handle) {
     std::cout