Mercurial > hg > dmlib
comparison tools/lib64gfx.c @ 2223:5477e792def3
Remove useless DMC64ImageFormat parameter from some conversion functions.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 14 Jun 2019 12:12:19 +0300 |
parents | 90ec1ec89c56 |
children | a36c81c3df85 |
comparison
equal
deleted
inserted
replaced
2222:75b5bb490f38 | 2223:5477e792def3 |
---|---|
1380 } | 1380 } |
1381 | 1381 |
1382 | 1382 |
1383 // Convert a generic "C64" format bitmap in DMC64Image struct to | 1383 // Convert a generic "C64" format bitmap in DMC64Image struct to |
1384 // a indexed/paletted bitmap image. | 1384 // a indexed/paletted bitmap image. |
1385 int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, | 1385 int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageConvSpec *spec) |
1386 const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec) | |
1387 { | 1386 { |
1388 DMC64GetPixelFunc getPixel; | 1387 DMC64GetPixelFunc getPixel; |
1389 | 1388 |
1390 // Sanity check arguments | 1389 // Sanity check arguments |
1391 if (dst == NULL || src == NULL || fmt == NULL || spec == NULL) | 1390 if (dst == NULL || src == NULL || spec == NULL) |
1392 return DMERR_NULLPTR; | 1391 return DMERR_NULLPTR; |
1393 | 1392 |
1394 if (dst->width != src->fmt->width || dst->height != src->fmt->height) | 1393 if (dst->width != src->fmt->width || dst->height != src->fmt->height) |
1395 { | 1394 { |
1396 return dmError(DMERR_INVALID_DATA, | 1395 return dmError(DMERR_INVALID_DATA, |
1431 | 1430 |
1432 return DMERR_OK; | 1431 return DMERR_OK; |
1433 } | 1432 } |
1434 | 1433 |
1435 | 1434 |
1436 int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, | 1435 int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, const DMC64ImageConvSpec *spec) |
1437 const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec) | |
1438 { | 1436 { |
1439 int res; | 1437 int res; |
1440 DMImage *dst; | 1438 DMImage *dst; |
1441 | 1439 |
1442 if (pdst == NULL || src == NULL || fmt == NULL || spec == NULL) | 1440 if (pdst == NULL || src == NULL || spec == NULL) |
1443 return DMERR_NULLPTR; | 1441 return DMERR_NULLPTR; |
1444 | 1442 |
1445 // Allocate image structure | 1443 // Allocate image structure |
1446 if ((*pdst = dst = dmImageAlloc( | 1444 if ((*pdst = dst = dmImageAlloc( |
1447 src->fmt->width, src->fmt->height, DM_PIXFMT_PALETTE, -1)) == NULL) | 1445 src->fmt->width, src->fmt->height, DM_PIXFMT_PALETTE, -1)) == NULL) |
1450 // Set palette information | 1448 // Set palette information |
1451 if ((res = dmC64SetImagePalette(dst, spec, FALSE)) != DMERR_OK) | 1449 if ((res = dmC64SetImagePalette(dst, spec, FALSE)) != DMERR_OK) |
1452 return res; | 1450 return res; |
1453 | 1451 |
1454 // Convert | 1452 // Convert |
1455 if (fmt->format->convertFrom != NULL) | 1453 if (src->fmt->convertFrom != NULL) |
1456 res = fmt->format->convertFrom(dst, src, fmt, spec); | 1454 res = src->fmt->convertFrom(dst, src, spec); |
1457 else | 1455 else |
1458 res = dmC64ConvertGenericBMP2Image(dst, src, fmt, spec); | 1456 res = dmC64ConvertGenericBMP2Image(dst, src, spec); |
1459 | 1457 |
1460 return res; | 1458 return res; |
1461 } | 1459 } |
1462 | 1460 |
1463 | 1461 |