Mercurial > hg > dmlib
comparison tools/gfxconv.c @ 2452:0fdc14005e43
Rename dmRemapImageColors() to more accurate dmRemoveUnusedImageColors().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 15 Apr 2020 13:51:22 +0300 |
parents | 2e2a6c344371 |
children | 11151bc8d056 |
comparison
equal
deleted
inserted
replaced
2451:2e2a6c344371 | 2452:0fdc14005e43 |
---|---|
1060 fprintf(outFile, "\n"); | 1060 fprintf(outFile, "\n"); |
1061 } | 1061 } |
1062 } | 1062 } |
1063 | 1063 |
1064 | 1064 |
1065 int dmRemapImageColors(DMImage **pdst, const DMImage *src) | 1065 int dmRemoveUnusedImageColors(DMImage **pdst, const DMImage *src) |
1066 { | 1066 { |
1067 DMPalette *tmpPal = NULL; | 1067 DMPalette *tmpPal = NULL; |
1068 int *mapping = dmMalloc(src->pal->ncolors * sizeof(int)); | 1068 int *mapping = dmMalloc(src->pal->ncolors * sizeof(int)); |
1069 BOOL *mapped = dmMalloc(src->pal->ncolors * sizeof(BOOL)); | 1069 BOOL *mapped = dmMalloc(src->pal->ncolors * sizeof(BOOL)); |
1070 BOOL *used = dmMalloc(src->pal->ncolors * sizeof(BOOL)); | 1070 BOOL *used = dmMalloc(src->pal->ncolors * sizeof(BOOL)); |
1486 // Perform color remapping | 1486 // Perform color remapping |
1487 DMImage *image = pimage; | 1487 DMImage *image = pimage; |
1488 BOOL allocated = FALSE; | 1488 BOOL allocated = FALSE; |
1489 if (optRemapColors && image->pixfmt == DM_PIXFMT_PALETTE) | 1489 if (optRemapColors && image->pixfmt == DM_PIXFMT_PALETTE) |
1490 { | 1490 { |
1491 if ((res = dmRemapImageColors(&image, pimage)) != DMERR_OK) | 1491 if ((res = dmRemoveUnusedImageColors(&image, pimage)) != DMERR_OK) |
1492 return res; | 1492 return res; |
1493 | 1493 |
1494 allocated = TRUE; | 1494 allocated = TRUE; |
1495 } | 1495 } |
1496 | 1496 |