Class ContrastFilter

All Implemented Interfaces:
BufferedImageOp, Cloneable

public class ContrastFilter extends TransferFilter
A filter to change the brightness and contrast of an image.
  • Constructor Details

    • ContrastFilter

      public ContrastFilter()
  • Method Details

    • transferFunction

      protected float transferFunction(float f)
      Overrides:
      transferFunction in class TransferFilter
    • setBrightness

      public void setBrightness(float brightness)
      Set the filter brightness.
      Parameters:
      brightness - the brightness in the range 0 to 1
      See Also:
    • getBrightness

      public float getBrightness()
      Get the filter brightness.
      Returns:
      the brightness in the range 0 to 1
      See Also:
    • setContrast

      public void setContrast(float contrast)
      Set the filter contrast.
      Parameters:
      contrast - the contrast in the range 0 to 1
      See Also:
    • getContrast

      public float getContrast()
      Get the filter contrast.
      Returns:
      the contrast in the range 0 to 1
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object