21 #include "starbase.c.h"
27 #define MAX(i,j) ((i) > (j) ? (i) : (j))
33 #define MAX_X_SIZE 1280
84 int dev_xmax,dev_ymax;
90 "% m%- O%- d%-display!s x%-driver!s p%-xstart!dystart!d s%-xsize!dysize!d \
91 b%-rbak!dgbak!dbbak!d o%-fname!s comments%*s",
107 fprintf(stderr,
"read98721: incompatible options -O and -b\n");
112 setup_graphics_device(&dev_xmax,&dev_ymax);
116 fprintf(stderr,
"%s: null image size\n", the_hdr
.cmd);
141 the_hdr
.bits[0] = 0x07;
150 rows[i] = scanline[i];
154 read_scanline(y,rows);
165 int *dev_xmax,*dev_ymax;
167 float p_lim[2][3],res[3],p1[3],p2[3];
170 picture_fd = gopen(display_name,OUTDEV,driver_name,0);
172 fprintf(stderr,
"read98721: can't open device.\n");
175 shade_mode(picture_fd,CMAP_FULL,
FALSE);
178 inquire_sizes(
picture_fd,p_lim,res,p1,p2,&map_size);
189 *dev_xmax =
MAX(p_lim[0][0],p_lim[1][0]) + 1.0;
190 *dev_ymax =
MAX(p_lim[0][1],p_lim[1][1]) + 1.0;
193 mapping_mode(picture_fd,DISTORT);
196 vdc_extent(
picture_fd,0.0,0.0,0.0,(
float)(*dev_xmax)-1.0,
197 (
float)(*dev_ymax)-1.0,0.0);
198 clip_rectangle(
picture_fd,0.0,(
float)(*dev_xmax)-1.0,
199 0.0,(
float)(*dev_ymax)-1.0);
204 int dev_xmax,dev_ymax,*xstart,*ystart,*xsize,*ysize;
214 if(*xstart + *xsize > dev_xmax)
215 *xsize = dev_xmax - *xstart;
216 if(*ystart + *ysize > dev_ymax)
217 *ysize = dev_ymax - *ystart;
224 unsigned char *rows[];
244 inquire_color_table(pic_fd,0,
COLMAPLEN,colmap);
249 rmap[i] = colmap[i][2];
250 gmap[i] = colmap[i][1];
251 bmap[i] = colmap[i][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 scanargs(int argc, char **argv, const char *format,...)
void rle_puteof(rle_hdr *the_hdr)
void rle_putrow(rows, int rowlen, rle_hdr *the_hdr)
void rle_addhist(argv, rle_hdr *in_hdr, rle_hdr *out_hdr)
clip(int dev_xmax, int dev_ymax, int *xstart, int *ystart, int *xsize, int *ysize)
read_color_maps(int pic_fd, rle_map *cmap)
void rle_put_setup(rle_hdr *the_hdr)
const char * rle_putcom(char *value, rle_hdr *the_hdr) const
read_scanline(rle_hdr *the_hdr, int y, rows)
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)
setup_graphics_device(int *dev_xmax, int *dev_ymax)