aboutsummaryrefslogtreecommitdiffstats
path: root/src/blind-to-image.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-04-09 17:33:31 +0200
committerMattias Andrée <maandree@kth.se>2017-04-09 17:57:27 +0200
commitdeec79ce61b8661d3ad76f3ecc10a80d1ce19cdd (patch)
tree34a8863335a8eee38ec28419812e99a3c27cef64 /src/blind-to-image.c
parentAdd blind-skip-pattern (diff)
downloadblind-deec79ce61b8661d3ad76f3ecc10a80d1ce19cdd.tar.gz
blind-deec79ce61b8661d3ad76f3ecc10a80d1ce19cdd.tar.bz2
blind-deec79ce61b8661d3ad76f3ecc10a80d1ce19cdd.tar.xz
Clean up
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/blind-to-image.c')
-rw-r--r--src/blind-to-image.c8
1 files changed, 4 insertions, 4 deletions
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);