-struct image {
- byte *pixels; /* left top pixel, there are at least sizeof(uns)
- unsed bytes after the buffer (possible optimizations) */
- u32 cols; /* number of columns */
- u32 rows; /* number of rows */
- u32 pixel_size; /* size of pixel (1, 2, 3 or 4) */
- u32 row_size; /* scanline size in bytes */
- u32 image_size; /* size of pixels buffer (rows * rows_size) */
- u32 flags; /* enum image_flag */
-};
-
-struct image *image_new(struct image_thread *it, uns cols, uns rows, uns flags, struct mempool *pool);
-struct image *image_clone(struct image_thread *it, struct image *src, uns flags, struct mempool *pool);
-void image_destroy(struct image *img); /* only with NULL mempool */
-void image_clear(struct image_thread *it, struct image *img);
-
-byte *color_space_to_name(enum color_space cs);
-byte *image_channels_format_to_name(uns format);
+#define IMAGE_MAX_CHANNELS 4
+#define IMAGE_CHANNELS_FORMAT_MAX_SIZE 128
+byte *image_channels_format_to_name(uns format, byte *buf);