diff 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
line wrap: on
line diff
--- a/tools/lib64gfx.h	Thu Jun 28 14:49:52 2018 +0300
+++ b/tools/lib64gfx.h	Thu Jun 28 17:26:30 2018 +0300
@@ -78,6 +78,13 @@
 };
 
 
+// Image <-> bitmap conversion dithering
+enum
+{
+    D64_DITH_NONE = 0,     // No dithering
+};
+
+
 // Different enc/dec operation types (op->type)
 enum
 {
@@ -118,6 +125,13 @@
 
 typedef struct
 {
+    int dither;      // Dither mode (D64_DITH_*)
+    BOOL aspect;     // Correct pixel aspect ratio?
+} DMC64ImageConvSpec;
+
+
+typedef struct
+{
     Uint8 *data;
     size_t size;
 } DMC64MemBlock;
@@ -193,8 +207,8 @@
     int  width, height; // Width and height in pixels
     int  chWidth, chHeight; // Width and height in charblocks
 
-    int  (*convertFrom)(DMImage *, const DMC64Image *, const DMC64ImageFormat *fmt);
-    int  (*convertTo)(DMC64Image *, const DMImage *, const DMC64ImageFormat *fmt);
+    int  (*convertFrom)(DMImage *, const DMC64Image *, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec);
+    int  (*convertTo)(DMC64Image *, const DMImage *, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec);
 
     DMC64GetPixelFunc getPixel;
 
@@ -323,14 +337,14 @@
 int       dmC64DecodeGenericBMP(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt);
 int       dmC64EncodeGenericBMP(const BOOL allocate, DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt);
 
-int       dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, const DMC64ImageFormat *fmt);
-int       dmC64ConvertImage2BMP(DMC64Image **pdst, const DMImage *src, const DMC64ImageFormat *fmt);
+int       dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec);
+int       dmC64ConvertImage2BMP(DMC64Image **pdst, const DMImage *src, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec);
 
 int       dmC64DecodeBMP(DMC64Image **img, const DMGrowBuf *buf, const size_t probeOffs, const size_t loadOffs, const DMC64ImageFormat **fmt, const DMC64ImageFormat *forced);
 int       dmC64EncodeBMP(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt);
 
-int       dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageFormat *fmt);
-int       dmC64ConvertGenericImage2BMP(DMC64Image *dst, const DMImage *src, const DMC64ImageFormat *fmt);
+int       dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec);
+int       dmC64ConvertGenericImage2BMP(DMC64Image *dst, const DMImage *src, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec);
 
 void      dmGenericRLEAnalyze(const DMGrowBuf *buf, DMCompParams *cfg);