Utah Raster Toolkit  9999-git
URT Development version (post-3.1b)
rle_raw.h
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  * rle_raw.h - Definitions for rle_getraw/rle_putraw.
20  *
21  * Author: Spencer W. Thomas
22  * Computer Science Dept.
23  * University of Utah
24  * Date: Mon Jul 7 1986
25  * Copyright (c) 1986, Spencer W. Thomas
26  */
27 
28 #ifndef RLE_RAW_H
29 #define RLE_RAW_H
30 
31 
32 #ifdef __cplusplus /* Cfront 2.0 or g++ */
33 #ifndef c_plusplus
34 #define c_plusplus
35 #endif
36 extern "C" {
37 #endif
38 
39 #include "rle_code.h"
40 
41 /*****************************************************************
42  * TAG( rle_op )
43  *
44  * Struct representing one rle opcode.
45  */
46 
47 typedef
48 struct rle_op {
49  int opcode; /* one of RByteDataOp or RRunDataOp */
50  int xloc; /* X location this op starts at */
51  int length; /* length of run or data */
52  union {
53  rle_pixel * pixels; /* for ByteData */
54  int run_val; /* for RunData */
55  } u;
56 } rle_op;
57 
58 #ifdef USE_PROTOTYPES
59  /*****************************************************************
60  * TAG( rle_raw_alloc )
61  *
62  * Allocate buffer space for use by rle_getraw and rle_putraw.
63  */
64  extern int
65  rle_raw_alloc( rle_hdr *the_hdr, rle_op ***scanp, int **nrawp );
66 
67  /*****************************************************************
68  * TAG( rle_raw_free )
69  *
70  * Free buffer space allocated by rle_raw_alloc.
71  */
72  extern void rle_raw_free( rle_hdr *the_hdr, rle_op **scanp, int *nrawp );
73 
74  /*****************************************************************
75  * TAG( rle_getraw )
76  *
77  * Get a raw scanline from the input file.
78  */
79  extern unsigned int
80  rle_getraw( rle_hdr *the_hdr, rle_op *scanraw[], int nraw[] );
81 
82  /*****************************************************************
83  * TAG( rle_freeraw )
84  *
85  * Free all the pixel arrays in the raw scan struct.
86  */
87  extern void
88  rle_freeraw( rle_hdr * the_hdr, rle_op *scanraw[], int nraw[] );
89 
90  /*****************************************************************
91  * TAG( rle_putraw )
92  *
93  * Put raw scanline data to the output file.
94  */
95  extern void
96  rle_putraw( rle_op **scanraw, int *nraw, rle_hdr *the_hdr );
97 
98  /*****************************************************************
99  * TAG( rle_rawtorow )
100  *
101  * Convert raw data to "row" type scanline data.
102  */
103  extern void
104  rle_rawtorow( rle_hdr *the_hdr, rle_op **scanraw, int *nraw,
105  rle_pixel **outrows );
106 #else
107  /* Return value decls only. See above for detailed declarations. */
108  /* From rle_getraw.c. */
109  extern unsigned int rle_getraw();
110  extern void rle_freeraw();
111  /* From rle_putraw.c. */
112  extern void rle_putraw();
113  /* From rle_raw_alc.c. */
114  extern int rle_raw_alloc();
115  extern void rle_raw_free();
116  /* From rle_rawrow.c. */
117  extern void rle_rawtorow();
118 
119 #endif
120 
121 #ifdef __cplusplus
122 }
123 #endif
124 
125 #endif /* RLE_RAW_H */
void rle_freeraw(rle_hdr *the_hdr, scanraw, nraw)
Definition: rle_getraw.c:268
#define USE_PROTOTYPES
Definition: rle_config.h:22
int length
Definition: rle_raw.h:51
int rle_raw_alloc(rle_hdr *the_hdr, rle_op ***scanp, int **nrawp)
Definition: rle_raw_alc.c:60
int opcode
Definition: rle_raw.h:49
void rle_putraw(rle_op **scanraw, int *nraw, rle_hdr *the_hdr)
Definition: rle_putraw.c:60
void rle_rawtorow(rle_hdr *the_hdr, rle_op **raw, int *nraw, rle_pixel **outrows)
Definition: rle_rawrow.c:31
int xloc
Definition: rle_raw.h:50
unsigned char rle_pixel
Definition: rle.h:56
void rle_raw_free(rle_hdr *the_hdr, rle_op **scanp, nrawp)
Definition: rle_raw_alc.c:131
Definition: rle_raw.h:47
unsigned int rle_getraw(rle_hdr *the_hdr, scanraw, nraw)
Definition: rle_getraw.c:78