#include <stdio.h>
#include "rle.h"
Go to the source code of this file.
|
void | read_cubi_hdr () |
|
void | read_cubi_row () |
|
void | read_cubi_chan () |
|
void | bit_read () |
|
void | main (int argc, argv) |
|
void | read_cubi_hdr (cubifiles, short *xlen, short *ylen) |
|
void | read_cubi_row (cubifiles, rle_pixel **rows) |
|
void | read_cubi_chan (FILE *infile, rle_pixel **rows, int chan) |
|
void | bit_read (FILE *infile, char headchar, int bit, rle_pixel **rows, int chan, int *xpos) |
|
void bit_read |
( |
FILE * |
infile, |
|
|
char |
headchar, |
|
|
int |
bit, |
|
|
rle_pixel ** |
rows, |
|
|
int |
chan, |
|
|
int * |
xpos |
|
) |
| |
Definition at line 152 of file cubitorle.c.
158 unsigned char runlength, rundata, bytedata;
161 if (headchar & (1 <<
bit))
165 runlength = fgetc(
infile);
166 for (i=(*xpos); i < runlength+(*xpos); i++)
167 rows[chan][i] = rundata;
168 *xpos += (
int) runlength;
174 rows[chan][*xpos] = bytedata;
void main |
( |
int |
argc, |
|
|
argv |
|
|
) |
| |
Definition at line 35 of file cubitorle.c.
43 int cubi_xlen, cubi_ylen;
44 char *
infname = NULL, *outfname = NULL;
49 "% o%-outfile!s inprefix!s\n(\
50 \tConvert Cubicomp image to URT image. Input image is in 3 files,\n\
51 \tinprefix.r, inprefix.g, inprefix.b.)",
52 &oflag, &outfname, &infname ) == 0 )
58 for ( i = 0; i < 3; i++ )
60 sprintf( filename,
"%s.%c8", infname,
"rgb"[i] );
79 fprintf( stderr,
"%s: malloc failed\n", hdr.
cmd );
int scanargs(int argc, char **argv, const char *format,...)
int rle_row_alloc(rle_hdr *the_hdr, rle_pixel ***scanp)
void rle_putrow(rle_pixel *rows[], int rowlen, rle_hdr *the_hdr)
void rle_addhist(char *argv[], rle_hdr *in_hdr, rle_hdr *out_hdr)
void rle_names(rle_hdr *the_hdr, const char *pgmname, const char *fname, int img_num)
FILE * rle_open_f(const char *prog_name, const char *f_name, const char *mode)
void rle_put_setup(rle_hdr *the_hdr)
char * cmd_name(char **argv)
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)
void read_cubi_chan |
( |
FILE * |
infile, |
|
|
rle_pixel ** |
rows, |
|
|
int |
chan |
|
) |
| |
Definition at line 123 of file cubitorle.c.
128 static char headchar[3];
129 static int scanfull[3] = {-1, -1, -1};
134 if (scanfull[chan] == -1)
135 headchar[chan] = fgetc(
infile);
138 if (scanfull[chan] <=
bit)
143 scanfull[chan] =
bit + 1;
147 if (
bit >= 7) scanfull[chan] = -1;
void read_cubi_hdr |
( |
cubifiles |
, |
|
|
short * |
xlen, |
|
|
short * |
ylen |
|
) |
| |
Definition at line 92 of file cubitorle.c.
97 short xmin, ymin, xmax, ymax;
99 fread(junk,
sizeof(
char), 12, cubifiles[0]);
100 fread(xlen,
sizeof(
short), 1, cubifiles[0]);
101 fread(ylen,
sizeof(
short), 1, cubifiles[0]);
102 fread(&xmin,
sizeof(
short), 1, cubifiles[0]);
103 fread(&ymin,
sizeof(
short), 1, cubifiles[0]);
104 fread(&xmax,
sizeof(
short), 1, cubifiles[0]);
105 fread(&ymax,
sizeof(
short), 1, cubifiles[0]);
106 fread(junk,
sizeof(
char), 104, cubifiles[0]);
108 fread(junk,
sizeof(
char), 128, cubifiles[1]);
109 fread(junk,
sizeof(
char), 128, cubifiles[2]);
void read_cubi_row |
( |
cubifiles |
, |
|
|
rle_pixel ** |
rows |
|
) |
| |