34 #define IN_WINDOW(y,wind) ((y >= wind.ymin) && (y <= wind.ymax))
41 rle_hdr im_hdr, out_hdr;
43 CONST_DECL char *imfilename = NULL, *outfilename = NULL;
45 FILE *outfile = stdout;
46 rle_pixel ** im_rows, **patch_rows, ** outrows;
48 int patches = 0, oflag = 0, i, y, c, xlen, width;
54 if (!
scanargs( argc
, argv
, "% o%-outfile!s infile!s patchfiles%*s",
55 &oflag
, &outfilename
, &imfilename
, &patches
, &patchnames
))
58 patch_hdr = (rle_hdr *) malloc(
sizeof( rle_hdr )
70 for( i = 0; i < patches; i++ )
80 fprintf(stderr,
"%s: Only use stdin (-) once.\n",
93 for( i = 0; i < patches; i++ )
105 fprintf( stderr,
"%s: file %s is outside %s\n", im_hdr
.cmd,
114 "%s: file %s doesn't have the same channels as %s\n",
148 outrows[i] = &(im_rows[i][im_hdr
.xmin]);
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 );
FILE * rle_open_f(char *prog_name, char *file_name, char *mode)
rle_hdr * rle_hdr_cp(rle_hdr *from_hdr, rle_hdr *to_hdr)
void rle_names(rle_hdr *the_hdr, const char *pgmname, const char *fname, int img_num)
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 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)
#define IN_WINDOW(y, wind)
void rle_addhist(argv, rle_hdr *in_hdr, rle_hdr *out_hdr)
void rle_get_setup_ok(rle_hdr *the_hdr, const char *prog_name, const char *file_name)
void rle_put_setup(rle_hdr *the_hdr)
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)
#define RLE_CHECK_ALLOC(pgm, ptr, name)