Package ca.cgjennings.graphics.filters
Class DarkMagicFilter
- java.lang.Object
-
- ca.cgjennings.graphics.filters.AbstractImageFilter
-
- ca.cgjennings.graphics.filters.AbstractPixelwiseFilter
-
- ca.cgjennings.graphics.filters.DarkMagicFilter
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp
public class DarkMagicFilter extends AbstractPixelwiseFilter
A filter which inverts the brightness each pixel without affecting the colour. One effective use of this filter is to convert an image that was designed to look good against a light background into one that looks good against a dark background, or vice-versa.In-place filtering: This class supports in-place filtering (the source and destination image may be the same).
- Since:
- 3.4
- Author:
- Chris Jennings
-
-
Constructor Summary
Constructors Constructor Description DarkMagicFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
filterPixels(int[] argb, int start, int end)
This method is called with a block of ARGB values to be filtered.-
Methods inherited from class ca.cgjennings.graphics.filters.AbstractPixelwiseFilter
filter, filter, filterPixel, workFactor
-
Methods inherited from class ca.cgjennings.graphics.filters.AbstractImageFilter
clamp, clamp, clamp, clampBoth, createCompatibleDestImage, fA, fB, fG, fR, getARGB, getARGB, getARGBSynch, getBounds2D, getPoint2D, getRenderingHints, iA, iB, iG, iR, setARGB, setARGB, setARGBSynch
-
-
-
-
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 rangeargb[start] ... argb[end-1]
with the filtered value.- Specified by:
filterPixels
in classAbstractPixelwiseFilter
- Parameters:
argb
- an array of pixel data to filterstart
- the index of the first pixel to filterend
- the index of the last pixel to filter, plus one
-
-