int cflag = 0;
int dflag = 0;
int eflag = 0;
int nineflag = 0;
int threeflag = 0;
int output = 0;
ulong outchan = CMAP8;
int defaultcolor = 1;
Image *image;
ARGBEGIN{
case '3': /* produce encoded, compressed, three-color bitmap file; no display by default */
threeflag++;
/* fall through */
case 't': /* produce encoded, compressed, true-color bitmap file; no display by default */
cflag++;
dflag++;
output++;
defaultcolor = 0;
outchan = RGB24;
break;
case 'c': /* produce encoded, compressed, bitmap file; no display by default */
cflag++;
dflag++;
output++;
if(defaultcolor)
outchan = CMAP8;
break;
case 'd': /* suppress display of image */
dflag++;
break;
case 'e': /* disable floyd-steinberg error diffusion */
eflag++;
break;
case 'k': /* force black and white */
defaultcolor = 0;
outchan = GREY8;
break;
case 'v': /* force RGBV */
defaultcolor = 0;
outchan = CMAP8;
break;
case '9': /* produce plan 9, uncompressed, bitmap file; no display by default */
nineflag++;
dflag++;
output++;
if(defaultcolor)
outchan = CMAP8;
break;
default:
fprint(2, "usage: bmp -39cdektv [file.bmp ...]\n");
exits("usage");
}ARGEND;