; TVHLD
;---------------------------------------------------------------
;! Task to load a map with histogram equalization
;# TASK TV
;-----------------------------------------------------------------------
;;  Copyright (C) 1995, 1999
;;  Associated Universities, Inc. Washington DC, USA.
;;
;;  This program is free software; you can redistribute it and/or
;;  modify it under the terms of the GNU General Public License as
;;  published by the Free Software Foundation; either version 2 of
;;  the License, or (at your option) any later version.
;;
;;  This program is distributed in the hope that it will be useful,
;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;  GNU General Public License for more details.
;;
;;  You should have received a copy of the GNU General Public
;;  License along with this program; if not, write to the Free
;;  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
;;  MA 02139, USA.
;;
;;  Correspondence concerning AIPS should be addressed as follows:
;;         Internet email: aipsmail@nrao.edu.
;;         Postal address: AIPS Project Office
;;                         National Radio Astronomy Observatory
;;                         520 Edgemont Road
;;                         Charlottesville, VA 22903-2475 USA
;-----------------------------------------------------------------------
;---------------------------------------------------------------
TVHLD     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
TVHLD:  Task to load a map with histogram equalization
USERID     -32000.0     32000.0    User ID.  0 => current user
                                     32000 => all users
INNAME                             Image name(name). blank=>any
INCLASS                            Image name(class). blank=>any
INSEQ           0.0      9999.0    Image name(seq. #). 0=>any
INDISK          0.0         9.0    Disk drive #. 0=>any
TBLC            0.0      4096.0    Bottom Left Corner of image
                                     0 => entire image
TTRC            0.0      4096.0    Top Right Corner of image
                                     0 => entire image
TXINC           0.0       256.0    Load every TXINC'th column
TYINC           0.0       256.0    Load every TYINC'th row
TVCORN          0.0       512.0    TV pixel location of bottom
                                     left corner of image
PIXRANGE                           Min,Max  of image intensity
                                     0 => entire range
FUNCTYPE                           Transfer function for LOADING
                                     'LN' Linear
                                     'LG' Logarithmic
                                     'SQ' Square root
                                     'NE' Negative linear
                                     'NG' Negative logarithmic
                                     'NQ' Negative square root
                                     else: Linear
SCALR1          0.0        13.0    Number of bits to use while
                                     loading; 10=>13; anything
                                     else defaults to 13
----------------------------------------------------------------
TVHLD
Type: Task
Use:  TVHLD loads a map image into the TV in up to 13 bits and,
      based on histogram equalization, then calculates an input
      transfer function to compress it to 8 bits.  This maxi-
      mizes the dynamic range visible on the TV.  The back
      ground may be removed, i.e., all pixels below a certain
      pixel value are made invisible; the rejection level is
      controlled by the cursor.  The peak of the intensity
      histogram is given at the beginning.  Button A switches
      between a quasi-linear equalization function and a log-
      arithmic one; the "linear" function favors the lower
      intensities, the "logarithmic" the higher ones.  Button B
      switches between spectrum colors and gray scale.  Button C
      causes the present image to be put into TV channel 1 and
      the program to exit.  Button D just causes an exit,
      leaving the image in TV channel 3.
      The cursor's Y position controls coarse tuning of the back
      ground rejection level, its X position fine tuning.
      At the top of the screen are shown: the equalization
      function (lin or log), the position of the peak in the
      histogram, and the current back ground rejection level.
      The number of bits used in loading the image is controlled
      by SCALR1; it can range from 10 (1024) to 13 (8192) - any-
      thing else defaults to 13.  Obviously, the higher the num-
      ber of bits, the higher the dynamic range that can be dis-
      played; however, it also increases the sluggishness in the
      response to the cursor.
----------------------------------------------------------------
