diff options
author | Julian T <julian@jtle.dk> | 2020-02-21 14:42:42 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-02-21 14:42:42 +0100 |
commit | 9b40029e42f994aeff59ecc44a6d3b8fba93071d (patch) | |
tree | c133f8f6190b445560c4d8438ba89d7caaa0a7cd /pgm.h | |
parent | 623fee395425ab33f14fb9cd8ffa790e362f59d7 (diff) |
Pretty realistic colors
Diffstat (limited to 'pgm.h')
-rw-r--r-- | pgm.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -3,12 +3,16 @@ #include <stdio.h> #include <stdint.h> +#include "vector.h" typedef struct { uint8_t r, g, b; } color_t; color_t *color_set(color_t *c, uint8_t r, uint8_t g, uint8_t b); +color_t *color_scale(color_t *dest, color_t *a, float b); +color_t *color_add(color_t *dest, color_t *a, color_t *b); +color_t *color_scale_vector(color_t *dest, color_t *a, vector_t *v); int pgm_write_header(FILE *fp, unsigned int w, unsigned int h); int pgm_write_pixel(FILE *fp, color_t *c); |