Path: utzoo!attcan!uunet!husc6!purdue!decwrl!sun!david From: david@sun.uucp (David DiGiacomo) Newsgroups: comp.graphics Subject: Re: Sun rasterfiles. Message-ID: <54078@sun.uucp> Date: 21 May 88 01:06:20 GMT References: <1051@luth.luth.se> <818@imagine.PAWL.RPI.EDU> <54042@sun.uucp> Organization: Sun Microsystems, Inc. - Mtn View, CA Lines: 27 In article <54042@sun.uucp> mae@sun.UUCP (Mike Ekberg, Sun {Graphics Product Division}) writes: > colormap_t colormap; > > ... > > if( pr_load_colormap(fp,&rh,&colormap) == PIX_ERR) { > perror("Colormap"); > exit(-1); > } Please note that it's not quite this easy to get the colormap if you are not lucky enough to have a 3.4 or newer pixrect library. Even if you have the right library, you must initialize the colormap struct before calling pr_load_colormap(); you can zero it or just set colormap.type to RMT_NONE. For an example of this look at /usr/lib/rasfilters/convert.2.c. Refer to the 3.[45] release manual or 4.0 pixrect manual for details. P.S. perror() is not likely to print anything sensible after a pixrect function fails. P.P.S. Is this stuff too vendor specific for comp.graphics? Does everyone who is interested get sun-spots?