Article View: comp.graphics.avs
Article #87Re: color dithering
From: John W. Langner
Date: Tue, 08 Sep 1992 22:01
Date: Tue, 08 Sep 1992 22:01
71 lines
3155 bytes
3155 bytes
In article <1992Sep4.212058.7948@newshost.lanl.gov> krogh@acl.lanl.gov (Michael F. Krogh) writes: >I'm trying to figure out how to use the function 'pf_dither_image' without >using the LUI routines to open a window. If I don't open a window >with the LUI routines, then I get the error: > > Unable to dither to pixel size of 0! > >Also, where might the LUI routines and things like pf_dither_image >be documented? I ran across them in a module in the NCSC repository. > >Thanks, > >Mike Krogh >Advanced Computing Lab, LANL >krogh@acl.lanl.gov pf_dither_image is an undocumented function intended for internal use only. Since one of the modules at the International Center uses it, I'll pass along this brief description: /*------------------------------------------------------------------------- * * void pf_dither_image(imagebuf,w,h,dat,technique) * unsigned char *imagebuf; * int w,h; * unsigned char *dat; * char *technique; * * Dither an image for display on device with fewer than 24 bits/pixel. * * Inputs: imagebuf - Image with 4 bytes per pixel in a,r,g,b order. * w - Width. * h - Height. * technique - One of the following: * "dither" * "floyd steinberg" * "none" * "random" * "monochrome" * * Outputs: dat - Image is stored here. * It can be 1, 2, or 4 bytes per pixel depending * on LUI_BytesPerPixel. * *------------------------------------------------------------------------*/ You will notice the techniques correspond to the choices presented when the "display image" module is used on a pseudo color display. You will also notice that the function arguments do not provide enough information for the dithering operation. For instance, the dithering operation needs to know the colormap contents for a pseudo color display. This is obtained from the current LUI display information. For efficiency, the function has certain built in assumptions about the way LUI allocates the colormap entries. Trying to fake the required environment for this to work without calling LUI_Initialize first could be a substantial effort. Also, since the calling sequence is not published in a manual it could change from one release to the next. -- John Langner johnl@avs.com Advanced Visual Systems Inc. 300 Fifth Ave. (617) 890 4300 x2122 Waltham, MA 02154 U.S.A. (617) 890 8287 (fax)
Technical Details
Message-ID:
<1992Sep8.220154.5272@ctr.columbia.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!gumby!wupost!usc!sol.ctr.columbia.edu!johnlReferences:
<1992Sep4.212058.7948@newshost.lanl.gov>Show Full Headers
Complete Article Headers
Newsgroups: comp.graphics.avs Path: arc1-ca.pugleaf.net!sparky!uunet!gumby!wupost!usc!sol.ctr.columbia.edu!johnl From: johnl@avs.com (John W. Langner) Subject: Re: color dithering Organization: Advanced Visual Systems Inc. References: <1992Sep4.212058.7948@newshost.lanl.gov> Message-ID: <1992Sep8.220154.5272@ctr.columbia.edu> Sender: news@ctr.columbia.edu (The Daily Lose) Date: Tue, 8 Sep 1992 22:01:54 GMT X-Posted-From: aurora.avs.com X-Posted-Through: sol.ctr.columbia.edu Lines: 71