comparison tools/libgfx.h @ 2095:80786a28caf0

Mark image format flags with the color formats they support. This information is not yet used.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 05 Mar 2019 09:57:32 +0200
parents 4276b8c0fef0
children 81fb21dd3265
comparison
equal deleted inserted replaced
2094:4276b8c0fef0 2095:80786a28caf0
29 DM_IMGFMT_ARAW, 29 DM_IMGFMT_ARAW,
30 DM_IMGFMT_CDUMP, 30 DM_IMGFMT_CDUMP,
31 }; 31 };
32 32
33 33
34 // Color formats (these can be used along with DM_FMT_*)
34 enum 35 enum
35 { 36 {
36 DM_COLFMT_PALETTE, 37 DM_COLFMT_PALETTE = 0x0010,
37 DM_COLFMT_GRAYSCALE, 38 DM_COLFMT_GRAYSCALE = 0x0020,
38 DM_COLFMT_RGB, 39 DM_COLFMT_RGB = 0x0040,
39 DM_COLFMT_RGBA, 40 DM_COLFMT_RGBA = 0x0080,
41
42 DM_COLFMT_ANY = 0x00f0,
40 }; 43 };
41 44
42 45
43 // Error handling modes 46 // Error handling modes
44 enum 47 enum
110 typedef struct 113 typedef struct
111 { 114 {
112 char *fext; 115 char *fext;
113 char *name; 116 char *name;
114 int fmtid; // DM_IMGFMT_* 117 int fmtid; // DM_IMGFMT_*
115 int flags; // DM_FMT_* flags 118 int flags; // DM_FMT_* and DM_COLFMT_* flags
116 int (*probe)(const Uint8 *buf, const size_t len); 119 int (*probe)(const Uint8 *buf, const size_t len);
117 int (*read)(DMResource *fp, DMImage **pimg); 120 int (*read)(DMResource *fp, DMImage **pimg);
118 int (*write)(DMResource *fp, const DMImage *pimg, const DMImageConvSpec *spec); 121 int (*write)(DMResource *fp, const DMImage *pimg, const DMImageConvSpec *spec);
119 } DMImageFormat; 122 } DMImageFormat;
120 123