IMG_FMT_RGBAF,
IMG_FMT_BGRA32,
IMG_FMT_RGB565,
+ IMG_FMT_IDX8,
NUM_IMG_FMT
};
char *name;
};
+struct img_colormap {
+ int ncolors;
+ struct {
+ unsigned char r, g, b;
+ } color[256];
+};
+
struct img_io {
void *uptr; /* user-data */
void img_getpixel4i(struct img_pixmap *img, int x, int y, int *r, int *g, int *b, int *a);
void img_getpixel4f(struct img_pixmap *img, int x, int y, float *r, float *g, float *b, float *a);
+/* For IMG_FMT_IDX8 pixmaps, returns a pointer to the colormap, null otherwise */
+struct img_colormap *img_colormap(struct img_pixmap *img);
+
/* OpenGL helper functions */