Utah Raster Toolkit  9999-git
URT Development version (post-3.1b)
Macros | Functions | Variables
rlecomp.c File Reference
#include <stdio.h>
#include "rle.h"
#include "rle_raw.h"
Include dependency graph for rlecomp.c:

Go to the source code of this file.

Macros

#define MAX(i, j)    ( (i) > (j) ? (i) : (j) )
 
#define MIN(i, j)    ( (i) < (j) ? (i) : (j) )
 
#define MALLOC_ERR   RLE_CHECK_ALLOC( cmd_name( argv ), 0, 0 )
 
#define NUM_OPS   11
 
#define CLEAR_OP   0
 
#define OVER_OP   1 /* Operations */
 
#define IN_OP   2 /* (these must match the comp_ops table) */
 
#define OUT_OP   3
 
#define ATOP_OP   4
 
#define XOR_OP   5
 
#define PLUS_OP   6
 
#define MINUS_OP   7
 
#define DIFF_OP   8
 
#define ADD_OP   9
 
#define SUBTRACT_OP   10
 
#define IN_WINDOW(y, wind)   ((y >= wind.ymin) && (y <= wind.ymax))
 

Functions

void get_scanline ()
 
void copy_scanline ()
 
void main (int argc, argv)
 
void get_scanline (rle_hdr *the_hdr, rle_pixel **scanline, int *num_skip, rle_op **tmp_raw, int *tmp_nraw)
 
void copy_scanline (rle_hdr *in_hdr, rle_hdr *out_hdr, int ypos, int *num_skip, rle_op **out_raw, int *out_nraw, int blank_output)
 

Variables

rle_op ** Araw
 
rle_op ** Braw
 
intAnraw
 
intBnraw
 
rle_pixelnon_zero_pixels
 

Macro Definition Documentation

#define ADD_OP   9

Definition at line 51 of file rlecomp.c.

#define ATOP_OP   4

Definition at line 46 of file rlecomp.c.

#define CLEAR_OP   0

Definition at line 42 of file rlecomp.c.

#define DIFF_OP   8

Definition at line 50 of file rlecomp.c.

#define IN_OP   2 /* (these must match the comp_ops table) */

Definition at line 44 of file rlecomp.c.

#define IN_WINDOW (   y,
  wind 
)    ((y >= wind.ymin) && (y <= wind.ymax))

Definition at line 54 of file rlecomp.c.

#define MALLOC_ERR   RLE_CHECK_ALLOC( cmd_name( argv ), 0, 0 )

Definition at line 38 of file rlecomp.c.

#define MAX (   i,
 
)    ( (i) > (j) ? (i) : (j) )

Definition at line 36 of file rlecomp.c.

#define MIN (   i,
 
)    ( (i) < (j) ? (i) : (j) )

Definition at line 37 of file rlecomp.c.

#define MINUS_OP   7

Definition at line 49 of file rlecomp.c.

#define NUM_OPS   11

Definition at line 40 of file rlecomp.c.

#define OUT_OP   3

Definition at line 45 of file rlecomp.c.

#define OVER_OP   1 /* Operations */

Definition at line 43 of file rlecomp.c.

#define PLUS_OP   6

Definition at line 48 of file rlecomp.c.

#define SUBTRACT_OP   10

Definition at line 52 of file rlecomp.c.

#define XOR_OP   5

Definition at line 47 of file rlecomp.c.

Function Documentation

void copy_scanline ( )
void copy_scanline ( rle_hdr in_hdr,
rle_hdr out_hdr,
int  ypos,
int num_skip,
rle_op **  out_raw,
int out_nraw,
int  blank_output 
)

Definition at line 472 of file rlecomp.c.

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 }
void rle_skiprow(rle_hdr *the_hdr, int nrow)
Definition: rle_putrow.c:393
#define RRunDataOp
Definition: rle_code.h:41
int xmin
Definition: rle.h:100
void rle_freeraw(rle_hdr *the_hdr, scanraw, nraw)
Definition: rle_getraw.c:268
int length
Definition: rle_raw.h:51
int opcode
Definition: rle_raw.h:49
int * out_nraw
Definition: unslice.c:40
rle_pixel * non_zero_pixels
Definition: rlecomp.c:64
int * bg_color
Definition: rle.h:100
int run_val
Definition: rle_raw.h:54
int xloc
Definition: rle_raw.h:50
void rle_putraw()
int xmax
Definition: rle.h:100
int num_skip
Definition: unslice.c:43
int * ptr
Definition: scanargs.c:57
rle_pixel * pixels
Definition: rle_raw.h:53
unsigned char rle_pixel
Definition: rle.h:56
int i
Definition: rletorla.c:82
int alpha
Definition: rle.h:100
#define RLE_ALPHA
Definition: rle.h:65
union rle_op::@7 u
Definition: rle_raw.h:47
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
void get_scanline ( )
void get_scanline ( rle_hdr the_hdr,
rle_pixel **  scanline,
int num_skip,
rle_op **  tmp_raw,
int tmp_nraw 
)

Definition at line 422 of file rlecomp.c.

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 }
int xmin
Definition: rle.h:100
void rle_freeraw(rle_hdr *the_hdr, scanraw, nraw)
Definition: rle_getraw.c:268
int * bg_color
Definition: rle.h:100
int xmax
Definition: rle.h:100
int num_skip
Definition: unslice.c:43
int i
Definition: rletorla.c:82
int alpha
Definition: rle.h:100
#define RLE_ALPHA
Definition: rle.h:65
void rle_rawtorow()
unsigned char scanline[4][1280]
Definition: get_orion.c:37
int rle_getrow(rle_hdr *the_hdr, rle_pixel *scanline[])
int ncolors
Definition: rle.h:100
void main ( int  argc,
argv   
)

Definition at line 67 of file rlecomp.c.

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;
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 }
#define RLE_SET_BIT(glob, bit)
Definition: rle.h:122
void rle_row_free(rle_hdr *the_hdr, rle_pixel **scanp)
Definition: rle_row_alc.c:114
void rle_skiprow(rle_hdr *the_hdr, int nrow)
Definition: rle_putrow.c:393
int xmin
Definition: rle.h:100
#define SUBTRACT_OP
Definition: rlecomp.c:52
int scanargs(int argc, char **argv, const char *format,...)
Definition: scanargs.c:94
int * Bnraw
Definition: rlecomp.c:63
FILE * outfile
Definition: giftorle.c:61
int rle_row_alloc(rle_hdr *the_hdr, rle_pixel ***scanp)
Definition: rle_row_alc.c:56
#define ATOP_OP
Definition: rlecomp.c:46
rle_op ** Braw
Definition: rlecomp.c:62
#define RLE_EMPTY
Definition: rle.h:73
int rle_raw_alloc()
rle_pixel * non_zero_pixels
Definition: rlecomp.c:64
void rle_putrow(rle_pixel *rows[], int rowlen, rle_hdr *the_hdr)
#define IN_OP
Definition: rlecomp.c:44
int * bg_color
Definition: rle.h:100
void rle_addhist(char *argv[], rle_hdr *in_hdr, rle_hdr *out_hdr)
#define RLE_SUCCESS
Definition: rle.h:70
void rle_raw_free()
#define PLUS_OP
Definition: rlecomp.c:48
int ymin
Definition: rle.h:100
#define MAX(i, j)
Definition: rlecomp.c:36
void rle_puteof(rle_hdr *the_hdr)
Definition: rle_putrow.c:474
unsigned char ** scan
Definition: rle.c:26
#define ADD_OP
Definition: rlecomp.c:51
void rle_names(rle_hdr *the_hdr, const char *pgmname, const char *fname, int img_num)
#define OUT_OP
Definition: rlecomp.c:45
const char * cmd
Definition: rle.h:133
int rle_get_setup(rle_hdr *the_hdr)
Definition: rle_getrow.c:74
Definition: rle.h:96
#define NUM_OPS
Definition: rlecomp.c:40
int xmax
Definition: rle.h:100
#define MALLOC_ERR
Definition: rlecomp.c:38
static char temp[]
Definition: into.c:45
int rle_get_error(int code, const char *pgmname, const char *fname)
#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 get_scanline()
int * Anraw
Definition: rlecomp.c:63
rle_pixel ** rows
Definition: rletopaint.c:57
int
Definition: getami.c:848
int ymax
Definition: rle.h:100
unsigned char rle_pixel
Definition: rle.h:56
#define OVER_OP
Definition: rlecomp.c:43
void copy_scanline()
rle_hdr * rle_hdr_cp(rle_hdr *from_hdr, rle_hdr *to_hdr)
Definition: rle_hdr.c:119
void * malloc()
int i
Definition: rletorla.c:82
int alpha
Definition: rle.h:100
#define RLE_ALPHA
Definition: rle.h:65
FILE * rle_open_f(const char *prog_name, const char *f_name, const char *mode)
#define XOR_OP
Definition: rlecomp.c:47
void rle_put_setup(rle_hdr *the_hdr)
Definition: rle_putrow.c:453
#define MIN(i, j)
Definition: rlecomp.c:37
char * cmd_name(char **argv)
Definition: cmd_name.c:31
rle_op ** Araw
Definition: rlecomp.c:62
int oflag
Definition: painttorle.c:45
FILE * rle_file
Definition: rle.h:114
rle_hdr out_hdr
Definition: dvirle2.c:89
int ncolors
Definition: rle.h:100
#define RLE_CHECK_ALLOC(pgm, ptr, name)
Definition: rle.h:86
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)
Definition: rle_hdr.c:267
#define MINUS_OP
Definition: rlecomp.c:49
#define DIFF_OP
Definition: rlecomp.c:50

Variable Documentation

int* Anraw

Definition at line 63 of file rlecomp.c.

rle_op** Araw

Definition at line 62 of file rlecomp.c.

int * Bnraw

Definition at line 63 of file rlecomp.c.

rle_op ** Braw

Definition at line 62 of file rlecomp.c.

rle_pixel* non_zero_pixels

Definition at line 64 of file rlecomp.c.