43 CONST_DECL char *imfilename = NULL, *outfilename = NULL;
54 if (!
scanargs( argc, argv,
"% o%-outfile!s infile!s patchfiles%*s",
55 &
oflag, &outfilename, &imfilename, &patches, &patchnames ))
70 for(
i = 0;
i < patches;
i++ )
76 if ( patch_hdr[
i].rle_file == stdin )
80 fprintf(stderr,
"%s: Only use stdin (-) once.\n",
93 for(
i = 0;
i < patches;
i++ )
100 if ((patch_hdr[
i].xmin < im_hdr.
xmin) ||
105 fprintf( stderr,
"%s: file %s is outside %s\n", im_hdr.
cmd,
110 if ((patch_hdr[
i].ncolors != im_hdr.
ncolors) ||
114 "%s: file %s doesn't have the same channels as %s\n",
146 xlen = out_hdr.
xmax - out_hdr.
xmin + 1;
148 outrows[
i] = &(im_rows[
i][im_hdr.
xmin]);
152 for (y = im_hdr.
ymin; y <= im_hdr.
ymax; y++)
156 for (
i = 0;
i < patches;
i++)
161 width = patch_hdr[
i].
xmax - patch_hdr[
i].
xmin + 1;
163 bcopy( &(patch_rows[c][patch_hdr[i].xmin]),
164 &(im_rows[c][patch_hdr[i].xmin]), width );
void rle_row_free(rle_hdr *the_hdr, rle_pixel **scanp)
int scanargs(int argc, char **argv, const char *format,...)
int rle_row_alloc(rle_hdr *the_hdr, rle_pixel ***scanp)
void rle_putrow(rle_pixel *rows[], int rowlen, rle_hdr *the_hdr)
#define IN_WINDOW(y, wind)
void rle_addhist(char *argv[], rle_hdr *in_hdr, rle_hdr *out_hdr)
void rle_puteof(rle_hdr *the_hdr)
void rle_names(rle_hdr *the_hdr, const char *pgmname, const char *fname, int img_num)
int rle_get_setup(rle_hdr *the_hdr)
static Panel_item file_name
rle_hdr * rle_hdr_cp(rle_hdr *from_hdr, rle_hdr *to_hdr)
FILE * rle_open_f(const char *prog_name, const char *f_name, const char *mode)
void rle_put_setup(rle_hdr *the_hdr)
char * cmd_name(char **argv)
void rle_get_setup_ok(rle_hdr *the_hdr, const char *prog_name, const char *file_name)
int rle_getrow(rle_hdr *the_hdr, rle_pixel *scanline[])
#define RLE_CHECK_ALLOC(pgm, ptr, name)
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)