Mercurial > hg > dmlib
diff tools/lib64gfx.h @ 1505:3265175b24d2
Change the passing of RLE compression/decompression parameters to be in a dedicated struct.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 11 May 2018 20:18:14 +0300 |
parents | c7b9ef56319b |
children | 776aa43b2c57 |
line wrap: on
line diff
--- a/tools/lib64gfx.h Fri May 11 07:50:18 2018 +0300 +++ b/tools/lib64gfx.h Fri May 11 20:18:14 2018 +0300 @@ -51,10 +51,6 @@ #define C64_MAX_CHARS 256 -#define DM_RLE_MARKER 1 -#define DM_RLE_MASK 2 - - #define DM_GET_ADDR_LO(addr) ((addr) & 0xff) #define DM_GET_ADDR_HI(addr) (((addr) >> 8) & 0xff) @@ -157,8 +153,10 @@ DT_LAST, }; + #define D64_MAX_ENCDEC_OPS 64 + typedef struct _DMC64ImageFormat DMC64ImageFormat; typedef struct _DMC64EncDecOp @@ -198,6 +196,17 @@ } DMC64ImageFormat; +#define DM_COMP_RLE_MARKER 1 +#define DM_COMP_RLE_MASK 2 + + +typedef struct +{ + int type; + Uint8 rleMarker, rleMask1, rleMask2, rleMinCount, rleMaxCount; +} DMCompParams; + + // // Global variables // @@ -237,17 +246,13 @@ int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageFormat *fmt); int dmC64ConvertGenericImage2BMP(DMC64Image *dst, const DMImage *src, const DMC64ImageFormat *fmt); -void dmGenericRLEAnalyze(const DMGrowBuf *buf, Uint8 *rleMarker, const int rleType); +void dmGenericRLEAnalyze(const DMGrowBuf *buf, Uint8 *rleMarker, const int rleType); -int dmDecodeGenericRLE(DMGrowBuf *dst, const Uint8 *src, const Uint8 *srcEnd, - const Uint8 rleMarker, const Uint8 rleMask1, const Uint8 rleMask2, const int rleType); -int dmDecodeGenericRLEAlloc(DMGrowBuf *dst, const Uint8 *src, const Uint8 *srcEnd, - const Uint8 rleMarker, const Uint8 rleMask1, const Uint8 rleMask2, const int rleType); +int dmDecodeGenericRLE(DMGrowBuf *dst, const Uint8 *src, const Uint8 *srcEnd, const DMCompParams *cfg); +int dmDecodeGenericRLEAlloc(DMGrowBuf *dst, const Uint8 *src, const Uint8 *srcEnd, const DMCompParams *cfg); -int dmEncodeGenericRLE(DMGrowBuf *dst, const Uint8 *src, const Uint8 *srcEnd, - const Uint8 rleMarker, const Uint8 rleMinCount, const Uint8 rleMaxCount, const int rleType); -int dmEncodeGenericRLEAlloc(DMGrowBuf *dst, const Uint8 *src, const Uint8 *srcEnd, - const Uint8 rleMarker, const Uint8 rleMinCount, const Uint8 rleMaxCount, const int rleType); +int dmEncodeGenericRLE(DMGrowBuf *dst, const Uint8 *src, const Uint8 *srcEnd, const DMCompParams *cfg); +int dmEncodeGenericRLEAlloc(DMGrowBuf *dst, const Uint8 *src, const Uint8 *srcEnd, const DMCompParams *cfg); //