Mercurial > hg > dmlib
diff tools/lib64gfx.c @ 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 | 1b55bcf548de |
children | c5a46cb4cce5 |
line wrap: on
line diff
--- a/tools/lib64gfx.c Thu Jun 28 14:49:52 2018 +0300 +++ b/tools/lib64gfx.c Thu Jun 28 17:26:30 2018 +0300 @@ -1230,12 +1230,13 @@ // Convert a generic "C64" format bitmap in DMC64Image struct to // a indexed/paletted bitmap image. -int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageFormat *fmt) +int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, + const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec) { DMC64GetPixelFunc getPixel; // Sanity check arguments - if (dst == NULL || src == NULL) + if (dst == NULL || src == NULL || fmt == NULL || spec == NULL) return DMERR_NULLPTR; if (dst->width < src->width || dst->height < src->height) @@ -1358,12 +1359,13 @@ } -int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, const DMC64ImageFormat *fmt) +int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, + const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec) { int res; DMImage *dst; - if (pdst == NULL || src == NULL) + if (pdst == NULL || src == NULL || fmt == NULL || spec == NULL) return DMERR_NULLPTR; // Allocate image structure @@ -1377,9 +1379,9 @@ // Convert if (fmt->format->convertFrom != NULL) - res = fmt->format->convertFrom(dst, src, fmt); + res = fmt->format->convertFrom(dst, src, fmt, spec); else - res = dmC64ConvertGenericBMP2Image(dst, src, fmt); + res = dmC64ConvertGenericBMP2Image(dst, src, fmt, spec); return res; } @@ -1433,16 +1435,18 @@ // Convert a generic bitmap image to DMC64Image -int dmC64ConvertGenericImage2BMP(DMC64Image *dst, const DMImage *src, const DMC64ImageFormat *fmt) +int dmC64ConvertGenericImage2BMP(DMC64Image *dst, const DMImage *src, + const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec) { - if (dst == NULL || src == NULL || fmt == NULL) + if (dst == NULL || src == NULL || fmt == NULL || spec == NULL) return DMERR_NULLPTR; return DMERR_OK; } -int dmC64ConvertImage2BMP(DMC64Image **pdst, const DMImage *src, const DMC64ImageFormat *fmt) +int dmC64ConvertImage2BMP(DMC64Image **pdst, const DMImage *src, + const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec) { int res; DMC64Image *dst; @@ -1456,9 +1460,9 @@ // Convert if (fmt->format->convertTo != NULL) - res = fmt->format->convertTo(dst, src, fmt); + res = fmt->format->convertTo(dst, src, fmt, spec); else - res = dmC64ConvertGenericImage2BMP(dst, src, fmt); + res = dmC64ConvertGenericImage2BMP(dst, src, fmt, spec); return res; }