Package com.tagtraum.core.image
Class FadeImageFilter
- java.lang.Object
-
- java.awt.image.ImageFilter
-
- com.tagtraum.core.image.FadeImageFilter
-
- All Implemented Interfaces:
ImageConsumer
,Cloneable
public class FadeImageFilter extends ImageFilter
Produces an image that gradually fades out to alpha.
-
-
Field Summary
-
Fields inherited from class java.awt.image.ImageFilter
consumer
-
Fields inherited from interface java.awt.image.ImageConsumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
-
-
Constructor Summary
Constructors Constructor Description FadeImageFilter(int width, int height)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IndexColorModel
filterIndexColorModel(IndexColorModel icm)
Filters an IndexColorModel object by running each entry in its color tables through the filterRGB function that RGBImageFilter subclasses must provide.void
filterRGBPixels(int x, int y, int w, int h, int[] pixels, int off, int scansize, int a)
Filters a buffer of pixels in the default RGB ColorModel by passing them one by one through the filterRGB method.void
setPixels(int x, int y, int w, int h, ColorModel model, byte[] pixels, int off, int scansize)
void
setPixels(int x, int y, int w, int h, ColorModel model, int[] pixels, int off, int scansize)
void
substituteColorModel(ColorModel oldcm, ColorModel newcm)
Registers two ColorModel objects for substitution.-
Methods inherited from class java.awt.image.ImageFilter
clone, getFilterInstance, imageComplete, resendTopDownLeftRight, setColorModel, setDimensions, setHints, setProperties
-
-
-
-
Method Detail
-
substituteColorModel
public void substituteColorModel(ColorModel oldcm, ColorModel newcm)
Registers two ColorModel objects for substitution. If the oldcm is encountered during any of the setPixels methods, the newcm is substituted and the pixels passed through untouched (but with the new ColorModel object).- Parameters:
oldcm
- the ColorModel object to be replaced on the flynewcm
- the ColorModel object to replace oldcm on the fly
-
filterIndexColorModel
public IndexColorModel filterIndexColorModel(IndexColorModel icm)
Filters an IndexColorModel object by running each entry in its color tables through the filterRGB function that RGBImageFilter subclasses must provide. Uses coordinates of -1 to indicate that a color table entry is being filtered rather than an actual pixel value.- Parameters:
icm
- the IndexColorModel object to be filtered- Returns:
- a new IndexColorModel representing the filtered colors
-
filterRGBPixels
public void filterRGBPixels(int x, int y, int w, int h, int[] pixels, int off, int scansize, int a)
Filters a buffer of pixels in the default RGB ColorModel by passing them one by one through the filterRGB method.- Parameters:
x
- the coordinates of the upper-left corner of the region of pixelsy
- the coordinates of the upper-left corner of the region of pixelsw
- the width of the region of pixelsh
- the height of the region of pixelspixels
- the array of pixelsoff
- the offset into thepixels
arrayscansize
- the distance from one row of pixels to the next in the arraya
- ???
-
setPixels
public void setPixels(int x, int y, int w, int h, ColorModel model, byte[] pixels, int off, int scansize)
- Specified by:
setPixels
in interfaceImageConsumer
- Overrides:
setPixels
in classImageFilter
-
setPixels
public void setPixels(int x, int y, int w, int h, ColorModel model, int[] pixels, int off, int scansize)
- Specified by:
setPixels
in interfaceImageConsumer
- Overrides:
setPixels
in classImageFilter
-
-