diff options
author | Julian T <julian@jtle.dk> | 2020-07-25 00:09:53 +0200 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-07-25 00:09:53 +0200 |
commit | dbba33fcd07c9e81e3ca9bc4f5e8185d364fb792 (patch) | |
tree | 7e3b570853a18c7f7670c870f8bc6a09bb287a4f /pgm.c | |
parent | ef684a7d2ad2934af872cb19a413c95d1005c4b6 (diff) |
Further experimentation with pathtracingpath_tracing
Probably starting over in cpp
Diffstat (limited to 'pgm.c')
-rw-r--r-- | pgm.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -2,6 +2,7 @@ #include <stdio.h> #include <stdlib.h> +#include <math.h> #define COLOR_MAX 255 @@ -39,9 +40,15 @@ void color_clamp(color_t *c) int pgm_write_pixel(FILE *fp, color_t *c) { + //color_gamma_correct(c); return fprintf(fp, "%.0lf %.0lf %.0lf\n", c->r * COLOR_MAX, c->g * COLOR_MAX, c->b * COLOR_MAX); } +void color_gamma_correct(color_t *c) { + c->r = sqrt(c->r); + c->g = sqrt(c->g); + c->b = sqrt(c->b); +} color_t *color_set(color_t *c, COORD_T r, COORD_T g, COORD_T b) { c->r = r; |