feat(examples): add the image buffer and a PPM writer

RGB framebuffer with tone mapping, and PPM output for the path where zlib is
unavailable.
This commit is contained in:
sneeker committed 2022-07-04 09:14:34 +00:00
1 parent 23f8288a52
commit 4847e73434
3 files changed
+70

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
#ifndef RT_IMAGE_H
#define RT_IMAGE_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
int width, height;
unsigned char *rgb;
} image;
image *image_new(int width, int height);
void image_free(image *im);
/* Both return 0 on success. */
int image_write_ppm(const image *im, const char *path);
int image_write_png(const image *im, const char *path);
const char *image_default_extension(void);
#ifdef __cplusplus
}
#endif
#endif