public class ColorMapFilter extends java.lang.Object implements Filter
A ColorMapFilter is a Filter that uses a Map<Color,Color> to replace some RGB values with others in the filtered image. For each key in the ColorMapFilter's Map with an alpha value of 1, all pixels in the original image that share their RGB value with that key will have their RGB value replaced with that of the key's value in the Map. The alpha values of the original image's pixels are left unchanged in the filtered image, and the alpha values of the Map's values are irrelevant to the ColorMapFilter's behavior.
Color
Constructor and Description |
---|
ColorMapFilter(Color key,
Color value)
Constructs a ColorMapFilter with a Map that maps the specified key Color
to the specified value Color.
|
ColorMapFilter(java.util.Map<Color,Color> colorMap)
Constructs a ColorMapFilter that uses a copy of the specified Map.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Returns whether the specified object is a ColorMapFilter that is equal to
this ColorMapFilter.
|
java.util.Map<Color,Color> |
getColorMap()
Returns an unmodifiable view of the Map that this ColorMapFilter uses.
|
Image |
getFilteredImage(Image image)
Returns the transformation through this Filter of the specified
Celick
image.
|
int |
hashCode() |
public ColorMapFilter(java.util.Map<Color,Color> colorMap)
colorMap
- The Map whose copy should be usedpublic final int hashCode()
hashCode
in class java.lang.Object
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The object to be compared with this ColorMapFilterpublic final java.util.Map<Color,Color> getColorMap()
public final Image getFilteredImage(Image image)
Filter
getFilteredImage
in interface Filter
image
- The Image to be transformed