Class ViewJComponentHistoRGB

All Implemented Interfaces:
MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener

public class ViewJComponentHistoRGB extends ViewJComponentHLUTBase implements MouseMotionListener, MouseListener
This class extends the ViewJComponentHLUTBase class and used to coordinate how a histogram and LUT for an image are to be displayed to the screen. For display purposes, this component has a LUT Model.
Version:
0.1 Aug 1, 1997
Author:
Matthew J. McAuliffe, Ph.D. (primary), Harman Singh
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • RGBT

      private ModelRGB RGBT
      DOCUMENT ME!
  • Constructor Details

    • ViewJComponentHistoRGB

      public ViewJComponentHistoRGB(HistoLUTParent _histoFrame, ModelHistogram _histo, ModelRGB RGBTable, ModelImage _image)
      Creates a Histogram RGB component.
      Parameters:
      _histoFrame - Frame where histogram is to be displayed
      _histo - histogram model
      RGBTable - DOCUMENT ME!
      _image - image of the displayed histogram
  • Method Details

    • addFunctionPoint

      public void addFunctionPoint(float x, float y)
      /
      Specified by:
      addFunctionPoint in class ViewJComponentHLUTBase
      Parameters:
      x - DOCUMENT ME!
      y - DOCUMENT ME!
    • checkProximityToTransferFunction

      public void checkProximityToTransferFunction(float x, float y, boolean remove)
      DOCUMENT ME!
      Specified by:
      checkProximityToTransferFunction in class ViewJComponentHLUTBase
      Parameters:
      x - DOCUMENT ME!
      y - DOCUMENT ME!
      remove - DOCUMENT ME!
    • dragPoint

      public void dragPoint(MouseEvent mouseEvent)
      DOCUMENT ME!
      Parameters:
      mouseEvent - DOCUMENT ME!
    • dualThresholdMode

      public void dualThresholdMode(int newMode)
      Switch the histogram component to (inverse or regular) dual threshold mode.
      Specified by:
      dualThresholdMode in class ViewJComponentHLUTBase
      Parameters:
      newMode - either DUAL_THRESHOLD, DUAL_THRESHOLD_INV, or NO_THRESHOLD
    • evenDistribution

      public void evenDistribution()
      Evenly distributed the controls points of linear transfer function.
      Specified by:
      evenDistribution in class ViewJComponentHLUTBase
    • getLowerThreshold

      public float getLowerThreshold()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getThresholdMode

      public int getThresholdMode()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getTransferFunction

      public TransferFunction getTransferFunction()
      Get the current transfer function we are working with.
      Overrides:
      getTransferFunction in class ViewJComponentHLUTBase
      Returns:
      the LUT tranfer function
    • getUpperThreshold

      public float getUpperThreshold()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • linearMode

      public void linearMode()
      Resets mode to linear and shows component.
      Specified by:
      linearMode in class ViewJComponentHLUTBase
    • mouseClicked

      public void mouseClicked(MouseEvent mouseEvent)
      Unchanged.
      Specified by:
      mouseClicked in interface MouseListener
      Parameters:
      mouseEvent - DOCUMENT ME!
    • mouseDragged

      public void mouseDragged(MouseEvent mouseEvent)
      Continually updates the image depending on where the mouse is.
      Specified by:
      mouseDragged in interface MouseMotionListener
      Parameters:
      mouseEvent - event that triggered this function
    • mouseEntered

      public void mouseEntered(MouseEvent mouseEvent)
      Unchanged.
      Specified by:
      mouseEntered in interface MouseListener
      Parameters:
      mouseEvent - DOCUMENT ME!
    • mouseExited

      public void mouseExited(MouseEvent mouseEvent)
      Unchanged.
      Specified by:
      mouseExited in interface MouseListener
      Parameters:
      mouseEvent - DOCUMENT ME!
    • mouseMoved

      public void mouseMoved(MouseEvent mouseEvent)
      Changes the cursor so that function can add points depending on how near the line it is.
      Specified by:
      mouseMoved in interface MouseMotionListener
      Parameters:
      mouseEvent - event that triggered this function
    • mousePressed

      public void mousePressed(MouseEvent mouseEvent)
      Checks for making new points or not.
      Specified by:
      mousePressed in interface MouseListener
      Parameters:
      mouseEvent - event that triggered function
    • mouseReleased

      public void mouseReleased(MouseEvent mouseEvent)
      Updates image and shows it.
      Specified by:
      mouseReleased in interface MouseListener
      Parameters:
      mouseEvent - event that triggered this function
    • noThreshold

      public void noThreshold()
      DOCUMENT ME!
    • paintComponent

      public void paintComponent(Graphics g)
      Paints the component.
      Overrides:
      paintComponent in class ViewJComponentHLUTBase
      Parameters:
      g - graphics to paint in
    • removeClickedFunctionPoint

      public void removeClickedFunctionPoint()
      DOCUMENT ME!
      Specified by:
      removeClickedFunctionPoint in class ViewJComponentHLUTBase
    • setLUT

      public void setLUT(ModelStorageBase newLUT)
      Change the lookup table associated with the image and histogram.
      Specified by:
      setLUT in class ViewJComponentHLUTBase
      Parameters:
      newLUT - the new lut
    • showHistogram

      public void showHistogram(ModelLUT lut)
      Filters the histogram through the LUT and produces an int array (aRGB) that can be converted to a java image of the histogram for display purposes.
      Specified by:
      showHistogram in class ViewJComponentHLUTBase
      Parameters:
      lut - LUT to filter with
    • finalize

      protected void finalize() throws Throwable
      Clean up some resources!
      Overrides:
      finalize in class ViewJComponentHLUTBase
      Throws:
      Throwable - DOCUMENT ME!
    • showRGB

      private void showRGB(int[] lutIndexBuffer, int mode)
      DOCUMENT ME!
      Parameters:
      lutIndexBuffer - LUT index buffer for desired mode (Red, Green, Blue or All)
      mode - Indicates the channel for which the histogram is displayed