com.jhlabs.image

Class MapColorsFilter

Implemented Interfaces:
BufferedImageOp, Cloneable

public class MapColorsFilter
extends PointFilter

A filter which replaces one color by another in an image. This is frankly, not often useful, but has its occasional uses when dealing with GIF transparency and the like.

Field Summary

Fields inherited from class com.jhlabs.image.PointFilter

canFilterIndexColorModel

Constructor Summary

MapColorsFilter()
Construct a MapColorsFilter.
MapColorsFilter(int oldColor, int newColor)
Construct a MapColorsFilter.

Method Summary

int
filterRGB(int x, int y, int rgb)

Methods inherited from class com.jhlabs.image.PointFilter

filter, filterRGB, setDimensions

Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp

clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRGB, getRenderingHints, setRGB

Constructor Details

MapColorsFilter

public MapColorsFilter()
Construct a MapColorsFilter.

MapColorsFilter

public MapColorsFilter(int oldColor,
                       int newColor)
Construct a MapColorsFilter.
Parameters:
oldColor - the color to replace
newColor - the color to replace it with

Method Details

filterRGB

public int filterRGB(int x,
                     int y,
                     int rgb)
Overrides:
filterRGB in interface PointFilter