Class TintOverlayFilter

  • All Implemented Interfaces:
    TintingFilter, java.awt.image.BufferedImageOp
    Direct Known Subclasses:
    TintFilter

    public class TintOverlayFilter
    extends AbstractTintingFilter
    This filter changes the colour of every pixel to an HSB colour value, but leaves the alpha value untouched.
    • Constructor Detail

      • TintOverlayFilter

        public TintOverlayFilter()
      • TintOverlayFilter

        public TintOverlayFilter​(float h,
                                 float s,
                                 float b)
    • Method Detail

      • setFactors

        public void setFactors​(float h,
                               float s,
                               float b)
        Description copied from class: AbstractTintingFilter
        Sets the hue, saturation, and brightness factors to use for tinting.

        Implementation Note: if saturation or brightness are less than 0, they are clamped to 0. Values over 1 are not clamped. If your subclass requires that saturation or brightness are clamped at 1, override this method to do so, then call the super implementation.

        Specified by:
        setFactors in interface TintingFilter
        Overrides:
        setFactors in class AbstractTintingFilter
        Parameters:
        h - the hue factor
        s - the saturation factor
        b - the brightness factor
      • filterPixels

        public void filterPixels​(int[] argb,
                                 int start,
                                 int end)
        Description copied from class: AbstractPixelwiseFilter
        This method is called with a block of ARGB values to be filtered. Subclasses must override this method to implement the actual filtering algorithm by replacing each pixel value in the range argb[start] ... argb[end-1] with the filtered value.
        Specified by:
        filterPixels in class AbstractPixelwiseFilter
        Parameters:
        argb - an array of pixel data to filter
        start - the index of the first pixel to filter
        end - the index of the last pixel to filter, plus one
      • isIdentity

        public boolean isIdentity()
        Description copied from interface: TintingFilter
        Returns true if applying this filter would have no effect. This can be used as an optimization hint.
        Specified by:
        isIdentity in interface TintingFilter
        Overrides:
        isIdentity in class AbstractTintingFilter
        Returns:
        true if a filtered image would not change