Class GrayScaleFilter


public class GrayScaleFilter extends Filter
This is a Filter that produces a grayscale version of the source.
Version:
1.0
Author:
Douglas Brown
  • Constructor Details

    • GrayScaleFilter

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

    • newInspector

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

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

      public void setWeights(double r, double g, double b)
      Sets the weighting factors.
      Parameters:
      r - red factor
      g - green factor
      b - blue factor
    • refresh

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

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

      protected void setOutputPixels()
      Sets the output image pixels to the grayscale 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