Class SaturationFilter

All Implemented Interfaces:
BufferedImageOp, Cloneable

public class SaturationFilter extends PointFilter
A filter to change the saturation of an image. This works by calculating a grayscale version of the image and then extrapolating away from it.
  • Field Details

    • amount

      public float amount
  • Constructor Details

    • SaturationFilter

      public SaturationFilter()
      Construct a SaturationFilter.
    • SaturationFilter

      public SaturationFilter(float amount)
      Construct a SaturationFilter. The amount of saturation change.
  • Method Details

    • setAmount

      public void setAmount(float amount)
      Set the amount of saturation change. 1 leaves the image unchanged, values between 0 and 1 desaturate, 0 completely desaturates it and values above 1 increase the saturation.
      Parameters:
      amount - the amount
    • getAmount

      public float getAmount()
      Set the amount of saturation change.
      Returns:
      the amount
    • filterRGB

      public int filterRGB(int x, int y, int rgb)
      Specified by:
      filterRGB in class PointFilter
    • toString

      public String toString()
      Overrides:
      toString in class Object