🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #36585

Re: 256 color colormaps in X

#36585
From: Heather Rose
Date: Fri, 09 Feb 1990 00:03
47 lines
2980 bytes
In article <1990Feb2.001652.935@elroy.jpl.nasa.gov> alan@cogswell.Jpl.Nasa.Gov (Alan S. Mazer) writes:
>Is it possible in X to display an image with 256 distinct colors on 
>a color Sun console as it is under SunView?  The XView documentation
>suggests that it is, but the O'Reilly book (and people in the past)
>suggest that it is not.  Any actual experience out there?

XView provides whatever your X11 server provides.  In XView, you may choose
to create a colormap with Xlib calls, or you may choose to create one with
the XView colormap interface.  

What the XView colormap interface provides:

simplified interface for X11 GC's.  In 1.0 and 1.0.1 the interface looks
very much like the one supplied in SunView.  With the next major release of
the toolkit (due out sometime summer 90), we'll make colormaps into XView 
opaque objects.  Thus, the functions xv_get(), xv_set(), etc. will work
for colormaps just as they do for other objects.

colormap sharing within an application.  Basically, you give a colormap a 
name and all windows use the same named colormap.  

static or dynamic colormaps.  When creating a static colormap in XView, it
will allocate (if it needs to allocate) the server's colormap colorcells as 
sharable.  It's easiest to think of this as the closest matching color to 
the one you've asked for.  When you paint a pixel in that colormap value, 
you expect that that pixel will continue to be that color while your 
application has its colormap installed.  If you decide to change the value
of a static colormap entry, this means to find another sharable cell in the
server's colormap with the closest matching color.  So let's say, we change
the static red to a static blue.  This means that the red pixel value you 
have painted in your application is no longer valid, and you will get a 
repaint event so you may re-paint the red pixels with the new color value for
blue.

The XView dynamic colormap will allocate unsharable cells in your server
colormap.  So, when you paint a pixel in a particular color, you have no
guarentee that that pixel will remain to be the same color.  When you change
a colormap entry from red to blue, you will not recieve a repaint event, and
all previously red pixels will become blue.  The dynamic colormap is useful
for colormap annimation.

virtual colormap entries.  When you create a colormap of size N in XView,
you specify painting in the relative address from 0 to N-1.

Regards,

Heather
Technical Details
Message-ID: <131493@sun.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!kimba!hvr
References: <1990Feb2.001652.935@elroy.jpl.nasa.gov>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!kimba!hvr
From: hvr@kimba.Sun.COM (Heather Rose)
Newsgroups: comp.windows.x
Subject: Re: 256 color colormaps in X
Keywords: Sun, Open Look
Message-ID: <131493@sun.Eng.Sun.COM>
Date: 9 Feb 90 00:03:06 GMT
References: <1990Feb2.001652.935@elroy.jpl.nasa.gov>
Sender: news@sun.Eng.Sun.COM
Reply-To: hvr@sun.UUCP (Heather Rose)
Organization: Sun Microsystems, Mountain View
Lines: 47