Re: XForms: SELL ME A CLUE: 16-bit GreyScale into PseudoColor 8-bit

Steve Lamont (
Thu, 5 Jun 97 15:09:33 PDT

To subscribers of the xforms list from (Steve Lamont) :

> I need some simple code that will take an Intel Raw 16-bit
> (unsigned short int) and return an 8-bit GreyScale value that will
> go nicely into the MAIN FORM window with "xcamera -visual PseudoColor"
> being the default display mode.
> Has anyone done this?

I do something similar in serveral image processing programs.

I create a GL Canvas and use OpenGL or MesaGL (the freely available X
based OpenGL clone) to just do a glDrawPixels() into the canvas.
Works neat and fast.

You can get Mesa at

The latest official version at this writing is 2.2. A Beta version of
it is available in

It works really well.

The glDrawPixels() function accepts all sorts of different data types,
including unsigned short. You can do zooms and, with some work, pans
of pixel data quite easily.

To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: