Class InversionFilter

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

    public class InversionFilter
    extends AbstractPixelwiseFilter
    An image filter that inverts the pixel values of the source image, producing a negative image. The alpha channel is unaffected. For more fine-grained control over which channels are affected, use a ChannelSwapFilter instead. Or, to invert just the alpha channel, use an AlphaInversionFilter.

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

    Author:
    Chris Jennings
    • Constructor Detail

      • InversionFilter

        public InversionFilter()
    • Method Detail

      • 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