14 #define MIN(a,b) ( a<b ? a : b)
16 #include <starbase.c.h>
24 #define RASTERHEIGHT 1024
27 int argc;
char *argv[];
30 int x_len, y_len, x_off = 0, y_off = 0;
31 int i, j, map_offset ;
34 char * filename = NULL;
39 gescape_arg arg1, arg2;
42 "% pP%-xpos!dypos!d O%- d%-display!s x%-driver!s infile%s",
43 &pos_flag
, &x_off
, &y_off
, &over_flag
,
55 if (( fildes = gopen(display_name, OUTDEV,
56 driver_name, over_flag )) < 0)
57 fprintf(stderr,
"%s: can't open %s\n", hdr.cmd, display_name);
64 clip_indicator( fildes, CLIP_OFF );
67 gescape( fildes, SWITCH_SEMAPHORE, &arg1, &arg2 );
70 shade_mode( fildes, CMAP_FULL, 0 );
77 for (i = 0; i < 256; i++)
79 colors[i][0] = (
float) ((hdr
.cmap[i] >>8) & 0xFF)
81 colors[i][1] = (
float) ((hdr
.cmap[i+map_offset] >>8)
83 colors[i][2] = (
float) ((hdr
.cmap[i+2*map_offset]>>8)
90 for (i = 0; i < 256; i++)
92 tmp = (
float) ((hdr
.cmap[i] >> 8) * 0xFF);
100 fprintf(stderr,
"%s: Sorry, don't grock %d channel color maps\n",
108 for (i = 0; i < 256; i++)
110 tmp = (
float) i / 255.0;
116 define_color_table( fildes, 0, 256, colors );
124 x_off = hdr
.xmin + x_off;
146 for ( i = 0; i < y_len ; i ++)
153 bank_switch( fildes, 2-j, 0 );
154 dcblock_write( fildes, x_off, y_off - i,
155 x_len, 1, scan[j], 0 );
161 bank_switch( fildes, 2-j, 1 );
162 dcblock_write( fildes, x_off, y_off - i,
163 x_len, 1, scan[0], 0 );
FILE * rle_open_f(char *prog_name, char *file_name, char *mode)
void rle_names(rle_hdr *the_hdr, const char *pgmname, const char *fname, int img_num)
char * cmd_name(char **argv)
void main(int argc, char **argv)
int rle_row_alloc(rle_hdr *the_hdr, rle_pixel ***scanp)
int rle_getrow(rle_hdr *the_hdr, scanline)
int scanargs(int argc, char **argv, const char *format,...)
void rle_get_setup_ok(rle_hdr *the_hdr, const char *prog_name, const char *file_name)
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)
#define RLE_CHECK_ALLOC(pgm, ptr, name)