char *version = "0.1";
float gf[3] = { 1.0, 1.0, 1.0 };
+int mode = 0;
/* help message */
int usage (int ret)
{
FILE *fd = ret ? stderr : stdout;
- fprintf (fd, "usage: %s [-g gamma] [-h] <file>\n", progname);
+ fprintf (fd, "usage: %s [-g gamma] [-h] [-t|-w] <file>\n", progname);
fprintf (fd, " -g: gamma correction (%.1f:%.1f:%.1f)\n", gf[0], gf[1], gf[2]);
fprintf (fd, " -h: help message\n");
+ fprintf (fd, " -t: thin mode (%s)\n", (mode == 0) ? "on" : "off");
+ fprintf (fd, " -w: wide mode (%s)\n", (mode == 1) ? "on" : "off");
fprintf (fd, "%s version %s\n", progname, version);
return ret;
gf[1] = gf[2] = 0;
}
break;
+ case 't':
+ mode = 0;
+ break;
+ case 'w':
+ mode = 1;
+ break;
case 'h':
default:
return usage (c != 'h');
for (k = 0; k < image->width; k++) {
int ind = k + image->width * l;
color_t *color = findcolor (correction (image->red[ind], gf[0]), correction (image->green[ind], gf[1]), correction (image->blue[ind], gf[2]));
- cprint (color, " ");
+ cprint (color, (mode == 0) ? " " : " ");
}
printf ("\n");
}