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:
3 files changed
+70
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user