From a2535ce6300a6190cfb2e63b088d4e8d7b699826 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Sat, 27 Nov 2021 13:17:35 +0900 Subject: [PATCH] Add check: color-dithering usage on colored Image --- src/image.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/image.cc b/src/image.cc index 73ae9fe..5ebffc1 100644 --- a/src/image.cc +++ b/src/image.cc @@ -883,6 +883,13 @@ std::unique_ptr 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