Class SharpenFilter

  • All Implemented Interfaces:
    java.awt.image.BufferedImageOp

    public final class SharpenFilter
    extends AbstractConvolver
    A filter that sharpens the input image.

    In-place filtering: This class allows in-place filtering (the source and destination images can be the same).

    Since:
    3.0
    Author:
    Chris Jennings
    • Constructor Detail

      • SharpenFilter

        public SharpenFilter()
        Creates a new sharpening filter with a sharpening factor of 1.
      • SharpenFilter

        public SharpenFilter​(float sharpeningFactor)
        Creates a new sharpening filter with the specified sharpening factor.
        Parameters:
        sharpeningFactor -
    • Method Detail

      • getSharpeningFactor

        public float getSharpeningFactor()
        Returns a factor representing the amount of sharpening that will be applied by this filter.
        Returns:
        the sharpening factor
      • setSharpeningFactor

        public void setSharpeningFactor​(float sharpeningFactor)
        Sets the sharpening factor. Higher values increase the sharpening effect. Lower values produce a less pronounced sharpening effect. A value of zero will reproduce the original image (some pixel values may change slightly due to rounding and conversion errors). The default is factor is one.
        Parameters:
        sharpeningFactor - a factor which determines how pronounced the sharpening effect is
        Throws:
        java.lang.IllegalArgumentException - if the sharpening factor is negative
      • getKernels

        protected java.awt.image.Kernel[] getKernels()
        Description copied from class: AbstractConvolver
        Returns the convolution kernel(s) that should be applied to execute this filter. Typically, array is either length one (non-separable) or length two (separable).
        Specified by:
        getKernels in class AbstractConvolver
        Returns:
        an array of non-null convolution kernels