Re: XForms: Pixmap!

Steve Lamont (spl@pitstop.ucsd.edu)
Mon, 15 Feb 99 11:23:30 PST

# To subscribers of the xforms list from spl@pitstop.ucsd.edu (Steve Lamont) :

> I need to show satellite images in my program. And, really, the
> set_pixmap_data was not working.
> The images are ASCII files:
> 45 56 67 53 42 12 12 32 ...
> [...]
> I need a way to read a file like this and show it as a image.

The problem I have in giving any specific help is that there are many
different ways of displaying images in an X Window System environment,
depending upon your hardware, your data, and the amount you care about
portability between platforms, servers, and operating systems.

As I said in my earlier message, if you have OpenGL on your system,
then you should use a glCanvas rather than a Pixmap object. If your
system isn't supported by OpenGL then you may want to look into Mesa,
which is a call-for-call clone of OpenGL. Depending upon what
hardware you have available, there may be a certain amount of hardware
acceleration supported by Mesa.

Check <http://www.opengl.org> for pointers to getting Mesa.

If the Mesa route isn't available, you're going to have to resort to
raw X coding for the time being (as I said before, Real Soon Now,
there will be a release of XForms 0.90 which will have support for
images -- at least as soon as I dust off my copy of _Graphics Gems II_
and write the Floyd-Steinberg dithering code).

You have two choices there:

If your system supports XIE (the X Image Extension, not to be confused
with the X Input Extension) you can program in XIE. It's a bit
complicated at first glance by you can do a lot with it.
Unfortunately, if you're looking for portability to SGI systems,
Silicon Graphics has chosen not to support XIE (grumble grumble).
Refer to _Developing Imaging Applications with XIElib_ by Syd Logan
(ISBN 0-13-442914-1) for voluminous detail. There is a nice CDROM
included with the book with lots of example code.

If you can't use XIE or mesa then you're basically left with Xlib.
Beg, borrow, or steal a copy of the _Xlib Programming Manual_ by
Adrian Nye (ISBN 1-56592-002-3). It has example code in it and you
can snarf the source from the web site mentioned in the manual. It
will tell you how to deal with all of the wonderful Colormap and
server issues. If you need to color quantize due to a small Colormap,
you may want to get a copy of my quantization library. See our FTP
site: <ftp://ncmir.ucsd.edu/pub/quantize/>. Check the README file.

spl

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