X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=imago%2Fsrc%2Fimago2.h;fp=imago%2Fsrc%2Fimago2.h;h=48bda1bc8a02974c15ded789ca23dd055a3bca27;hb=d45bc63a8f65e07332d0b16ad5f062c20bd76414;hp=b6b526913a1302d6027e8bb8497b8c5656ea3188;hpb=dbcd4b5e0c47a8fb8e398431fccb290526303608;p=dos_imgv diff --git a/imago/src/imago2.h b/imago/src/imago2.h index b6b5269..48bda1b 100644 --- a/imago/src/imago2.h +++ b/imago/src/imago2.h @@ -37,6 +37,7 @@ enum img_fmt { IMG_FMT_RGBAF, IMG_FMT_BGRA32, IMG_FMT_RGB565, + IMG_FMT_IDX8, NUM_IMG_FMT }; @@ -49,6 +50,13 @@ struct img_pixmap { char *name; }; +struct img_colormap { + int ncolors; + struct { + unsigned char r, g, b; + } color[256]; +}; + struct img_io { void *uptr; /* user-data */ @@ -160,6 +168,9 @@ void img_getpixel1f(struct img_pixmap *img, int x, int y, float *pix); 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 */