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

Go to the source code of this file.

Functions

void rle_putraw (rle_op **scanraw, int *nraw, rle_hdr *the_hdr)
 

Variables

static char rcs_ident [] = "$Id: rle_putraw.c,v 3.0.1.1 1992/01/28 18:25:24 spencer Exp $"
 

Function Documentation

void rle_putraw ( rle_op **  scanraw,
int nraw,
rle_hdr the_hdr 
)

Definition at line 60 of file rle_putraw.c.

64 {
65  register int channel;
66  int scan_x,
67  i,
68  n_op;
69  register rle_op * scan_r;
70 
71  for ( channel = (the_hdr->alpha ? -1 : 0);
72  channel < the_hdr->ncolors;
73  channel++ )
74  {
75  if ( ! RLE_BIT( *the_hdr, channel ) || nraw[channel] == 0 )
76  {
77  continue;
78  }
79 
80  /* If really data on this scanline, skip to here */
81  if ( the_hdr->priv.put.nblank > 0 )
82  {
83  SkipBlankLines( the_hdr->priv.put.nblank );
84  the_hdr->priv.put.nblank = 0;
85  }
86 
87  SetColor( channel );
88  n_op = nraw[channel] - 1;
89  scan_x = the_hdr->xmin;
90  for ( i = 0, scan_r = scanraw[channel]; i <= n_op; i++, scan_r++ )
91  {
92  if ( scan_r->xloc > scan_x )
93  SkipPixels( scan_r->xloc - scan_x, 0,
94  i > 0 && (scan_r - 1)->opcode == RRunDataOp );
95  scan_x = scan_r->xloc + scan_r->length;
96  switch( scan_r->opcode )
97  {
98  case RRunDataOp:
99  putrun( scan_r->u.run_val, scan_r->length,
100  i < n_op && scan_x == (scan_r + 1)->xloc );
101  break;
102 
103  case RByteDataOp:
104  putdata( scan_r->u.pixels, scan_r->length );
105  break;
106  }
107  }
108  if ( scan_x <= the_hdr->xmax )
109  SkipPixels( the_hdr->xmax - scan_x,
110  1,
111  i > 0 && (scan_r - 1)->opcode == RRunDataOp );
112  if ( channel != the_hdr->ncolors - 1 )
113  NewScanLine( 0 );
114  }
115 
116  the_hdr->priv.put.nblank++; /* increment to next scanline */
117  /* Flush each scanline */
118 /* fflush( the_hdr->rle_file );*/
119 }
#define RRunDataOp
Definition: rle_code.h:41
int xmin
Definition: rle.h:100
#define SkipPixels(n, l, r)
Definition: rle_put.h:78
int length
Definition: rle_raw.h:51
int opcode
Definition: rle_raw.h:49
struct rle_hdr::@0::@2 put
#define putrun(val, len, f)
Definition: rle_put.h:81
#define SetColor(c)
Definition: rle_put.h:77
int run_val
Definition: rle_raw.h:54
int xloc
Definition: rle_raw.h:50
union rle_hdr::@0 priv
int xmax
Definition: rle.h:100
#define SkipBlankLines(n)
Definition: rle_put.h:76
#define NewScanLine(flag)
Definition: rle_put.h:79
rle_pixel * pixels
Definition: rle_raw.h:53
#define putdata(buf, len)
Definition: rle_put.h:80
int i
Definition: rletorla.c:82
int alpha
Definition: rle.h:100
union rle_op::@7 u
Definition: rle_raw.h:47
int ncolors
Definition: rle.h:100
#define RByteDataOp
Definition: rle_code.h:40
#define RLE_BIT(glob, bit)
Definition: rle.h:126

Variable Documentation

char rcs_ident[] = "$Id: rle_putraw.c,v 3.0.1.1 1992/01/28 18:25:24 spencer Exp $"
static

Definition at line 31 of file rle_putraw.c.