29 static char rcs_ident[] =
"$Header: /n/hgp/mendel/u/spencer/src/urt/tools/RCS/tobw.c,v 3.0 1990/08/03 15:24:09 spencer Exp spencer $";
41 extern void *malloc();
43 extern char *malloc();
72 char * infname = NULL, * outfname = NULL;
73 FILE * outfile = stdout;
74 int oflag = 0, tflag = 0, nrow;
76 unsigned char ** scan, *outscan[4];
77 unsigned char * buffer;
80 if (
scanargs( argc
, argv
, "% t%- o%-outfile!s infile%s",
81 &tflag
, &oflag
, &outfname
, &infname
) == 0 )
92 fprintf( stderr,
"%s: %s is already black & white\n",
93 cmd_name( argv
), infname ? infname :
"stdin" );
98 fprintf( stderr,
"%s: %s is not RGB",
99 cmd_name( argv
), infname ? infname :
"stdin" );
111 buffer = (
unsigned char *)malloc( nrow );
115 outscan[0] = scan[-1];
120 outscan[2] = outscan[3] = buffer;
131 out_hdr
.bg_color = (
int *)malloc(
sizeof(
int ) );
FILE * rle_open_f(char *prog_name, char *file_name, char *mode)
#define RLE_SET_BIT(glob, bit)
void rle_row_free(rle_hdr *the_hdr, rle_pixel **scanp)
char * cmd_name(char **argv)
void main(int argc, char **argv)
int rle_get_setup(rle_hdr *the_hdr)
int rle_row_alloc(rle_hdr *the_hdr, rle_pixel ***scanp)
int rle_getrow(rle_hdr *the_hdr, scanline)
int rle_get_error(int code, const char *pgmname, const char *fname)
void rgb_to_bw(rle_pixel *red_row, rle_pixel *green_row, rle_pixel *blue_row, rle_pixel *bw_row, int rowlen)
int scanargs(int argc, char **argv, const char *format,...)
void rle_puteof(rle_hdr *the_hdr)
void rle_putrow(rows, int rowlen, rle_hdr *the_hdr)
void rle_addhist(argv, rle_hdr *in_hdr, rle_hdr *out_hdr)
void rle_put_setup(rle_hdr *the_hdr)