00001 /* 00002 * This software is copyrighted as noted below. It may be freely copied, 00003 * modified, and redistributed, provided that the copyright notice is 00004 * preserved on all copies. 00005 * 00006 * There is no warranty or other guarantee of fitness for this software, 00007 * it is provided solely "as is". Bug reports or fixes may be sent 00008 * to the author, who may or may not act on them as he desires. 00009 * 00010 * You may not include this software in a program or other software product 00011 * without supplying the source, or without informing the end-user that the 00012 * source is available for no extra charge. 00013 * 00014 * If you modify this software, you should include a notice giving the 00015 * name of the person performing the modification, the date of modification, 00016 * and the reason for such modification. 00017 */ 00018 /** @addtogroup utahrle */ 00019 /*@{*/ 00020 /** 00021 * @file rle_raw.h - Definitions for rle_getraw/rle_putraw. 00022 * 00023 * Author: Spencer W. Thomas 00024 * Computer Science Dept. 00025 * University of Utah 00026 * Date: Mon Jul 7 1986 00027 * Copyright (c) 1986, Spencer W. Thomas 00028 */ 00029 00030 #ifndef RLE_RAW_H 00031 #define RLE_RAW_H 00032 00033 00034 #ifdef __cplusplus /* Cfront 2.0 or g++ */ 00035 #ifndef c_plusplus 00036 #define c_plusplus 00037 #endif 00038 extern "C" { 00039 #endif 00040 00041 #include "rle_code.h" 00042 00043 /***************************************************************** 00044 * TAG( rle_op ) 00045 * 00046 * Struct representing one rle opcode. 00047 */ 00048 00049 typedef 00050 struct rle_op { 00051 int opcode; /* one of RByteDataOp or RRunDataOp */ 00052 int xloc; /* X location this op starts at */ 00053 int length; /* length of run or data */ 00054 union a { 00055 rle_pixel * pixels; /* for ByteData */ 00056 int run_val; /* for RunData */ 00057 } u; 00058 } rle_op; 00059 00060 #ifdef USE_PROTOTYPES 00061 /***************************************************************** 00062 * TAG( rle_raw_alloc ) 00063 * 00064 * Allocate buffer space for use by rle_getraw and rle_putraw. 00065 */ 00066 extern int 00067 rle_raw_alloc( rle_hdr *the_hdr, rle_op ***scanp, int **nrawp ); 00068 00069 /***************************************************************** 00070 * TAG( rle_raw_free ) 00071 * 00072 * Free buffer space allocated by rle_raw_alloc. 00073 */ 00074 extern void rle_raw_free( rle_hdr *the_hdr, rle_op **scanp, int *nrawp ); 00075 00076 /***************************************************************** 00077 * TAG( rle_getraw ) 00078 * 00079 * Get a raw scanline from the input file. 00080 */ 00081 extern unsigned int 00082 rle_getraw( rle_hdr *the_hdr, rle_op *scanraw[], int nraw[] ); 00083 00084 /***************************************************************** 00085 * TAG( rle_freeraw ) 00086 * 00087 * Free all the pixel arrays in the raw scan struct. 00088 */ 00089 extern void 00090 rle_freeraw( rle_hdr * the_hdr, rle_op *scanraw[], int nraw[] ); 00091 00092 /***************************************************************** 00093 * TAG( rle_putraw ) 00094 * 00095 * Put raw scanline data to the output file. 00096 */ 00097 extern void 00098 rle_putraw( rle_op **scanraw, int *nraw, rle_hdr *the_hdr ); 00099 00100 /***************************************************************** 00101 * TAG( rle_rawtorow ) 00102 * 00103 * Convert raw data to "row" type scanline data. 00104 */ 00105 extern void 00106 rle_rawtorow( rle_hdr *the_hdr, rle_op **scanraw, int *nraw, 00107 rle_pixel **outrows ); 00108 #else 00109 /* Return value decls only. See above for detailed declarations. */ 00110 /* From rle_getraw.c. */ 00111 extern unsigned int rle_getraw(); 00112 extern void rle_freeraw(); 00113 /* From rle_putraw.c. */ 00114 extern void rle_putraw(); 00115 /* From rle_raw_alc.c. */ 00116 extern int rle_raw_alloc(); 00117 extern void rle_raw_free(); 00118 /* From rle_rawrow.c. */ 00119 extern void rle_rawtorow(); 00120 00121 #endif 00122 00123 #ifdef __cplusplus 00124 } 00125 #endif 00126 00127 #endif /* RLE_RAW_H */ 00128 /*@}*/