static class BufferedImageDrawHelper.ThresholdFilter
extends java.awt.image.RGBImageFilter
Modifier and Type | Field and Description |
---|---|
private static int |
COLOR_BLACK_TRANSPARENT
New color for pixels over threshold.
|
(package private) int |
replacement
New value for pixel color under threeshold.
|
(package private) int |
threshold
The threshold value.
|
Constructor and Description |
---|
ThresholdFilter(int threshold,
int replacement)
Creates new filter with the threshold value and replacement color.
|
Modifier and Type | Method and Description |
---|---|
int |
filterRGB(int x,
int y,
int pixel)
This is on the fly converter to change the image color by setting all pixels under
threshold value to the color defined on filter construction.
|
filterIndexColorModel, filterRGBPixels, setColorModel, setPixels, setPixels, substituteColorModel
private static final int COLOR_BLACK_TRANSPARENT
int threshold
int replacement
ThresholdFilter(int threshold, int replacement)
threshold
- The color to use as filter threshold.replacement
- The color to replace the pixels under threshold.public int filterRGB(int x, int y, int pixel)
filterRGB
in class java.awt.image.RGBImageFilter
x
- The X pixel coordinate.y
- The Y pixel coordinate.pixel
- The ARGB pixel value of the original image.