comparison tools/gfxconv.c @ 1291:2c4acbc3e7bf

More work on libgfx etc.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 18 Aug 2017 18:56:09 +0300
parents e7dc9bb9777e
children 1dce9e5f4a2f
comparison
equal deleted inserted replaced
1290:e7dc9bb9777e 1291:2c4acbc3e7bf
144 { 144 {
145 .scaleX = 1, 145 .scaleX = 1,
146 .scaleY = 1, 146 .scaleY = 1,
147 .nplanes = 4, 147 .nplanes = 4,
148 .bpp = 8, 148 .bpp = 8,
149 .interleave = FALSE, 149 .planar = FALSE,
150 .paletted = FALSE, 150 .paletted = FALSE,
151 .format = 0, 151 .format = 0,
152 }; 152 };
153 153
154 static const DMOptArg optList[] = 154 static const DMOptArg optList[] =
166 { 7, 'n', "numitems", "How many 'items' to output (default: all)", OPT_ARGREQ }, 166 { 7, 'n', "numitems", "How many 'items' to output (default: all)", OPT_ARGREQ },
167 { 11, 'w', "width", "Item width (number of items per row, min 1)", OPT_ARGREQ }, 167 { 11, 'w', "width", "Item width (number of items per row, min 1)", OPT_ARGREQ },
168 { 9, 'S', "scale", "Scale output image by <n> or <x>:<y> integer factor(s). " 168 { 9, 'S', "scale", "Scale output image by <n> or <x>:<y> integer factor(s). "
169 "-S <n> scales both height and width by <n>.", OPT_ARGREQ }, 169 "-S <n> scales both height and width by <n>.", OPT_ARGREQ },
170 { 12, 'P', "paletted", "Use indexed/paletted output IF possible.", OPT_NONE }, 170 { 12, 'P', "paletted", "Use indexed/paletted output IF possible.", OPT_NONE },
171 { 13, 'N', "nplanes", "# of bitplanes (certain output formats)", OPT_ARGREQ }, 171 { 13, 'N', "nplanes", "# of bitplanes (some output formats)", OPT_ARGREQ },
172 { 18, 'B', "bpp", "Bits per pixel (certain output formats)", OPT_ARGREQ }, 172 { 18, 'B', "bpp", "Bits per pixel (some output formats)", OPT_ARGREQ },
173 { 14, 'I', "interleave", "Interleave output image scanlines (default: output whole planes)", OPT_NONE }, 173 { 14, 'P', "planar", "Interleaved/planar output (some output formats)", OPT_NONE },
174 { 16, 'R', "remap", "Remap output image colors (-R <(#RRGGBB|index):index>[,<..>][+remove] | -R @map.txt[+remove])", OPT_ARGREQ }, 174 { 16, 'R', "remap", "Remap output image colors (-R <(#RRGGBB|index):index>[,<..>][+remove] | -R @map.txt[+remove])", OPT_ARGREQ },
175 }; 175 };
176 176
177 static const int optListN = sizeof(optList) / sizeof(optList[0]); 177 static const int optListN = sizeof(optList) / sizeof(optList[0]);
178 178
686 optSpec.nplanes = tmp; 686 optSpec.nplanes = tmp;
687 } 687 }
688 break; 688 break;
689 689
690 case 14: 690 case 14:
691 optSpec.interleave = TRUE; 691 optSpec.planar = TRUE;
692 break; 692 break;
693 693
694 case 16: 694 case 16:
695 { 695 {
696 char *tmp; 696 char *tmp;
1177 1177
1178 fclose(fp); 1178 fclose(fp);
1179 dmFree(palID); 1179 dmFree(palID);
1180 } 1180 }
1181 1181
1182 if (info) dmMsg(2, "%d bitplanes, %s interleave.\n", spec->nplanes, spec->interleave ? "with" : "without"); 1182 if (info)
1183 {
1184 dmMsg(2, "%d bitplanes, %s planes.\n",
1185 spec->nplanes,
1186 spec->planar ? "planar/interleaved" : "non-interleaved");
1187 }
1183 return dmWriteRAWImage(filename, image, spec); 1188 return dmWriteRAWImage(filename, image, spec);
1184 } 1189 }
1185 break; 1190 break;
1186 1191
1187 default: 1192 default: