Mercurial > hg > dmlib
comparison tools/lib64gfx.h @ 1931:410679d2fe8a
"Enable" the image->c64 bitmap conversion path in gfxconv. It does not work
without the necessary bits elsewhere, though. Also add DMC64ImageConvSpec
structure for delivering conversion parameters, though it is not yet used
either.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 28 Jun 2018 17:26:30 +0300 |
parents | 42cd527a01b9 |
children | 10e82be38b8b |
comparison
equal
deleted
inserted
replaced
1930:c048da352279 | 1931:410679d2fe8a |
---|---|
76 D64_CHCFG_LINEAR = 1, // Generate linear pattern so that first line | 76 D64_CHCFG_LINEAR = 1, // Generate linear pattern so that first line |
77 // of chars is 0-39, second 40-79, up to 255. | 77 // of chars is 0-39, second 40-79, up to 255. |
78 }; | 78 }; |
79 | 79 |
80 | 80 |
81 // Image <-> bitmap conversion dithering | |
82 enum | |
83 { | |
84 D64_DITH_NONE = 0, // No dithering | |
85 }; | |
86 | |
87 | |
81 // Different enc/dec operation types (op->type) | 88 // Different enc/dec operation types (op->type) |
82 enum | 89 enum |
83 { | 90 { |
84 DO_COPY, // Perform copy between memory (from/to offset) and subject | 91 DO_COPY, // Perform copy between memory (from/to offset) and subject |
85 DO_SET_MEM, // Set subject value or fill subject memory area to byte value from offset | 92 DO_SET_MEM, // Set subject value or fill subject memory area to byte value from offset |
112 DS_D023, | 119 DS_D023, |
113 DS_D024, | 120 DS_D024, |
114 | 121 |
115 DS_LAST | 122 DS_LAST |
116 }; | 123 }; |
124 | |
125 | |
126 typedef struct | |
127 { | |
128 int dither; // Dither mode (D64_DITH_*) | |
129 BOOL aspect; // Correct pixel aspect ratio? | |
130 } DMC64ImageConvSpec; | |
117 | 131 |
118 | 132 |
119 typedef struct | 133 typedef struct |
120 { | 134 { |
121 Uint8 *data; | 135 Uint8 *data; |
191 { | 205 { |
192 int type; // Type flags, see D64_FMT_* | 206 int type; // Type flags, see D64_FMT_* |
193 int width, height; // Width and height in pixels | 207 int width, height; // Width and height in pixels |
194 int chWidth, chHeight; // Width and height in charblocks | 208 int chWidth, chHeight; // Width and height in charblocks |
195 | 209 |
196 int (*convertFrom)(DMImage *, const DMC64Image *, const DMC64ImageFormat *fmt); | 210 int (*convertFrom)(DMImage *, const DMC64Image *, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec); |
197 int (*convertTo)(DMC64Image *, const DMImage *, const DMC64ImageFormat *fmt); | 211 int (*convertTo)(DMC64Image *, const DMImage *, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec); |
198 | 212 |
199 DMC64GetPixelFunc getPixel; | 213 DMC64GetPixelFunc getPixel; |
200 | 214 |
201 DMC64EncDecOpList encdecOps; | 215 DMC64EncDecOpList encdecOps; |
202 } DMC64ImageCommonFormat; | 216 } DMC64ImageCommonFormat; |
321 | 335 |
322 | 336 |
323 int dmC64DecodeGenericBMP(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt); | 337 int dmC64DecodeGenericBMP(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt); |
324 int dmC64EncodeGenericBMP(const BOOL allocate, DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt); | 338 int dmC64EncodeGenericBMP(const BOOL allocate, DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt); |
325 | 339 |
326 int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, const DMC64ImageFormat *fmt); | 340 int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec); |
327 int dmC64ConvertImage2BMP(DMC64Image **pdst, const DMImage *src, const DMC64ImageFormat *fmt); | 341 int dmC64ConvertImage2BMP(DMC64Image **pdst, const DMImage *src, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec); |
328 | 342 |
329 int dmC64DecodeBMP(DMC64Image **img, const DMGrowBuf *buf, const size_t probeOffs, const size_t loadOffs, const DMC64ImageFormat **fmt, const DMC64ImageFormat *forced); | 343 int dmC64DecodeBMP(DMC64Image **img, const DMGrowBuf *buf, const size_t probeOffs, const size_t loadOffs, const DMC64ImageFormat **fmt, const DMC64ImageFormat *forced); |
330 int dmC64EncodeBMP(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt); | 344 int dmC64EncodeBMP(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt); |
331 | 345 |
332 int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageFormat *fmt); | 346 int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec); |
333 int dmC64ConvertGenericImage2BMP(DMC64Image *dst, const DMImage *src, const DMC64ImageFormat *fmt); | 347 int dmC64ConvertGenericImage2BMP(DMC64Image *dst, const DMImage *src, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec); |
334 | 348 |
335 void dmGenericRLEAnalyze(const DMGrowBuf *buf, DMCompParams *cfg); | 349 void dmGenericRLEAnalyze(const DMGrowBuf *buf, DMCompParams *cfg); |
336 | 350 |
337 void dmSetupRLEBuffers(DMGrowBuf *dst, DMGrowBuf *src, const DMCompParams *cfg); | 351 void dmSetupRLEBuffers(DMGrowBuf *dst, DMGrowBuf *src, const DMCompParams *cfg); |
338 void dmFinishRLEBuffers(DMGrowBuf *dst, DMGrowBuf *src, const DMCompParams *cfg); | 352 void dmFinishRLEBuffers(DMGrowBuf *dst, DMGrowBuf *src, const DMCompParams *cfg); |