NAME:
  editmask
 PURPOSE:   (one line only)
  Interactive image-based editing of a bad-pixel mask
 DESCRIPTION:
 CATEGORY:
  CCD data processing
 CALLING SEQUENCE:
  editmask,image,mask
 INPUTS:
  image - Array containing image, this argument is not modified.
  mask  - Array containing initial mask.  This does not need to exist
            prior to calling this routine.  This argument is modified.
 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:
  XSIZE - size of the main image window
  YSIZE - size of the main image window
  BITMASK - This is a mask that contains the bit (or bits) to be set
              (or cleared) in the mask.  Normally, this mask will have
              a single bit set.  The input must be a byte type scalar.
              Default='01'xb (bit 0 set).
  STYLE - This indicates how the bitmask information is to be visually
            applied to the image.
              0 - blot out pixel with red (default)
              1 - replace pixel with sky value
          This used only for visual purposes.  The image is not actually
            modified here.
 OUTPUTS:
  mask  - Edited version of the mask
 KEYWORD OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
  There are three image areas.  On the right is the image data.  The upper
    left is the overview window, this shows the entire image. Expanded or
    minified as needed to fit the window.  The window on the right is a 1x1
    pixel image view of a portion of the image (if image is bigger than max
    window size).  To change the portion you see, click any button in the
    overview window.  The lower left window is your editing window.  If
    black, you aren't editing anything yet.  Click any button in the right
    image.  This will center the editing window on that click (as best as
    it can).  A left click in the editing window will set the mask flag
    for the currently defined bit (eg., CRS or star or saturated).  A middle
    click will clear a bit.  The right button does nothing.  You can click
    and drag to do lots of pixels.  The image updates according to the
    style settings.
 MODIFICATION HISTORY:
  Written by Marc W. Buie, Southwest Research Institute, 2011/09/21
  2017/02/09, MWB, added display of image and mask information under the
                     cursor in the zoom window.