Utah Raster Toolkit  9999-git
URT Development version (post-3.1b)
rlecomp.c
Go to the documentation of this file.
1 /*
2  * This software is copyrighted as noted below. It may be freely copied,
3  * modified, and redistributed, provided that the copyright notice is
4  * preserved on all copies.
5  *
6  * There is no warranty or other guarantee of fitness for this software,
7  * it is provided solely "as is". Bug reports or fixes may be sent
8  * to the author, who may or may not act on them as he desires.
9  *
10  * You may not include this software in a program or other software product
11  * without supplying the source, or without informing the end-user that the
12  * source is available for no extra charge.
13  *
14  * If you modify this software, you should include a notice giving the
15  * name of the person performing the modification, the date of modification,
16  * and the reason for such modification.
17  */
18 /*
19  * rlecomp.c - Digitial image compositor (The Poor Man's Pixar)
20  *
21  * Author: Rod Bogart and John W. Peterson
22  * Computer Science Dept.
23  * University of Utah
24  * Date: Tue Feb 25 1986
25  * Copyright (c) 1986 Rod Bogart and John W. Peterson
26  *
27  * For an explanation of the compositing algorithms, see
28  * "Compositing Digital Images", by Porter and Duff,
29  * SIGGRAPH 84, p.255.
30  */
31 
32 #include <stdio.h>
33 #include "rle.h"
34 #include "rle_raw.h"
35 
36 #define MAX(i,j) ( (i) > (j) ? (i) : (j) )
37 #define MIN(i,j) ( (i) < (j) ? (i) : (j) )
38 #define MALLOC_ERR RLE_CHECK_ALLOC( cmd_name( argv ), 0, 0 )
39 
40 #define NUM_OPS 11
41 
42 #define CLEAR_OP 0
43 #define OVER_OP 1 /* Operations */
44 #define IN_OP 2 /* (these must match the comp_ops table) */
45 #define OUT_OP 3
46 #define ATOP_OP 4
47 #define XOR_OP 5
48 #define PLUS_OP 6
49 #define MINUS_OP 7
50 #define DIFF_OP 8
51 #define ADD_OP 9
52 #define SUBTRACT_OP 10
53 
54 #define IN_WINDOW(y,wind) ((y >= wind.ymin) && (y <= wind.ymax))
55 
56 void get_scanline();
57 void copy_scanline();
58 
59 /*
60  * Global raw data structures for copy_scanline.
61  */
62 rle_op ** Araw, **Braw;
63 int * Anraw, *Bnraw;
65 
66 void
68 int argc;
69 char *argv[];
70 {
71  FILE *outfile = stdout;
72  int i, j, k, temp;
73  char *out_fname = NULL;
74  int xlen;
75  rle_hdr A_hdr, B_hdr;
76  rle_hdr out_hdr;
77  rle_pixel **Ascanline, **Bscanline;
78  rle_pixel **rows;
79  rle_pixel **scanout;
80  register
81  rle_pixel *Ascan, *Bscan, *scan;
82  register
83  rle_pixel Aalph, Balph;
84  int int_result = 0;
85  int oflag = 0, op_code;
86  char *Afilename = NULL, *Bfilename = NULL, *op_name = NULL;
87  int Askip, Bskip; /* Blank space counters for copy_scanline */
88  int rle_cnt, rle_err;
89  char *err_fname;
90 
91  static CONST_DECL char *comp_ops[NUM_OPS] =
92  { "clear",
93  "over",
94  "in",
95  "out",
96  "atop",
97  "xor",
98  "plus",
99  "minus",
100  "diff",
101  "add",
102  "subtract"};
103 
104  A_hdr = *rle_hdr_init( NULL );
105  B_hdr = *rle_hdr_init( NULL );
106  out_hdr = *rle_hdr_init( NULL );
107 
108  /*
109  * Parse arguments and set up input and output files.
110  * op : select operator other than OV
111  */
112 
113  if (scanargs(argc, argv, "% o%-outfile!s Afile!s op!s Bfile!s",
114  &oflag, &out_fname, &Afilename, &op_name, &Bfilename ) == 0)
115  {
116  exit(-1);
117  }
118 
119  op_code = -1;
120  for (i=0; i < NUM_OPS; i++)
121  if (strcmp(op_name, comp_ops[i]) == 0) op_code = i;
122 
123  if (op_code == -1)
124  {
125  fprintf(stderr, "%s: Invalid compositor operation\n", op_name);
126  exit(-2);
127  }
128 
129  A_hdr = *rle_hdr_init( NULL );
130  B_hdr = *rle_hdr_init( NULL );
131  out_hdr = *rle_hdr_init( NULL );
132 
133  A_hdr.rle_file = rle_open_f(cmd_name( argv ), Afilename, "r");
134  B_hdr.rle_file = rle_open_f(cmd_name( argv ), Bfilename, "r");
135  if (A_hdr.rle_file == stdin && B_hdr.rle_file == stdin)
136  fprintf(stderr, "Can't read both inputs from stdin!\n");
137  rle_names( &A_hdr, cmd_name( argv ), Afilename, 0 );
138  rle_names( &B_hdr, cmd_name( argv ), Bfilename, 0 );
139  rle_names( &out_hdr, out_hdr.cmd, out_fname, 0 );
140 
141  for ( rle_cnt = 0; ; rle_cnt++ )
142  {
143  if ( (rle_err = rle_get_setup( &A_hdr )) != RLE_SUCCESS )
144  {
145  err_fname = Afilename;
146  break;
147  }
148  if ( (rle_err = rle_get_setup( &B_hdr )) != RLE_SUCCESS )
149  {
150  err_fname = Bfilename;
151  break;
152  }
153 
154  (void)rle_hdr_cp( &A_hdr, &out_hdr );
155  out_hdr.xmin = MIN( A_hdr.xmin, B_hdr.xmin );
156  out_hdr.ymin = MIN( A_hdr.ymin, B_hdr.ymin );
157  out_hdr.xmax = MAX( A_hdr.xmax, B_hdr.xmax );
158  out_hdr.ymax = MAX( A_hdr.ymax, B_hdr.ymax );
159 
160  out_hdr.alpha = 1;
161  out_hdr.ncolors = MAX(A_hdr.ncolors, B_hdr.ncolors);
162  if ( rle_cnt == 0 )
163  outfile = rle_open_f( cmd_name( argv ), out_fname, "w" );
164  out_hdr.rle_file = outfile;
165 
166  rle_addhist( argv, &A_hdr, &out_hdr );
167 
168  xlen = out_hdr.xmax - out_hdr.xmin + 1;
169 
170  /* Enable all channels in output file */
171 
172  for (i = -out_hdr.alpha; i < out_hdr.ncolors; i++)
173  RLE_SET_BIT( out_hdr, i );
174 
175  rle_put_setup( &out_hdr );
176 
177  /*
178  * Make sure input headers have background color allocated for
179  * use in get_scanline and copy_scanline.
180  */
181  if ( A_hdr.bg_color == 0 )
182  {
183  A_hdr.bg_color = (int *)malloc( A_hdr.ncolors * sizeof(int) );
184  RLE_CHECK_ALLOC( A_hdr.cmd, A_hdr.bg_color, "background color" );
185  bzero( A_hdr.bg_color, A_hdr.ncolors * sizeof(int) );
186  }
187  if ( B_hdr.bg_color == 0 )
188  {
189  B_hdr.bg_color = (int *)malloc( B_hdr.ncolors * sizeof(int) );
190  RLE_CHECK_ALLOC( B_hdr.cmd, B_hdr.bg_color, "background color" );
191  bzero( B_hdr.bg_color, B_hdr.ncolors * sizeof(int) );
192  }
193 
194  /*
195  * Allocate row storage
196  */
197 
198  if (rle_row_alloc( &out_hdr, &Ascanline ) < 0)
199  MALLOC_ERR;
200 
201  if (rle_row_alloc( &out_hdr, &Bscanline ) < 0)
202  MALLOC_ERR;
203  for ( i = RLE_ALPHA; i < out_hdr.ncolors; i++ )
204  {
205  bzero( Ascanline[i], out_hdr.xmax + 1 );
206  bzero( Bscanline[i], out_hdr.xmax + 1 );
207  }
208 
209  if (rle_row_alloc( &out_hdr, &scanout ) < 0)
210  MALLOC_ERR;
211 
212  if (!(rows = (rle_pixel **) malloc(sizeof(rle_pixel *)
213  * out_hdr.ncolors+out_hdr.alpha)))
214  MALLOC_ERR;
215 
216  /*
217  * Allocate raw storage
218  */
219  if (rle_raw_alloc( &out_hdr, &Araw, &Anraw ) < 0)
220  MALLOC_ERR;
221 
222  if (rle_raw_alloc( &out_hdr, &Braw, &Bnraw ) < 0)
223  MALLOC_ERR;
224 
225  if (!(non_zero_pixels =
226  (rle_pixel *)malloc( xlen * sizeof( rle_pixel ))))
227  MALLOC_ERR;
228 
229  Askip = 0; /* Initialize counters for copy_scanline */
230  Bskip = 0;
231 
232  /*
233  * Loop through all (possible) scanlines in the output file,
234  * compositing each one.
235  */
236 
237  for ( j = out_hdr.ymin; j <= out_hdr.ymax ; j++)
238  {
239  /*
240  * Special case - if this scanline is in picture A but not
241  * B, don't do the compositing arithmaticly - just copy (or
242  * don't copy) the picture information, depending on the
243  * operation.
244  */
245 
246  if (IN_WINDOW(j, A_hdr) && !IN_WINDOW(j, B_hdr))
247  {
248  switch (op_code) {
249  case OVER_OP:
250  case OUT_OP:
251  case XOR_OP:
252  case PLUS_OP:
253  case MINUS_OP:
254  case DIFF_OP:
255  case SUBTRACT_OP:
256  case ADD_OP:
257  /**** Read the A channel and dump it ****/
258  copy_scanline( &A_hdr, &out_hdr, j,
259  &Askip, Araw, Anraw, 0 );
260  break;
261 
262  case ATOP_OP:
263  case IN_OP:
264  /* Read the A channel, but dump one blank scanline */
265  copy_scanline( &A_hdr, &out_hdr, j,
266  &Askip, Araw, Anraw, 1 );
267  break;
268  }
269  }
270  else
271  if ((!IN_WINDOW(j, A_hdr)) && IN_WINDOW(j, B_hdr))
272 
273  /* As above - special case */
274 
275  {
276  switch (op_code) {
277  case OVER_OP:
278  case ATOP_OP:
279  case XOR_OP:
280  case PLUS_OP:
281  case MINUS_OP:
282  case DIFF_OP:
283  case SUBTRACT_OP:
284  case ADD_OP:
285  /**** Read the B channel and dump it ****/
286  copy_scanline( &B_hdr, &out_hdr, j,
287  &Bskip, Braw, Bnraw, 0 );
288  break;
289 
290  case OUT_OP:
291  case IN_OP:
292  /* Read the B channel, but dump one blank scanline */
293  copy_scanline( &B_hdr, &out_hdr, j,
294  &Bskip, Braw, Bnraw, 1 );
295  break;
296  }
297  }
298  else if (!IN_WINDOW(j, A_hdr) && !IN_WINDOW(j, B_hdr))
299  {
300  rle_skiprow( &out_hdr, 1 );
301  }
302  else
303  {
304  /**** Read the A channel ****/
305  get_scanline( &A_hdr, Ascanline, &Askip, Araw, Anraw );
306 
307  /**** Read the B channel ****/
308  get_scanline( &B_hdr, Bscanline, &Bskip, Braw, Bnraw );
309 
310  /* For each channel... */
311  for( k = RLE_ALPHA; k < out_hdr.ncolors; k++)
312  {
313  Ascan = &Ascanline[k][out_hdr.xmin];
314  Bscan = &Bscanline[k][out_hdr.xmin];
315  scan = &scanout[k][out_hdr.xmin];
316 
317  for( i = out_hdr.xmin; i <= out_hdr.xmax;
318  i++, Ascan++, Bscan++, scan++)
319  {
320  Aalph = Ascanline[RLE_ALPHA][i];
321  Balph = Bscanline[RLE_ALPHA][i];
322 
323  switch (op_code) {
324 
325  /* Note OVER has been optimized for special cases */
326  case OVER_OP: /* cA * 1.0 + cB * (1-alphaA) */
327  if (Aalph == 0)
328  int_result = *Bscan;
329  else if (Aalph == 255)
330  int_result = *Ascan;
331  else
332  int_result = ( *Ascan * 255 +
333  *Bscan * (255 - Aalph))/255;
334  break;
335 
336  case IN_OP: /* cA * alphaB + cB * 0.0 */
337  int_result = ( *Ascan * Balph ) /255;
338  break;
339 
340  case OUT_OP: /* cA * (1-alphaB) + cB * 0.0 */
341  int_result = ( *Ascan * (255 - Balph) ) /255;
342  break;
343 
344  case ATOP_OP: /* cA * alphaB + cB * (1-alphaA) */
345  int_result = ( *Ascan * Balph +
346  *Bscan * (255 - Aalph) )/255;
347  break;
348 
349  case XOR_OP: /* cA * (1-alphaB) + cB * (1-alphaA) */
350  int_result = (*Ascan * (255 - Balph) + *Bscan *
351  (255 - Aalph) )/255;
352  break;
353 
354  case PLUS_OP:
355  int_result = ((temp = ((int)*Ascan + (int)*Bscan))
356  > 255) ? 255 : temp;
357  break;
358 
359  /* minus is intended for subtracting images only, so
360  * the alpha channel is explicitly set to 255.
361  */
362  case MINUS_OP:
363  if (k == RLE_ALPHA)
364  int_result = 255;
365  else
366  int_result = ((temp = ((int)*Ascan - (int)*Bscan))
367  < 0) ? 0 : temp;
368  break;
369 
370  case ADD_OP:
371  int_result = ((temp = ((int)*Ascan + (int)*Bscan))
372  > 255) ? temp - 256: temp;
373  break;
374  case SUBTRACT_OP:
375  int_result = ((temp = ((int)*Ascan - (int)*Bscan))
376  < 0) ? 256 + temp : temp;
377  break;
378  case DIFF_OP:
379  int_result = abs((int)*Ascan - (int)*Bscan);
380  break;
381  }
382 
383  *scan = (rle_pixel) ((int_result > 255) ? 255 :
384  ((int_result < 0) ? 0 : int_result));
385  }
386  }
387 
388  /* Write out the composited data */
389 
390  for( i = 0; i < out_hdr.ncolors+out_hdr.alpha; i++ )
391  rows[i] = &scanout[i-1][out_hdr.xmin];
392  rle_putrow( &rows[1], xlen, &out_hdr );
393  }
394  }
395  rle_puteof( &out_hdr );
396 
397  /* Release storage. */
398  rle_row_free( &out_hdr, Ascanline );
399  rle_row_free( &out_hdr, Bscanline );
400  rle_row_free( &out_hdr, scanout );
401  free( rows );
402  rle_raw_free( &out_hdr, Araw, Anraw );
403  rle_raw_free( &out_hdr, Braw, Bnraw );
404  free( non_zero_pixels );
405  }
406 
407  /* Check for an error. EOF or EMPTY is ok if at least one image
408  * has been read. Otherwise, print an error message.
409  */
410  if ( rle_cnt == 0 || (rle_err != RLE_EOF && rle_err != RLE_EMPTY) )
411  rle_get_error( rle_err, cmd_name( argv ), err_fname );
412 
413 
414  exit( 0 );
415 }
416 
417 /*
418  * Read a scanline from an RLE file. Fake up an alpha channel (from non-
419  * background pixels) if alpha isn't present.
420  */
421 void
423 rle_hdr * the_hdr;
424 rle_pixel **scanline;
425 int * num_skip;
426 rle_op ** tmp_raw; /* Raw pointers for data left behind by */
427 int * tmp_nraw; /* copy_scanline. */
428 {
429  int i,j,no_backgr;
430 
431  if (*num_skip > 0) /* Generate a blank (skipped) scanline */
432  {
433  for( i = RLE_ALPHA; i < the_hdr->ncolors; i++ )
434  bzero( scanline[i], the_hdr->xmax );
435  (*num_skip)--;
436  if (*num_skip == 0)
437  *num_skip = -1; /* Flag raw data available */
438  return;
439  }
440 
441  if (*num_skip < 0) /* num_skip < 0, use stashed raw data */
442  {
443  rle_rawtorow( the_hdr, tmp_raw, tmp_nraw, scanline );
444  rle_freeraw( the_hdr, tmp_raw, tmp_nraw );
445  *num_skip = 0;
446  }
447  else
448  rle_getrow(the_hdr, scanline );
449 
450  /* If no alpha channel, then fake one up from non-background pixels */
451 
452  if (!the_hdr->alpha)
453  for( i = the_hdr->xmin; i <= the_hdr->xmax; i++)
454  {
455  no_backgr = 0;
456  for( j = 0; j < the_hdr->ncolors && no_backgr == 0; j++)
457  no_backgr = no_backgr ||
458  (scanline[j][i] != the_hdr->bg_color[j]);
459  if (no_backgr)
460  scanline[RLE_ALPHA][i] = 255;
461  else
462  scanline[RLE_ALPHA][i] = 0;
463  }
464 }
465 
466 /*
467  * Read a scanline from an RLE file in raw mode, because we are about to dump
468  * it to the outfile. Fake up an alpha channel (from non-background pixels)
469  * if alpha isn't present.
470  */
471 void
473  blank_output )
474 rle_hdr * in_hdr, * out_hdr;
475 int ypos;
476 int *num_skip; /* Number of scanlines to be skipped. */
477 rle_op ** out_raw;
478 int * out_nraw;
479 int blank_output; /* if non-zero, just eat input & blank output */
480 {
481  register int i,j;
482  register rle_pixel * ptr;
483  int chan, fakeruns, xlen, xmin;
484 
485  xlen = in_hdr->xmax - in_hdr->xmin + 1;
486  xmin = in_hdr->xmin;
487 
488  /*
489  * If the skip counter == 0, then we read the next line normally.
490  * If it's positive, then it tells us how many blank lines before
491  * the next available data. If it's negative, it flags that
492  * out_raw contains data to be used.
493  */
494 
495  SKIP_ROW:
496  if (*num_skip > 0) /* We're in a blank space, output blanks */
497  {
498  rle_skiprow( out_hdr, 1 );
499  (*num_skip)--;
500  if (! *num_skip)
501  *num_skip = -1; /* Flag data available. */
502  return;
503  }
504 
505  if (! *num_skip) /* num_skip == 0, must read data... */
506  *num_skip = rle_getraw( in_hdr, out_raw, out_nraw );
507  else
508  *num_skip = ypos; /* num_skip < 0, data was already there */
509 
510  if (*num_skip == 32768) /* EOF, just quit. */
511  {
512  rle_skiprow( out_hdr, 1 );
513  return;
514  }
515 
516  *num_skip -= ypos;
517  if ( *num_skip > 0 )
518  goto SKIP_ROW; /* It happens to the best of us... */
519 
520  if (!blank_output)
521  {
522  /*
523  * If no alpha channel, then fake one up from non-background pixels.
524  *
525  * This is not the most intelligent way to do this. It's
526  * possible to look at the rle_ops directly, and do a set
527  * union of them to produce the fake alpha channel rle_ops.
528  * The algorithm to do this is not obvious to the casual
529  * observer. If you want to take a crack at it, look at
530  * lib/rle_putrow.c (the findruns routine) for hints.
531  */
532 
533  if (! in_hdr->alpha )
534  {
535  /*
536  * Create a "bytemask" of the non-zero pixels.
537  */
538  bzero( non_zero_pixels, xlen );
539  for (chan = 0; chan < in_hdr->ncolors; chan++ )
540  {
541  register int bgc = in_hdr->bg_color[chan];
542  for (i = 0; i < out_nraw[chan]; i++)
543  {
544  register rle_op *rp = &out_raw[chan][i];
545  if (rp->opcode == RRunDataOp )
546  {
547  if ( rp->u.run_val != bgc)
548  {
549  for (ptr = non_zero_pixels + rp->xloc - xmin,
550  j = rp->length;
551  j > 0;
552  j--)
553  *(ptr++) = (rle_pixel) 255;
554  }
555  }
556  else if ( rp->opcode == RByteDataOp )
557  {
558  for (ptr = non_zero_pixels + rp->xloc - xmin,
559  j = 0;
560  j < rp->length;
561  j++, ptr++)
562  if ( rp->u.pixels[j] != bgc )
563  *ptr = (rle_pixel) 255;
564  }
565  }
566  }
567  /*
568  * Collect the bytemask into real opcodes. Assume that this won't
569  * be fragmented into byte data (it doesn't check).
570  */
571  fakeruns = 0;
572  i = 0;
573 
574  while ( i < xlen )
575  {
576  j = 0;
577  out_raw[RLE_ALPHA][fakeruns].opcode = RRunDataOp;
578  out_raw[RLE_ALPHA][fakeruns].u.run_val = (rle_pixel) 255;
579 
580  while ( (non_zero_pixels[i] == (rle_pixel) 0) && (i < xlen) )
581  i++;
582  out_raw[RLE_ALPHA][fakeruns].xloc = i + xmin;
583 
584  while( (non_zero_pixels[i] != (rle_pixel) 0) && (i < xlen) )
585  j++, i++;
586  out_raw[RLE_ALPHA][fakeruns].length = j;
587  if (j) fakeruns++;
588  }
589  out_nraw[RLE_ALPHA] = fakeruns;
590  }
591 
592  /* dump the raw stuff to the output file */
593  rle_putraw( out_raw, out_nraw, out_hdr );
594  }
595  else
596  rle_skiprow( out_hdr, 1 );
597 
598  rle_freeraw( out_hdr, out_raw, out_nraw );
599 }
FILE * rle_open_f(char *prog_name, char *file_name, char *mode)
Definition: rle_open_f.c:216
#define MIN(x, y)
Definition: rletopaint.c:53
#define RLE_SET_BIT(glob, bit)
Definition: rle.h:122
#define RRunDataOp
Definition: rle_code.h:41
int xmin
Definition: rle.h:100
#define SUBTRACT_OP
Definition: rlecomp.c:52
rle_hdr * rle_hdr_cp(rle_hdr *from_hdr, rle_hdr *to_hdr)
Definition: rle_hdr.c:119
void rle_freeraw(rle_hdr *the_hdr, scanraw, nraw)
Definition: rle_getraw.c:268
int * Bnraw
Definition: rlecomp.c:63
int length
Definition: rle_raw.h:51
void rle_names(rle_hdr *the_hdr, const char *pgmname, const char *fname, int img_num)
Definition: rle_hdr.c:48
int rle_raw_alloc(rle_hdr *the_hdr, rle_op ***scanp, int **nrawp)
Definition: rle_raw_alc.c:60
#define ATOP_OP
Definition: rlecomp.c:46
rle_op ** Braw
Definition: rlecomp.c:62
int opcode
Definition: rle_raw.h:49
void rle_row_free(rle_hdr *the_hdr, rle_pixel **scanp)
Definition: rle_row_alc.c:114
#define RLE_EMPTY
Definition: rle.h:73
char * cmd_name(char **argv)
Definition: cmd_name.c:31
void main(int argc, char **argv)
Definition: aliastorle.c:121
int rle_get_setup(rle_hdr *the_hdr)
Definition: rle_getrow.c:74
int rle_row_alloc(rle_hdr *the_hdr, rle_pixel ***scanp)
Definition: rle_row_alc.c:56
rle_pixel * non_zero_pixels
Definition: rlecomp.c:64
void rle_putraw(rle_op **scanraw, int *nraw, rle_hdr *the_hdr)
Definition: rle_putraw.c:60
int rle_getrow(rle_hdr *the_hdr, scanline)
Definition: rle_getrow.c:333
#define IN_OP
Definition: rlecomp.c:44
int * bg_color
Definition: rle.h:100
#define RLE_SUCCESS
Definition: rle.h:70
#define PLUS_OP
Definition: rlecomp.c:48
int ymin
Definition: rle.h:100
int rle_get_error(int code, const char *pgmname, const char *fname)
Definition: rle_error.c:76
void rle_rawtorow(rle_hdr *the_hdr, rle_op **raw, int *nraw, rle_pixel **outrows)
Definition: rle_rawrow.c:31
int scanargs(int argc, char **argv, const char *format,...)
Definition: scanargs.c:94
#define ADD_OP
Definition: rlecomp.c:51
#define OUT_OP
Definition: rlecomp.c:45
int xloc
Definition: rle_raw.h:50
const char * cmd
Definition: rle.h:133
void rle_puteof(rle_hdr *the_hdr)
Definition: rle_putrow.c:474
#define NUM_OPS
Definition: rlecomp.c:40
void rle_putrow(rows, int rowlen, rle_hdr *the_hdr)
Definition: rle_putrow.c:96
int xmax
Definition: rle.h:100
#define MALLOC_ERR
Definition: rlecomp.c:38
#define IN_WINDOW(y, wind)
Definition: rlecomp.c:54
#define RLE_EOF
Definition: rle.h:74
#define CONST_DECL
Definition: rle_config.h:42
void rle_addhist(argv, rle_hdr *in_hdr, rle_hdr *out_hdr)
Definition: rle_addhist.c:54
void copy_scanline(int ypos, int copy_flag)
Definition: unslice.c:252
int * Anraw
Definition: rlecomp.c:63
void rle_skiprow(rle_hdr *the_hdr, int nrow)
Definition: rle_putrow.c:393
#define MAX(i, j)
Definition: get4d.c:23
int ymax
Definition: rle.h:100
unsigned char rle_pixel
Definition: rle.h:56
void rle_put_setup(rle_hdr *the_hdr)
Definition: rle_putrow.c:453
#define OVER_OP
Definition: rlecomp.c:43
void get_scanline(rle_hdr *the_hdr, rle_pixel **scanline, int *num_skip, rle_op **tmp_raw, int *tmp_nraw)
Definition: rlecomp.c:422
int alpha
Definition: rle.h:100
#define RLE_ALPHA
Definition: rle.h:65
#define XOR_OP
Definition: rlecomp.c:47
void rle_raw_free(rle_hdr *the_hdr, rle_op **scanp, nrawp)
Definition: rle_raw_alc.c:131
rle_op ** Araw
Definition: rlecomp.c:62
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)
Definition: rle_hdr.c:267
FILE * rle_file
Definition: rle.h:114
unsigned int rle_getraw(rle_hdr *the_hdr, scanraw, nraw)
Definition: rle_getraw.c:78
int ncolors
Definition: rle.h:100
#define RByteDataOp
Definition: rle_code.h:40
#define RLE_CHECK_ALLOC(pgm, ptr, name)
Definition: rle.h:86
#define MINUS_OP
Definition: rlecomp.c:49
#define DIFF_OP
Definition: rlecomp.c:50