Re: XForms: image support and colormaps

Stephen Huyssoon (huyssoons@advancia.com)
Tue, 27 Apr 1999 11:58:29 -0500

# To subscribers of the xforms list from Stephen Huyssoon <huyssoons@advancia.com> :

Michal Szymanski wrote:

> # To subscribers of the xforms list from Michal Szymanski <msz@bulge.astrouw.edu.pl> :
>
> Hello,
>
> I've read the chapter about images in XForms' manual, but apparently
> either I missed it or it is not there:
>
> If I try to display GRAY16 image (e.g. read from a 16-bit FITS file)
> in a PseudoColor visual (e.g. in a canvas window), what kind
> of colormap is used? Does the display routine change the colormap?
> Should the user prepare it manually? Can the user control how
> many grey levels are used?

For the X Window System, the visual type determines the colormap type.
Thus, if you have chosen the visual, you have chosen the colormap. The
trick is to get the image data into an XImage structure in a manner that is
suitable for your chosen visual.

Steve Lamont has said that, in your case, the canvas object makes a
new pseudo color color map, copies the entries from the parent
colormap to the new colormap, and assigns the new colormap to
the canvas window. Now, if you use only the colors that will then
be in the new colormap, you will have to discover what colormap
indices you wish to use and use those index values for your image
data. This is a pain in the ass, but works fine if you have enough
colors - this depends upon your image. And, if you find out which
colors other folks are using, then you can add colors to your new
colormap in those cells that aren't being used by other folks.

For this reason, I am a true color man all the way.

Go True Color, that is my motto.

Have fun, feel free to ask me shtuff using huyssoons@advancia.com .

Adieu.

>
>
> thanks in advance for any hints,
>
> regards, Michal.
>
> --
> Michal Szymanski (msz@sirius.astrouw.edu.pl)
> Warsaw University Observatory, Warszawa, POLAND
> _________________________________________________
> To unsubscribe, send the message "unsubscribe" to
> xforms-request@bob.usuhs.mil or see
> http://bob.usuhs.mil/mailserv/xforms.html
> XForms Home Page: http://bragg.phys.uwm.edu/xforms
> List Archive: http://bob.usuhs.mil/mailserv/list-archives/

--
  (Stephen Huyssoon)
>=============================>
  (huyssoons@advancia.com)                            www.advancia.com

To Infinity and Beyond! -- Me and Buzz Lightyear

The Truth cannot be proven nor disproven, it simply Is.

Derick's Writ of Habeas Corpus: Ok, back on your heads!

_________________________________________________ To unsubscribe, send the message "unsubscribe" to xforms-request@bob.usuhs.mil or see http://bob.usuhs.mil/mailserv/xforms.html XForms Home Page: http://bragg.phys.uwm.edu/xforms List Archive: http://bob.usuhs.mil/mailserv/list-archives/