Class PerspectiveFilter

All Implemented Interfaces:
PropertyChangeListener, EventListener

public class PerspectiveFilter extends Filter implements PropertyChangeListener
This is a Filter that corrects perspective in the source image.
Version:
1.0
Author:
Douglas Brown
  • Field Details

    • PROPERTY_PERSPECTIVEFILTER_CORNERLOCATION

      public static final String PROPERTY_PERSPECTIVEFILTER_CORNERLOCATION
      See Also:
    • PROPERTY_PERSPECTIVEFILTER_FIXED

      public static final String PROPERTY_PERSPECTIVEFILTER_FIXED
      See Also:
    • PROPERTY_PERSPECTIVEFILTER_PERSPECTIVE

      public static final String PROPERTY_PERSPECTIVEFILTER_PERSPECTIVE
      See Also:
  • Constructor Details

    • PerspectiveFilter

      public PerspectiveFilter()
      Constructs a PerspectiveFilter object.
  • Method Details

    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Specified by:
      propertyChange in interface PropertyChangeListener
    • isEnabled

      public boolean isEnabled()
      Gets whether this filter is enabled.
      Overrides:
      isEnabled in class Filter
      Returns:
      true if this is enabled.
    • isSuperEnabled

      public boolean isSuperEnabled()
      Gets whether the super-class of this filter is enabled.
      Returns:
      true if super is enabled.
    • newInspector

      protected Filter.InspectorDlg newInspector()
      Specified by:
      newInspector in class Filter
    • initInspector

      protected Filter.InspectorDlg initInspector()
      Specified by:
      initInspector in class Filter
    • refresh

      public void refresh()
      Refreshes this filter's GUI
      Overrides:
      refresh in class Filter
    • dispose

      public void dispose()
      Description copied from class: Filter
      Disposes of this filter.
      Overrides:
      dispose in class Filter
    • setVideoPanel

      public void setVideoPanel(VideoPanel panel)
      Sets the video panel.
      Overrides:
      setVideoPanel in class Filter
      Parameters:
      panel - the video panel
    • setFixed

      public void setFixed(boolean fix, boolean in)
      Sets the fixed position behavior (all frames identical).
      Parameters:
      fix - true to set the corner positions the same in all frames
      in - true for input corners, false for output
    • isFixed

      public boolean isFixed(boolean in)
      Gets the fixed position behavior.
      Returns:
      true if fixed
    • setCornerLocation

      public void setCornerLocation(int frameNumber, int cornerIndex, double x, double y)
      Sets the location of a corner.
      Parameters:
      frameNumber - the video frame number
      cornerIndex - the corner index (0-3)
      x - the x-position
      y - the y-position
    • getColor

      public Color getColor()
      Gets the color.
      Returns:
      the color
    • getCornerIndex

      public int getCornerIndex(PerspectiveFilter.Corner corner)
      Gets the index associated with a corner point.
      Parameters:
      corner - the corner
      Returns:
      the index
    • getCorner

      public PerspectiveFilter.Corner getCorner(int index)
      Gets the corner associated with an index.
      Parameters:
      index - the index (0-7)
      Returns:
      the corner
    • deleteKeyFrame

      public void deleteKeyFrame(int frameNumber, PerspectiveFilter.Corner corner)
      Deletes the key frame associated with a corner.
      Parameters:
      frameNumber - the frame number
      corner - the corner
    • setInputEnabled

      public void setInputEnabled(boolean enable)
      Sets the inspector tab to input or output.
      Parameters:
      enable - true to show the input tab, false to show the output tab
    • isInputEnabled

      public boolean isInputEnabled()
      Determines if the inspector tab is the input tab.
      Returns:
      true if the input tab is shown
    • isActive

      public boolean isActive()
      Determines if the inspector is active.
      Returns:
      true if the active
    • hasInspector

      public boolean hasInspector()
      Determines if the inspector has been instantiated.
      Returns:
      true if the inspector exists
    • initializeSubclass

      protected void initializeSubclass()
      Creates the input and output images and ColorConvertOp.
      Specified by:
      initializeSubclass in class Filter
      Parameters:
      image - a new input image
    • setOutputPixels

      protected void setOutputPixels()
      Sets the output image pixels to a rotated version of the input pixels.
      Specified by:
      setOutputPixels in class Filter
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns an XML.ObjectLoader to save and load filter data.
      Returns:
      the object loader
    • superIsEnabled

      public boolean superIsEnabled()