% @(#)rgb.alq	13.1.1.1 (ESO-IPG) 06/02/98 18:15:07

			RGB color mode
			--------------

By default Midas works with displays assuming PseudoColor mode, i.e. the 
image data is stored in 8 bits per pixel displays. These pixel values are then
used as indices into a color lookup table (LUT). Since these indices are a
single 8bit value they always point to the same offset for red, green, blue in
a given LUT.

In RGB mode (or TrueColor mode) the display uses 24 bits per pixel and each
display window in Midas has 3 image channels which are used for the red, green 
and blue color. So for each pixel we can point to 3 different offsets for red, 
green + blue in a LUT.
Since the LUT used in RGB mode is a linear (grayscale) one, the pixel values
are already the red, green and blue color values.

Setting up the Midas display as working in RGB mode is done via the command
INITIALIZE/DISPLAY which has to be given before a display is created.
INIT/DISP p5=RGB will switch to RGB mode.

Example:
Midas> initialize/disp ? ? ? ? rgb	!set to RGB mode
Midas> create/disp 0			!that will create a display with
				!3 image, 1 overlay channel 
				!chan 0 for red, 1 for green, 2 for blue
Midas> load/image redpict 0	!load 2-dim image redpict into red channel
Midas> load/image greenpict 1	!load image greenpict into green channel
Midas> load/image bluepict 2	!load image bluepict into blue channel



Except the visual display of all 3 channels together all Midas display software
just uses the first, red channel (no. 0) of the display. E.g. GET/CURSOR will
refer always to the frame which was loaded into channel 0.

This is our first shot at RGB, so it is not complete yet and will need still
debugging. Please, report any problems you have in RGB mode to us.

One known deficiency is COPY/DISPLAY which currently doesn't work for RGB mode.
Instead, create a Postscript copy of an RGB display-window on your screen as 
follows:

$xwd -out copy.dump

  make X-dump of an image of the display-window

$xv copy.dump

  in xv save the image as Postscript (Color) file copy.ps

$lpr -Pprinter copy.ps

  print Postscript file




To switch back from RGB mode to PseudoColor mode, do

Midas> reset/display
Midas> init/disp



		PseudoColor mode on 24bit displays
		----------------------------------


You can also work in PseudoColor mode on a device which only supports True
Color mode.

When starting up a display or graphics window for the first time,
Midas will display a message about emulating PseudoColor on top of a
24 bit display.
Also the command SHOW/DISPLAY will give you that information.

Then you can work as in the old 8bit mode (pseudo color). However, there is
one difference:
Since the pseudocolor effect is emulated, you have to always load the images
AFTER a specific LUT is loaded. Otherwise you will not see the effect of
the changed colors, i.e.

Midas> load/lut rainbow
Midas> load/image vlt_ut1_data

should show the image `vlt_ut1_data' in the colors of the Color LUT `rainbow'. 
However,

Midas> load/lut rainbow
Midas> load/image vlt_ut1_data
Midas> load/lut heat

would NOT show the image with the colors of LUT `heat', even though the LUT bar 
at the bottom of the display window would show it.
Only after another

Midas> load/image vlt_ut1_data

will you see the new colors.


