#include "stdio.h"
#include "rle_put.h"
#include "rle.h"
#include "rle_code.h"
Go to the source code of this file.
|
#define | UPPER 255 /* anything bigger ain't a byte */ |
|
#define | put16(a) (putc((a)&0xff,rle_fd),putc(((a)>>8)&0xff,rle_fd)) |
|
#define | mk_short_1(oper, a1) |
|
#define | mk_short_2(oper, a1, a2) |
|
#define | mk_long_1(oper, a1) |
|
#define | mk_long_2(oper, a1, a2) |
|
#define | mk_inst_1(oper, a1) |
|
#define | mk_inst_2(oper, a1, a2) |
|
#define | RSkipLines(n) mk_inst_1(RSkipLinesOp,(n)) |
|
#define | RSetColor(c) mk_short_1(RSetColorOp,(c)) |
|
#define | RSkipPixels(n) mk_inst_1(RSkipPixelsOp,(n)) |
|
#define | RNewLine RSkipLines(1) |
|
#define | RByteData(n) mk_inst_1(RByteDataOp,n) |
|
#define | RRunData(n, c) mk_inst_2(RRunDataOp,(n),(c)) |
|
#define | REOF mk_inst_1(REOFOp,0) |
|
|
char * | vax_pshort () |
|
void | RunSetup (rle_hdr *the_hdr) |
|
void | RunSkipBlankLines (int nblank, rle_hdr *the_hdr) |
|
void | RunSetColor (int c, rle_hdr *the_hdr) |
|
void | RunSkipPixels (int nskip, int last, int wasrun, rle_hdr *the_hdr) |
|
void | RunNewScanLine (int flag, rle_hdr *the_hdr) |
|
void | Runputdata (rle_pixel *buf, int n, rle_hdr *the_hdr) |
|
void | Runputrun (int color, int n, int last, rle_hdr *the_hdr) |
|
void | RunputEof (rle_hdr *the_hdr) |
|
#define mk_inst_1 |
( |
|
oper, |
|
|
|
a1 |
|
) |
| |
Value: \
#define mk_short_1(oper, a1)
#define mk_long_1(oper, a1)
Definition at line 124 of file Runput.c.
#define mk_inst_2 |
( |
|
oper, |
|
|
|
a1, |
|
|
|
a2 |
|
) |
| |
Value: \
#define mk_short_2(oper, a1, a2)
#define mk_long_2(oper, a1, a2)
Definition at line 127 of file Runput.c.
#define mk_long_1 |
( |
|
oper, |
|
|
|
a1 |
|
) |
| |
Value: \
putc((
char)(
LONG|oper),rle_fd), putc(
'\0', rle_fd),
put16(a1)
Definition at line 114 of file Runput.c.
#define mk_long_2 |
( |
|
oper, |
|
|
|
a1, |
|
|
|
a2 |
|
) |
| |
Value: \
putc((
char)(
LONG|oper),rle_fd), putc(
'\0', rle_fd), \
Definition at line 117 of file Runput.c.
#define mk_short_1 |
( |
|
oper, |
|
|
|
a1 |
|
) |
| |
Value: \
putc(oper,rle_fd), putc((char)a1,rle_fd)
Definition at line 107 of file Runput.c.
#define mk_short_2 |
( |
|
oper, |
|
|
|
a1, |
|
|
|
a2 |
|
) |
| |
Value: \
putc(oper,rle_fd), putc((
char)a1,rle_fd),
put16(a2)
Definition at line 110 of file Runput.c.
#define put16 |
( |
|
a | ) |
(putc((a)&0xff,rle_fd),putc(((a)>>8)&0xff,rle_fd)) |
#define UPPER 255 /* anything bigger ain't a byte */ |
void RunNewScanLine |
( |
int |
flag, |
|
|
rle_hdr * |
the_hdr |
|
) |
| |
Definition at line 328 of file Runput.c.
333 register FILE * rle_fd = the_hdr->
rle_file;
338 fwrite((
char *)
buf, n, 1, rle_fd);
void RunputEof |
( |
rle_hdr * |
the_hdr | ) |
|
Definition at line 165 of file Runput.c.
169 register FILE * rle_fd = the_hdr->
rle_file;
179 if ( the_hdr->
alpha )
184 setup.h_ncolors = the_hdr->
ncolors;
185 setup.h_pixelbits = 8;
186 if ( the_hdr->
ncmap > 0 && the_hdr->
cmap == NULL )
189 "%s: Color map of size %d*%d specified, but not supplied, writing %s\n",
194 setup.h_cmaplen = the_hdr->
cmaplen;
195 setup.h_ncmap = the_hdr->
ncmap;
200 fwrite((
char *)&setup,
SETUPSIZE, 1, rle_fd);
212 for ( i = 0; i < the_hdr->
ncolors; i++ )
213 background[i] = *bg_color++;
216 fwrite((
char *)background, (the_hdr->
ncolors / 2) * 2 + 1, 1, rle_fd);
220 putc(
'\0', rle_fd );
221 if (the_hdr->
ncmap > 0)
224 register int i, nmap = (1 << the_hdr->
cmaplen) *
226 register char *h_cmap = (
char *)
malloc( nmap * 2 );
227 if ( h_cmap == NULL )
230 "%s: Malloc failed for color map of size %d, writing %s\n",
234 for ( i = 0; i < nmap; i++ )
237 fwrite( h_cmap, nmap, 2, rle_fd );
249 for ( com_p = the_hdr->
comments; *com_p != NULL; com_p++ )
250 comlen += 1 + strlen( *com_p );
253 for ( com_p = the_hdr->
comments; *com_p != NULL; com_p++ )
254 fwrite( *com_p, 1, strlen( *com_p ) + 1, rle_fd );
257 putc(
'\0', rle_fd );
void RunSkipBlankLines |
( |
int |
nblank, |
|
|
rle_hdr * |
the_hdr |
|
) |
| |
Definition at line 295 of file Runput.c.
299 register FILE * rle_fd = the_hdr->
rle_file;
300 if (! last && nskip > 0)