From 623fee395425ab33f14fb9cd8ffa790e362f59d7 Mon Sep 17 00:00:00 2001 From: Julian T Date: Fri, 21 Feb 2020 06:55:27 +0100 Subject: Added pgm drawing and got light ray tracing working Still needs correct light simulation and reflections --- pgm.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pgm.h (limited to 'pgm.h') diff --git a/pgm.h b/pgm.h new file mode 100644 index 0000000..b8900b8 --- /dev/null +++ b/pgm.h @@ -0,0 +1,16 @@ +#ifndef PGM_H +#define PGM_H + +#include +#include + +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); + +int pgm_write_header(FILE *fp, unsigned int w, unsigned int h); +int pgm_write_pixel(FILE *fp, color_t *c); + +#endif -- cgit v1.2.3