Files
meowc/examples/raytracer/include/rt_image.h
T
milner a1173c73b6 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.
2022-07-04 09:14:34 +00:00

27 lines
448 B
C

#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