Package com.jidesoft.icons
Class MaskFilter
java.lang.Object
java.awt.image.ImageFilter
java.awt.image.RGBImageFilter
com.jidesoft.icons.MaskFilter
- All Implemented Interfaces:
ImageConsumer,Cloneable
An image filter that replaces one color in an image with another color.
-
Field Summary
Fields inherited from class java.awt.image.RGBImageFilter
canFilterIndexColorModel, newmodel, origmodelFields inherited from class java.awt.image.ImageFilter
consumerFields inherited from interface java.awt.image.ImageConsumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT -
Constructor Summary
ConstructorsConstructorDescriptionMaskFilter(Color oldColor, Color newColor) Constructs a MaskFilter object that filters color of image to another color Please note, you can also usegetInstance(java.awt.Color, java.awt.Color)to reuse the same instance of MaskFilter. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImagecreateImage(Image i, Color oldColor, Color newColor) Creates an image from an existing one by replacing the old color with the new color.static ImageCreates an image as negative of an existing one.intfilterRGB(int x, int y, int rgb) OverridesRGBImageFilter.filterRGB.static MaskFiltergetInstance(Color oldColor, Color newColor) Methods inherited from class java.awt.image.RGBImageFilter
filterIndexColorModel, filterRGBPixels, setColorModel, setPixels, setPixels, substituteColorModelMethods inherited from class java.awt.image.ImageFilter
clone, getFilterInstance, imageComplete, resendTopDownLeftRight, setDimensions, setHints, setProperties
-
Constructor Details
-
MaskFilter
Constructs a MaskFilter object that filters color of image to another color Please note, you can also usegetInstance(java.awt.Color, java.awt.Color)to reuse the same instance of MaskFilter.- Parameters:
oldColor- old color in exist image that needs to be replaced by new colornewColor- new color to replace the old color
-
-
Method Details
-
getInstance
-
createImage
Creates an image from an existing one by replacing the old color with the new color. -
createNegativeImage
Creates an image as negative of an existing one. It will basically replace the black color with white color. -
filterRGB
public int filterRGB(int x, int y, int rgb) OverridesRGBImageFilter.filterRGB.- Specified by:
filterRGBin classRGBImageFilter
-