%N wedgcg %F $MIR/src/subs/cgpgsubs.for
%D Draw pixel map wedge in specified viewport
%P nebk
%: plotting
%B
      subroutine wedgcg (label, trfun, groff, nbins, cumhis, wdgvp,
     *                   a1, a2)

      integer nbins
      real wdgvp(4), a1, a2, groff, cumhis(nbins)
      character trfun*3
      logical label
  ---------------------------------------------------------------------
  Draw a vertical grey-scale wedge in the specified viewport

  Input
    label  True means label wedge to right else none
    trfun  Transfer function type applied to image.  One of 'lin',
           'log', 'heq' or 'sqr'
    groff  Offset added to image for log and sqrt transfer functions
    nbins  Number of bins used in histogram equalization of image
    cumhis Cumulative histogram for histogram equalization
           Values for each bin are the intensities assigned to
           the image.  Thus if an image pixel ended up in
           cumhis bin idx, then its new value is cumhis(idx)
    wdgvp  Viewport to draw wedge in
    a1     The value which is to appear with shade C1
    a2     The value which is to appear with shade C2
           Use the values of A1 and A2 that were sent to PGIMAG except
           that these values should be those appropriate to before any
           application of transfer functions (sqr, log, heq) and adding
           of offsets (GROFF)
