buddhabrot/src/image.h

24 lines
431 B
C
Raw Normal View History

2020-11-10 16:31:32 +01:00
#ifndef IMAGE_H
#define IMAGE_H
#include <stddef.h>
struct image {
size_t w;
size_t h;
struct pixel {
unsigned char r;
unsigned char g;
unsigned char b;
} buf[];
};
struct image *create_image(size_t w, size_t h);
void destroy_image(struct image *image);
static inline size_t to_index(size_t h, size_t w, const struct image *image) {
return h * image->w + w;
}
2020-11-10 16:31:32 +01:00
#endif /* !IMAGE_H */