changeset 507:272e64259fde

Add function pointers for encoding and convertTo/convertFrom to the DMC64ImageFormat structure.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 19 Nov 2012 13:49:44 +0200
parents 443228332e5b
children 1ed5025c2538
files lib64gfx.c lib64gfx.h
diffstat 2 files changed, 17 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lib64gfx.c	Mon Nov 19 13:48:35 2012 +0200
+++ b/lib64gfx.c	Mon Nov 19 13:49:44 2012 +0200
@@ -297,7 +297,8 @@
 {
     {
         DM_C64IFMT_MC, ".drp", "DrazPaint 2.0 (packed)",
-        fmtProbeDrazPaint20Packed, fmtDecodeDrazPaintPacked, NULL,
+        fmtProbeDrazPaint20Packed, fmtDecodeDrazPaintPacked,
+        NULL, NULL, NULL,
         4,
         {
             { DT_COLOR_RAM,  0x0000, 0,  0, NULL },
@@ -309,7 +310,8 @@
 
     {
         DM_C64IFMT_MC_ILACE, ".dlp", "DrazLace 1.0 (packed)",
-        fmtProbeDrazLace10Packed, fmtDecodeDrazPaintPacked, NULL,
+        fmtProbeDrazLace10Packed, fmtDecodeDrazPaintPacked,
+        NULL, NULL, NULL,
         6,
         {
             { DT_COLOR_RAM,  0x0000, 0,  0, NULL },
@@ -323,7 +325,8 @@
     
     {
         DM_C64IFMT_MC, ".drp", "DrazPaint (unpacked)",
-        fmtProbeDrazPaint, NULL, NULL,
+        fmtProbeDrazPaint, NULL,
+        NULL, NULL, NULL,
         4,
         {
             { DT_COLOR_RAM,  0x0000, 0,  0, NULL },
@@ -335,7 +338,8 @@
 
     {
         DM_C64IFMT_MC_ILACE, ".drl", "DrazLace 1.0 (unpacked)",
-        fmtProbeDrazLace10, NULL, NULL,
+        fmtProbeDrazLace10, NULL,
+        NULL, NULL, NULL,
         6,
         {
             { DT_COLOR_RAM,  0x0000, 0,  0, NULL },
@@ -349,7 +353,8 @@
     
     {
         DM_C64IFMT_MC_ILACE, ".mci", "Truepaint (unpacked)",
-        fmtProbeTruePaint, NULL, NULL,
+        fmtProbeTruePaint, NULL,
+        NULL, NULL, NULL,
         6,
         {
             { DT_SCREEN_RAM, 0x0000, 0,  0, NULL },
@@ -364,7 +369,8 @@
     
     {
         DM_C64IFMT_MC, ".kla", "Koala Paint (unpacked)",
-        fmtProbeKoalaPaint, NULL, NULL,
+        fmtProbeKoalaPaint, NULL,
+        NULL, NULL, NULL,
         4,
         {
             { DT_COLOR_RAM,  0x2328, 0,  0, NULL },
@@ -376,7 +382,8 @@
 
     {
         DM_C64IFMT_MC, ".ami", "Amica Paint (packed)",
-        fmtProbeAmicaPaintPacked, fmtDecodeAmicaPaintPacked, NULL,
+        fmtProbeAmicaPaintPacked, fmtDecodeAmicaPaintPacked,
+        NULL, NULL, NULL,
         4,
         {
             { DT_COLOR_RAM,  0x2328, 0,  0, NULL },
--- a/lib64gfx.h	Mon Nov 19 13:48:35 2012 +0200
+++ b/lib64gfx.h	Mon Nov 19 13:49:44 2012 +0200
@@ -128,7 +128,9 @@
     char *name;
     int  (*probe)(const Uint8 *buf, const size_t len);
     int  (*decode)(DMC64Image *img, const Uint8 *buf, const size_t len, const struct _DMC64ImageFormat *fmt);
-    int  (*convert)(DMImage *, DMC64Image *);
+    int  (*encode)(DMC64Image *img, Uint8 **buf, size_t *len, const struct _DMC64ImageFormat *fmt);
+    int  (*convertFrom)(DMImage *, DMC64Image *);
+    int  (*convertTo)(DMImage *, DMC64Image *);
 
     int ndecodeOps;
     DMDecodeOp decodeOps[16];