Class ShiftHReplaceSBFilter

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

    public class ShiftHReplaceSBFilter
    extends TintFilter
    This filter shifts the hue of each pixel by a fixed amount, sets the saturation to a fixed value, and scales the brightness. An optional brightness adjustment factor allows compensation for darker images to allow a greater dynamic range.
    • Constructor Detail

      • ShiftHReplaceSBFilter

        public ShiftHReplaceSBFilter()
      • ShiftHReplaceSBFilter

        public ShiftHReplaceSBFilter​(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 TintFilter
        Parameters:
        h - the hue factor
        s - the saturation factor
        b - the brightness factor
      • filter

        public java.awt.image.BufferedImage filter​(java.awt.image.BufferedImage source,
                                                   java.awt.image.BufferedImage dest)
        Description copied from interface: TintingFilter
        Apply the filter to source, storing the result in dest.
        Specified by:
        filter in interface java.awt.image.BufferedImageOp
        Specified by:
        filter in interface TintingFilter
        Overrides:
        filter in class AbstractPixelwiseFilter
        Parameters:
        source - the source image
        dest - the destination image (may be null)
        Returns:
        the destination image
      • 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.
        Overrides:
        filterPixels in class TintFilter
        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
      • getBrightAdjust

        public float getBrightAdjust()
      • setBrightAdjust

        public void setBrightAdjust​(float bAdjust)