%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%.COPYRIGHT  (c)  1990-2011 European Southern Observatory
%.IDENT      initiadisp.hlq
%.AUTHOR     KB, IPG/ESO
%.KEYWORDS   MIDAS, help files, INITIALIZE/DISPLAY
%.PURPOSE    On-line help file for the command: INITIALIZE/DISPLAY
%.VERSION    1.0  21-JUN-1990 : Creation, KB
% 030630	last modif
%----------------------------------------------------------------
\se
SECTION./DISP
\es\co
INITIALIZE/DISPLAY					 17-FEB-2011  KB
\oc\su
INITIALIZE/DISPLAY [noLUT,maxLUTsz,minLUTsz] [ownLUT] [M_unit] 
                   [fonts] [colmode] [Xstation] [special_dev_flag]
	initialize the image display 
\us\pu
Purpose:
          Initialize the image display.
\up\sy
Syntax: 
          INITIALIZE/DISPLAY [noLUT,maxLUTsz,minLUTsz] [ownLUT] [M_unit] 
                             [fonts] [colmode] [Xstation] [special_dev_flag]
\ys\pa
          noLUT,maxLUTsz,minLUTsz =  the no. of possible LUTs and the max and
             min no. of entries in each LUT,
             max. no. of LUTs depends on the display hardware and the max. no.
             of entries is 256;
             defaulted to 1,210,4
\ap\pa
          ownLUT = flag to indicate if we have our own LUT
             = -1 (companion LUT); = 0 (no own LUT); = 1 (own LUT);
             defaulted to 1
\ap\pa
          M_unit = unit of Midas session which "owns" the colors of the
             display, this parameter is only needed for ownLUT = -1
\ap\pa
          fonts = font no.s for normal, large and very large fonts;
             the font numbers belonging to a given font name may be found in 
             the ASCII file $MID_SYSTAB/x11fonts.dat 
	     (MID_SYSTAB:x11fonts.dat for VMS).
             Defaulted to -1,-1,-1 which means use default font names.
\ap\pa
          colmode = Color Mode 
                 for 24 bit displays (current monitors):
              RGB - use true RGB mode, 8 bits per R, G and B
              RGBQ - emulate PseudoColor on True Color
              RGBP - emulate PseudoColor on Direct Color
                 for 8 bit displays (do they still exist?):
	      PseudoColor (8 bits per color) ;
            defaulted to RGBQ
\ap\pa
          Xstation = name of Xworkstation/Xterminal screen (in X11 syntax)
              on which the display window should be created,
              Ojo: in case of several displays, all `Xstations' have to be 
                   initialized in the same way
\ap\pa
          special_dev_flag = flag needed for some specific devices;
	      flag consists of 3 digits abc, representing 3 internal flags -
	      where a = special-, b = read-, c = write-flag;
	      these flags are used to handle specific byte swapping problems
	      when using an X11 display connected to one machine and executing
	      the Midas code on another machine;
	      normally this flag should not be necessary - it will be set
	      at the start of the display software automatically;
              currently, only the Igel thin terminals need this flag,
	      it has to be set to 111 (setting all 3 internal flags), so that 
	      COPY/DISPLAY works correctly
\ap\sa
See also:
          RESET/DISPLAY, CREATE/DISPLAY, DELETE/DISPLAY, LABEL/DISPLAY
\as\no
Note:
            The real LUT size depends upon the other applications which are
          currently running, i.e. how many colors they have already allocated.
          Unfortunately, also applications which have already terminated may
          still block color space if they didn't release correctly the colors
          they used...  If there are not enough colors available (i.e. not
	  at least `minLUTsz' colors) a private LUT will be installed for
	  Midas.  Depending upon to which window you are pointing with the
	  mouse you'll get then a different color range.
            If `ownLUT' = -1, i.e. in companion mode, the first two parameters
          are not used, the values are taken from the companion-Midas,
          instead. Thus, only that companion-Midas can alter the colors and
          the changes are reflected in this Midas session.
          All the above is only valid in PseudoColor mode with 8 bit per
          display pixel.
            In RGB (TrueColor) mode we need a display which supports 24 bit
          per pixel, 8 bit for red, green and blue color component. 
          It is assumed, that you have 3 images for a given object, 
          representing a red, green and blue color component which are loaded
          together to yield a real color composite image.
          There is then one fixed, linear LUT of 256 entries. 
          Each display will then have 3 channels: channel 0 for red,
          channel 1 for green, channel 2 for blue color. All these channels
          are always visible. Channel 3 will emulate the overlay.
            In RGBQ (Pseudo on TrueColor) mode we emulate PseudoColor mode on
          a TrueColor display. Note, that after a change of LUT any image has
	  to be reloaded before that LUT change will be visible!
          For details see the help for topic [RGBmode] .
            There is one more special font available which is set to medium
	  size Greek character set initially. This font may be changed
	  dynamically, see the help of the LABEL/DISPLAY command.
	    The IDI server should not be running - i.e. you should use 
	  DELETE/DISPLAY ALL before executing the INITIALIZE/DISPLAY command.
\on\exs
Examples:
\ex
          INITIALIZE/DISPLAY
            Initalize an image display with default values for all parameters.
\xe\ex
          INITIALIZE/DISPLAY 1,200,100
            Indicate that there is one LUT available and that you need at least
            100 and at most 200 colors. The real LUT size will be in [100,200].
\xe\ex
          INITIALIZE/DISPLAY 4,256
            Indicate that you have 4 LUTs of 256 color cells each available.
            The min LUTsize is defaulted to 4 colors.
            This was e.g. true on a (now defunct) Stellar workstation.
\xe\ex
          INITIALIZE/DISPLAY ? -1 34
            Indicate that you use the colors from Midas session with unit 34.
\xe\ex
          INITIALIZE/DISPLAY p4=24,176,1022
            Set up display to use the fonts which are listed as no. 24,
\xe\ex
          INITIALIZE/DISPLAY p5=RGB
            Set up display to work in RGB mode. Channels 0, 1, 2 will be
\xe\ex
          INITIALIZE/DISPLAY p5=RGBQ
            Set up display to work in PseudoColor mode.
\xe \sxe
