Mercurial > hg > dmlib
comparison tools/libgfx.h @ 2065:451980580189
Refactor how paletted/indexed formats are handled in libgfx.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 05 Dec 2018 13:33:03 +0200 |
parents | 3617ef01c1de |
children | 63284e9ad95e |
comparison
equal
deleted
inserted
replaced
2064:3617ef01c1de | 2065:451980580189 |
---|---|
88 } DMImage; | 88 } DMImage; |
89 | 89 |
90 | 90 |
91 typedef struct | 91 typedef struct |
92 { | 92 { |
93 int format; | 93 int fmtid; // DM_IMGFMT_* of target format (a bit of a kludge here) |
94 int scaleX, scaleY; | 94 int format; // Target color format DM_COLFMT_* |
95 int nplanes, bpp, mask; | 95 int scaleX, scaleY; // Scale factors (1..) |
96 BOOL planar, paletted; | 96 int nplanes, bpp, mask; |
97 int compression; | 97 BOOL planar; |
98 int compression; // Use compression/compression level (0 = none, 9 = max) | |
98 } DMImageConvSpec; | 99 } DMImageConvSpec; |
99 | 100 |
100 | 101 |
101 typedef struct | 102 typedef struct |
102 { | 103 { |
127 | 128 |
128 int dmWriteImageData(const DMImage *img, void *cbdata, | 129 int dmWriteImageData(const DMImage *img, void *cbdata, |
129 int (*writeRowCB)(void *, const Uint8 *, const size_t), const DMImageConvSpec *spec); | 130 int (*writeRowCB)(void *, const Uint8 *, const size_t), const DMImageConvSpec *spec); |
130 | 131 |
131 | 132 |
132 int dmWriteIFFMasterRAWHeader(DMResource *fp, const char *filename, const char *prefix, const DMImage *img, const DMImageConvSpec *spec, const int fmtid); | 133 int dmWriteIFFMasterRAWHeader(DMResource *fp, const char *filename, const char *prefix, const DMImage *img, const DMImageConvSpec *spec); |
133 int dmWriteRAWImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec); | 134 int dmWriteRAWImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec); |
134 | 135 |
135 int dmWritePPMImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec); | 136 int dmWritePPMImage(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec); |
136 | 137 |
137 #ifdef DM_USE_LIBPNG | 138 #ifdef DM_USE_LIBPNG |