col_legend2

Name

     col_legend2

Authors

     Konstantinis G. Kakoulis and Yihsing Song, under the supervision of Dr. Susanna Wei, 
     Department of Mathematics and Computer Science, Saint Joseph's University,
     Philadelphia, Pennsylvania.                      
ACKNOWLEDGEMENT
     This module is a modification of the color legend module by Lawrence Berkeley Laboratory.
     The modification includes:                      
        1. An added input port of type FIELD 1D; The minimum value, maximum value and the
           visibility of the color legend are defined by the first, second, and third
           element of the field, respectively.          
        2. Two additional parameters:
           a. LEGEND WIDTH, defines the width of the color legend.
           b. LEGEND HEIGHT, defines the height of the color legend.      
        3. The geometry produced by the module is NOT TRANSFORMABLE.                     
        4. The first and the last labels of the color legend are not displayed on the screen.  

Summary

     Name      col_legend2

Type

    mapper

Inputs

   colormap
     Inputs    Field 1D

Output

  geometry

Parameters

     Name                     Type      Default   Min       Max
    -----                     ----      -------   ---       ---
     Boundary On/Off          boolean   on
     Boundary Gray Level      integer   255       0         255
     Legend Width             real      0.08      0.01      1.0
     Legend Height            real      1.61      0.01      3.5
     Labels On/Off            boolean   on
     Label Density            integer   12        12        12
     Label Height             real      0.09      0.001     0.2
     Label Gray Level         integer   255       0         255
     Label Font               integer   0         0         21
     Label Boundaries On/Off  boolean        
     Reverse Colors           boolean   off
     Legend Orientation       radio     vertical  vertical  horizontal

Description

     This module takes an input colormap and generates a
     "color legend," consisting of a number of geometric
     objects which may be subsequently rendered using the
     render geometry module.
     The range of colors in the color scale is controlled
     by the input field 1D  All colors in the colormap are
     represented in the output color scale.  
     In addition to the smoothly shaded "color bar", the user
     may control various parameters relating to labeling
     characteristics and legend orientation.
        
     The color legend is  not transformable and the visibility of the color
     legend is controlled by the input field 1D.
INPUTS    
     AVS Colormap (required)
     Field 1D     (required)
PARAMETERS
     X offset
     Y offset
          Define the position of the color legend.
     Width
     Height
               Define the size of the color legend
     Boundary On/Off
          This boolean flag indicates whether the "color bar" part of the
          color legend is to have, on its perimeter, a pixel-thick
          line "boundary."  The boundary is useful, especially if 
          many colors in the "color bar" are similar to the current
          background color.
     Boundary Gray Level
          This value is used to set the gray level of the boundary. 
          A value of 0 corresponds to a black boundary, while a value
          of 255 corresponds to a white boundary.
     Labels On/Off
          This boolean value is used to enable/disable the annotation
          which accompanies the color legend which indicate the values
          associated with the colors.
     Label Density
          The number of labels produced is controlled through this
          parameter.  The minimum is two (the top and bottom of the
          color bar), and the maximum is twelve.  The max of 12 was
          an arbitrary decision based upon the "busyness" of color
          legends with too many labels.  Feel free to change this.
     Label Height
          This slider controls the size of the font.  The number associated
          with this slider is in some arcane coordinate system.
     Label Gray Level
          Controls the gray level of the labels text (and the labels
          boundary, as well).  A value of 0 will produce black text,
          a value of 255 will produce white text.
     Label Font
          Selects from one of 22 fonts.  Whether or not all of these
          fonts actually exist on your system is open for debate.  The
          number of available fonts comes from the Stardent documentation.
     Label Boundaries On/Off  
          Controls whether or not a "boundary line" appears in the color
          bar at the location corresponding to a particular label.  So,
          for example, if only two labels are specified, the two boundaries
          will be draw at the top/bottom of the colormap.  No boundaries
          will be visible (unless the gray level is different than that
          for the "regular" boundary) unless the label density parameter is
          set to three or higher.
     
     Reverse Colors
          This flag will reverse the colors, and any associated labels.
     Legend Orientation
          The user can choose between a vertical or horizontal color legend
          orientation.
OUTPUTS
     AVS geometry.

Example

      generate colormap
          |
        color scale
          |
      render geometry
          |
      display pixmap
     

Limitations

     It is possible to produce a really messy color legend by
     fiddling with the parameters enough.
     There is no "title" parameter.  This has been specifically
     omitted as it would be impossible to appease all users
     as to its location with respect to the color legend.
     The positioning of the labels with respect to the color
     legend is fixed:  on vertical legends, the characters 
     appear to the right, and on horizontal legends, they
     appear below the legend (compare with the NCAR utility
     for producing legends).