From deec79ce61b8661d3ad76f3ecc10a80d1ce19cdd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 9 Apr 2017 17:33:31 +0200 Subject: Clean up MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blind-to-image.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/blind-to-image.c') diff --git a/src/blind-to-image.c b/src/blind-to-image.c index 4512085..48cf625 100644 --- a/src/blind-to-image.c +++ b/src/blind-to-image.c @@ -28,9 +28,9 @@ write_pixel(double R, double G, double B, double A, int bytes, unsigned long lon weprintf("warning: out-of-gamut colour detected\n"); } ; /* TODO gamut */ - R = R < 0 ? 0 : R > 1 ? 1 : R; - G = G < 0 ? 0 : G > 1 ? 1 : G; - B = B < 0 ? 0 : B > 1 ? 1 : B; + R = CLIP(0, R, 1); + G = CLIP(0, G, 1); + B = CLIP(0, B, 1); } if (A < 0 || A > 1) { @@ -133,7 +133,7 @@ main(int argc, char *argv[]) printf("P7\n" "WIDTH %zu\n" "HEIGHT %zu\n" - "DEPTH 4\n" /* Depth actually means channels */ + "DEPTH 4\n" /* channels */ "MAXVAL %llu\n" "TUPLTYPE RGB_ALPHA\n" "ENDHDR\n", stream.width, stream.height, max); -- cgit v1.2.3-70-g09d2