comparison tools/lib64gfx.h @ 2265:48b48251610a

Refactor how the image "mode/type" is handled. It is still not perfect for our purposes, but better now.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 17 Jun 2019 02:03:35 +0300
parents adb0480f6ebd
children ecc17b2e129e
comparison
equal deleted inserted replaced
2264:e25fa516b53a 2265:48b48251610a
94 94
95 95
96 // Various extra settings (see DMC64Image::extraInfo[]) 96 // Various extra settings (see DMC64Image::extraInfo[])
97 enum 97 enum
98 { 98 {
99 D64_EI_CHAR_CASE = 0, 99 D64_EI_MODE = 0, // Actual mode, if the format supports several
100 D64_EI_CHAR_MODE, 100
101 D64_EI_CHAR_CASE,
101 D64_EI_CHAR_CUSTOM, 102 D64_EI_CHAR_CUSTOM,
102 103
103 D64_EI_FLI_TYPE, 104 D64_EI_FLI_TYPE,
104 D64_EI_ILACE_TYPE, 105 D64_EI_ILACE_TYPE,
105 }; 106 };
251 typedef int (*DMC64GetPixelFunc)(Uint8 *col, const DMC64Image *img, const int rasterX, const int rasterY); 252 typedef int (*DMC64GetPixelFunc)(Uint8 *col, const DMC64Image *img, const int rasterX, const int rasterY);
252 253
253 254
254 typedef struct _DMC64ImageCommonFormat 255 typedef struct _DMC64ImageCommonFormat
255 { 256 {
256 int type, // Type flags, see D64_FMT_* 257 int mode, // Format mode/type flags, see D64_FMT_*
257 width, height, // Width and height in pixels 258 width, height, // Width and height in pixels
258 chWidth, chHeight, // Width and height in charblocks 259 chWidth, chHeight, // Width and height in charblocks
259 aspectX, aspectY; // Pixel aspectX/Y 260 aspectX, aspectY; // Pixel aspectX/Y
260 261
261 int (*convertFrom)(DMImage *, const DMC64Image *, const DMC64ImageConvSpec *spec); 262 int (*convertFrom)(DMImage *, const DMC64Image *, const DMC64ImageConvSpec *spec);
273 char *name; // Format description/name 274 char *name; // Format description/name
274 275
275 size_t addr; // Loading address (0 if no loading address) 276 size_t addr; // Loading address (0 if no loading address)
276 size_t size; // Size, including loading address. Only used in probing and encoding. 277 size_t size; // Size, including loading address. Only used in probing and encoding.
277 278
278 int flags; // DM_FMT_* flags, see libgfx.h 279 int flags; // DM_FMT_* flags (read/write/broken/etc.), see libgfx.h
279 280
280 int (*probe)(const DMGrowBuf *buf, const DMC64ImageFormat *fmt); 281 int (*probe)(const DMGrowBuf *buf, const DMC64ImageFormat *fmt);
281 282
282 int (*decode)(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt); 283 int (*decode)(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt);
283 int (*encode)(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt); 284 int (*encode)(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt);