ImageConsumer
, Cloneable
public class MaskFilter extends RGBImageFilter
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
consumer
canFilterIndexColorModel, newmodel, origmodel
Constructor | Description |
---|---|
MaskFilter(Color oldColor,
Color newColor) |
Constructs a MaskFilter object that filters color of image to another color Please note, you can also use
getInstance(java.awt.Color, java.awt.Color) to reuse the same instance of MaskFilter. |
Modifier and Type | Method | Description |
---|---|---|
static Image |
createImage(Image i,
Color oldColor,
Color newColor) |
Creates an image from an existing one by replacing the old color with the new color.
|
static Image |
createNegativeImage(Image i) |
Creates an image as negative of an existing one.
|
int |
filterRGB(int x,
int y,
int rgb) |
Overrides
RGBImageFilter.filterRGB . |
static MaskFilter |
getInstance(Color oldColor,
Color newColor) |
clone, getFilterInstance, imageComplete, resendTopDownLeftRight, setDimensions, setHints, setProperties
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
filterIndexColorModel, filterRGBPixels, setColorModel, setPixels, setPixels, substituteColorModel
public MaskFilter(Color oldColor, Color newColor)
getInstance(java.awt.Color, java.awt.Color)
to reuse the same instance of MaskFilter.oldColor
- old color in exist image that needs to be replaced by new colornewColor
- new color to replace the old colorpublic static MaskFilter getInstance(Color oldColor, Color newColor)
public static Image createImage(Image i, Color oldColor, Color newColor)
public static Image createNegativeImage(Image i)
public int filterRGB(int x, int y, int rgb)
RGBImageFilter.filterRGB
.filterRGB
in class RGBImageFilter