comparison tools/gfxconv.c @ 1801:0562dd55a1f6

s/DM_IFMT_/DM_COLFMT_/g
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 14 Jun 2018 12:58:44 +0300
parents 4e4d54135baf
children d53bdee5ffa5
comparison
equal deleted inserted replaced
1800:45e7688336dc 1801:0562dd55a1f6
1086 if (info) 1086 if (info)
1087 { 1087 {
1088 char *str; 1088 char *str;
1089 switch (format) 1089 switch (format)
1090 { 1090 {
1091 case DM_IFMT_PALETTE : str = "Indexed 8bpp"; break; 1091 case DM_COLFMT_PALETTE : str = "Indexed 8bpp"; break;
1092 case DM_IFMT_RGB : str = "24bit RGB"; break; 1092 case DM_COLFMT_RGB : str = "24bit RGB"; break;
1093 case DM_IFMT_RGBA : str = "32bit RGBA"; break; 1093 case DM_COLFMT_RGBA : str = "32bit RGBA"; break;
1094 default : str = "???"; break; 1094 default : str = "???"; break;
1095 } 1095 }
1096 dmMsg(2, "%s output.\n", str); 1096 dmMsg(2, "%s output.\n", str);
1097 } 1097 }
1098 } 1098 }
1099 1099
1151 1151
1152 switch (iformat) 1152 switch (iformat)
1153 { 1153 {
1154 #ifdef DM_USE_LIBPNG 1154 #ifdef DM_USE_LIBPNG
1155 case DM_IMGFMT_PNG: 1155 case DM_IMGFMT_PNG:
1156 spec->format = spec->paletted ? DM_IFMT_PALETTE : DM_IFMT_RGBA; 1156 spec->format = spec->paletted ? DM_COLFMT_PALETTE : DM_COLFMT_RGBA;
1157 dmOutputImageBitFormat(spec->format, info); 1157 dmOutputImageBitFormat(spec->format, info);
1158 res = dmWritePNGImage(filename, image, spec); 1158 res = dmWritePNGImage(filename, image, spec);
1159 break; 1159 break;
1160 #endif 1160 #endif
1161 1161
1162 case DM_IMGFMT_PPM: 1162 case DM_IMGFMT_PPM:
1163 spec->format = DM_IFMT_RGB; 1163 spec->format = DM_COLFMT_RGB;
1164 dmOutputImageBitFormat(spec->format, info); 1164 dmOutputImageBitFormat(spec->format, info);
1165 res = dmWritePPMImage(filename, image, spec); 1165 res = dmWritePPMImage(filename, image, spec);
1166 break; 1166 break;
1167 1167
1168 case DM_IMGFMT_PCX: 1168 case DM_IMGFMT_PCX:
1169 spec->format = spec->paletted ? DM_IFMT_PALETTE : DM_IFMT_RGB; 1169 spec->format = spec->paletted ? DM_COLFMT_PALETTE : DM_COLFMT_RGB;
1170 dmOutputImageBitFormat(spec->format, info); 1170 dmOutputImageBitFormat(spec->format, info);
1171 res = dmWritePCXImage(filename, image, spec); 1171 res = dmWritePCXImage(filename, image, spec);
1172 break; 1172 break;
1173 1173
1174 case DM_IMGFMT_RAW: 1174 case DM_IMGFMT_RAW:
1507 { 1507 {
1508 dmErrorMsg("Sequential image output requires filename template.\n"); 1508 dmErrorMsg("Sequential image output requires filename template.\n");
1509 goto error; 1509 goto error;
1510 } 1510 }
1511 1511
1512 outImage = dmImageAlloc(outWidthPX, outHeight, DM_IFMT_PALETTE, -1); 1512 outImage = dmImageAlloc(outWidthPX, outHeight, DM_COLFMT_PALETTE, -1);
1513 dmMsg(1, "Outputting sequence of %d images @ %d x %d -> %d x %d.\n", 1513 dmMsg(1, "Outputting sequence of %d images @ %d x %d -> %d x %d.\n",
1514 optItemCount, 1514 optItemCount,
1515 outImage->width, outImage->height, 1515 outImage->width, outImage->height,
1516 outImage->width * optSpec.scaleX, outImage->height * optSpec.scaleY); 1516 outImage->width * optSpec.scaleX, outImage->height * optSpec.scaleY);
1517 } 1517 }
1527 outIWidth = optPlanedWidth; 1527 outIWidth = optPlanedWidth;
1528 outIHeight = (optItemCount / optPlanedWidth); 1528 outIHeight = (optItemCount / optPlanedWidth);
1529 if (optItemCount % optPlanedWidth) 1529 if (optItemCount % optPlanedWidth)
1530 outIHeight++; 1530 outIHeight++;
1531 1531
1532 outImage = dmImageAlloc(outWidthPX * outIWidth, outIHeight * outHeight, DM_IFMT_PALETTE, -1); 1532 outImage = dmImageAlloc(outWidthPX * outIWidth, outIHeight * outHeight, DM_COLFMT_PALETTE, -1);
1533 } 1533 }
1534 1534
1535 dmSetDefaultC64Palette(outImage); 1535 dmSetDefaultC64Palette(outImage);
1536 1536
1537 while (offs + outSize < dataSize && (optItemCount < 0 || itemCount < optItemCount)) 1537 while (offs + outSize < dataSize && (optItemCount < 0 || itemCount < optItemCount))