add -W to specify window size.

various other little fixes.
This commit is contained in:
rsc 2004-04-29 17:13:24 +00:00
parent 3d72637f9b
commit be36ff6885
36 changed files with 332 additions and 304 deletions

View file

@ -43,6 +43,13 @@ eresized(int new)
flushimage(display, 1);
}
void
usage(void)
{
fprint(2, "usage: bmp -39cdektv -W winsize [file.bmp ...]\n");
exits("usage");
}
void
main(int argc, char *argv[])
{
@ -50,6 +57,9 @@ main(int argc, char *argv[])
char *err;
ARGBEGIN{
case 'W':
winsize = EARGF(usage());
break;
case '3': /* produce encoded, compressed, three-color bitmap file; no display by default */
threeflag++;
/* fall through */
@ -89,8 +99,7 @@ main(int argc, char *argv[])
outchan = CMAP8;
break;
default:
fprint(2, "usage: bmp -39cdektv [file.bmp ...]\n");
exits("usage");
usage();
}ARGEND;
err = nil;

View file

@ -56,6 +56,14 @@ eresized(int new)
flushimage(display, 1);
}
void
usage(void)
{
fprint(2, "usage: gif -39cdektv -W winsize [file.gif ...]\n");
exits("usage");
}
void
main(int argc, char *argv[])
{
@ -63,6 +71,9 @@ main(int argc, char *argv[])
char *err;
ARGBEGIN{
case 'W':
winsize = EARGF(usage());
break;
case '3': /* produce encoded, compressed, three-color bitmap file; no display by default */
threeflag++;
/* fall through */
@ -102,8 +113,7 @@ main(int argc, char *argv[])
outchan = CMAP8;
break;
default:
fprint(2, "usage: gif -39cdektv [file.gif ...]\n");
exits("usage");
usage();
}ARGEND;
err = nil;

View file

@ -258,7 +258,7 @@ Bgeticon(Biobuf *b, Icon *icon)
void
usage(void)
{
fprint(2, "usage: %s [file]\n", argv0);
fprint(2, "usage: %s -W winsize [file]\n", argv0);
exits("usage");
}
@ -444,6 +444,9 @@ main(int argc, char **argv)
Event e;
ARGBEGIN{
case 'W':
winsize = EARGF(usage());
break;
case 'd':
debug = 1;
break;

View file

@ -45,6 +45,13 @@ eresized(int new)
flushimage(display, 1);
}
void
usage(void)
{
fprint(2, "usage: jpg -39cdefFkJrtv -W winsize [file.jpg ...]\n");
exits("usage");
}
void
main(int argc, char *argv[])
{
@ -54,6 +61,9 @@ main(int argc, char *argv[])
yflag = 0;
ARGBEGIN{
case 'W':
winsize = EARGF(usage());
break;
case 'c': /* produce encoded, compressed, bitmap file; no display by default */
cflag++;
dflag++;
@ -110,8 +120,7 @@ main(int argc, char *argv[])
outchan = CMAP8;
break;
default:
fprint(2, "usage: jpg -39cdefFkJrtv [file.jpg ...]\n");
exits("usage");
usage();
}ARGEND;
if(yflag==0 && dflag==0 && colorspace==CYCbCr){ /* see if we should convert right to RGB */

View file

@ -43,6 +43,13 @@ eresized(int new)
flushimage(display, 1);
}
void
usage(void)
{
fprint(2, "usage: png -39cdekrtv -W winsize [file.png ...]\n");
exits("usage");
}
void
main(int argc, char *argv[])
{
@ -51,6 +58,9 @@ main(int argc, char *argv[])
char buf[12+1];
ARGBEGIN{
case 'W':
winsize = EARGF(usage());
break;
case 'c': /* produce encoded, compressed, bitmap file; no display by default */
cflag++;
dflag++;
@ -96,8 +106,7 @@ main(int argc, char *argv[])
outchan = CMAP8;
break;
default:
fprint(2, "usage: png -39cdekrtv [file.png ...]\n");
exits("usage");
usage();
}ARGEND;
if(dflag==0 && colorspace==CYCbCr){ /* see if we should convert right to RGB */

View file

@ -41,6 +41,13 @@ eresized(int new)
flushimage(display, 1);
}
void
usage(void)
{
fprint(2, "usage: ppm -39cdektv -W winsize [file.ppm ...]\n");
exits("usage");
}
void
main(int argc, char *argv[])
{
@ -48,6 +55,9 @@ main(int argc, char *argv[])
char *err;
ARGBEGIN{
case 'W':
winsize = EARGF(usage());
break;
case '3': /* produce encoded, compressed, three-color bitmap file; no display by default */
threeflag++;
/* fall through */
@ -87,8 +97,7 @@ main(int argc, char *argv[])
outchan = CMAP8;
break;
default:
fprint(2, "usage: ppm -39cdektv [file.ppm ...]\n");
exits("usage");
usage();
}ARGEND;
err = nil;

View file

@ -43,6 +43,13 @@ eresized(int new)
flushimage(display, 1);
}
void
usage(void)
{
fprint(2, "usage: yuv -39cdektv -W winsize [file.yuv ...]\n");
exits("usage");
}
void
main(int argc, char *argv[])
{
@ -50,6 +57,9 @@ main(int argc, char *argv[])
char *err;
ARGBEGIN{
case 'W':
winsize = EARGF(usage());
break;
case '3': /* produce encoded, compressed, three-color bitmap file; no display by default */
threeflag++;
/* fall through */
@ -89,8 +99,7 @@ main(int argc, char *argv[])
outchan = CMAP8;
break;
default:
fprint(2, "usage: yuv -39cdektv [file.yuv ...]\n");
exits("usage");
usage();
}ARGEND;
err = nil;