104 #define put16(a) (putc
((a)&0xff
,rle_fd),putc
(((a)>>8
)&0xff
,rle_fd))
107 #define mk_short_1(oper,a1)
108 putc
(oper,rle_fd), putc
((char)a1,rle_fd)
110 #define mk_short_2(oper,a1,a2)
111 putc
(oper,rle_fd), putc
((char)a1,rle_fd), put16(a2)
114 #define mk_long_1(oper,a1)
115 putc
((char)(LONG|oper),rle_fd), putc
('\0', rle_fd), put16(a1)
117 #define mk_long_2(oper,a1,a2)
118 putc
((char)(LONG|oper),rle_fd), putc
('\0', rle_fd),
124 #define mk_inst_1(oper,a1)
127 #define mk_inst_2(oper,a1,a2)
166 register rle_hdr * the_hdr;
189 "%s: Color map of size %d*%d specified, but not supplied, writing %s\n",
200 fwrite((
char *)&setup,
SETUPSIZE, 1, rle_fd);
206 register int *bg_color;
213 background[i] = *bg_color++;
216 fwrite((
char *)background, (the_hdr
->ncolors / 2) * 2 + 1, 1, rle_fd);
220 putc(
'\0', rle_fd );
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 );
268 register rle_hdr * the_hdr;
282 register rle_hdr * the_hdr;
296 int nskip, last, wasrun;
297 register rle_hdr * the_hdr;
300 if (! last && nskip > 0)
314 register rle_hdr * the_hdr;
331 register rle_hdr * the_hdr;
338 fwrite((
char *)buf, n, 1, rle_fd);
352 register rle_hdr * the_hdr;
365 register rle_hdr * the_hdr;
void RunSetColor(int c, rle_hdr *the_hdr)
void Runputdata(rle_pixel *buf, int n, rle_hdr *the_hdr)
#define mk_inst_1(oper, a1)
#define mk_short_1(oper, a1)
void RunSkipBlankLines(int nblank, rle_hdr *the_hdr)
void RunSkipPixels(int nskip, int last, int wasrun, rle_hdr *the_hdr)
#define mk_inst_2(oper, a1, a2)
#define mk_short_2(oper, a1, a2)
char * vax_pshort(char *msgp, unsigned short s)
#define mk_long_2(oper, a1, a2)
void RunputEof(rle_hdr *the_hdr)
void RunNewScanLine(int flag, rle_hdr *the_hdr)
void RunSetup(rle_hdr *the_hdr)
void Runputrun(int color, int n, int last, rle_hdr *the_hdr)
#define mk_long_1(oper, a1)