Path: utzoo!attcan!uunet!husc6!bloom-beacon!bu-cs!purdue!decwrl!ucbvax!pasteur!ames!oliveb!sun!vygr!mae From: mae%vygr@Sun.COM (Mike Ekberg, Sun {Graphics Product Division}) Newsgroups: comp.graphics Subject: Re: Sun rasterfiles. Message-ID: <54042@sun.uucp> Date: 20 May 88 22:01:16 GMT References: <1051@luth.luth.se> <818@imagine.PAWL.RPI.EDU> Sender: news@sun.uucp Reply-To: mae@sun.UUCP (Mike Ekberg, Sun {Graphics Product Division}) Organization: Sun Microsystems, Mountain View Lines: 61 Check out Pixrects manual, p 41. "...This support is implemented by passing raster files with non-standard types through filters founbd in /usr/lib/rasfilters. This directory also includes sample source code for a filter ..." Also, here's a start: /* dumprf.c - dump rasterfile formater */ #include #include #include FILE * fp; main(argc, argv) int argc; char **argv; { Pixrect *pr; struct rasterfile rh; colormap_t colormap; if( (fp = fopen(argv[1],"r")) == NULL) { perror(argv[1]); exit(-1); } if( pr_load_header(fp,&rh) == PIX_ERR) { perror("Header"); exit(-1); } dump_rh(&rh); if( pr_load_colormap(fp,&rh,&colormap) == PIX_ERR) { perror("Colormap"); exit(-1); } if( (pr = pr_load_image(fp,&rh,&colormap)) == NULL) { perror("Image"); exit(-1); } } dump_rh(rh) /* dump rasterefile header */ struct rasterfile *rh; { printf("ras_magic = 0x%x.\n",rh->ras_magic); printf("ras_width = 0x%x.\n",rh->ras_width); printf("ras_height = 0x%x.\n",rh->ras_height); printf("ras_depth = 0x%x.\n",rh->ras_depth); printf("ras_length = 0x%x.\n",rh->ras_length); printf("ras_type = 0x%x.\n",rh->ras_type); printf("ras_maptype = 0x%x.\n",rh->ras_maptype); printf("ras_maplength = 0x%x.\n",rh->ras_maplength); } mike (sun!mae), M/S 5-40 "There's nothing human that's alien to us." - A. Einstein