Article View: comp.lang.postscript
Article #5882Re: DPS Color use
From: Stephen Zisk
Date: Fri, 11 Dec 1992 20:47
Date: Fri, 11 Dec 1992 20:47
39 lines
2308 bytes
2308 bytes
In article <MSL9EGP@math.fu-berlin.de>, beck@irzr17.inf.tu-dresden.de
(Andre Beck) wrote:
> How do I get a 1280x1024 pixel image that uses less than 256 colors
> on the display WITHOUT any dithering ? In other words, how can I force
> the XDPS system to allocate new colors ?
Preface: I am not a DPS expert, but I do have a manual in front of me,
so here goes, and watch out for the trees!
You tell DPS what color table to use at context creation time. If you
use the XDPSCreateSimpleContext() call, you get a context with a default
color map: a 5x5x5 color cube, with dithering for missing colors. If you
use XDPSCreateContext(), the arguments include a color cube and a gray
ramp function.
Find your XDPSCreateSimpleContext call, which will have 8 arguments.
Change to be XDPSCreateContext, then after the fifth argument, insert
four more args:
unsigned int eventmask; /* unimplemented - use 0 */
XStandardColormap *grayramp; /* an XStandardColormap for grays */
XStandardColormap *ccube; /* ditto for a color cube */
int actual; /* requests use of pure colors */
Set up your colormap so that there are n unused entries, and set
"actual" to TRUE. Now the first n color requests you make via DPS
will be allocated in the unused entries, and will be represented
as pure colors.
This is all documented in the "X Window System Programmer's Supplement
to the Client Library Reference Manual," avaialble from Adobe.
Simple and obvious, n'est pas? *NOT!*
Stephen Zisk (zisk@adobe.com) Disclaimer: These are my personal views
Adobe Systems Incorporated and do not represent the position of
Eastern Regional Office Adobe Systems Incorporated.
24 New England Exec. Park
Burlington, MA 01803 They pay me but they don't muzzle me!
Technical Details
Message-ID:
<zisk-111292153206@macne010.boston.us.adobe.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!usc!elroy.jpl.nasa.gov!ames!sun-barr!olivea!decwrl!adobe!macne010.boston.us.adobe.com!userReferences:
<MSL9EGP@math.fu-berlin.de>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!elroy.jpl.nasa.gov!ames!sun-barr!olivea!decwrl!adobe!macne010.boston.us.adobe.com!user From: zisk@adobe.com (Stephen Zisk) Newsgroups: comp.lang.postscript Subject: Re: DPS Color use Message-ID: <zisk-111292153206@macne010.boston.us.adobe.com> Date: 11 Dec 92 20:47:41 GMT References: <MSL9EGP@math.fu-berlin.de> Sender: usenet@adobe.com (USENET NEWS) Followup-To: comp.lang.postscript Organization: Adobe Systems Incorporated Lines: 39