public class RgbFilter extends java.lang.Object implements Filter
Threshold values may be positive and negative. Negative values are meaningful and represent an upper bound e.g. a red threshold of -100 would match against any pixel whose red value is less than 100. Positive thresholds are will match if the provided value is greater than or equal to the threshold.
Constructor and Description |
---|
RgbFilter(int red,
int green,
int blue)
Creates a new filter.
|
RgbFilter(int red,
int green,
int blue,
int lower,
int upper)
Creates a new filter.
|
Modifier and Type | Method and Description |
---|---|
double |
filter(java.awt.image.BufferedImage image)
Reduce the specified image to a single value.
|
java.lang.String |
getDescription()
Return the description of this filter.
|
(package private) double |
scale(int pixels,
int total)
Scales the percentage of bytes that meet the threshold to the provided
upper and lower bound.
|
public RgbFilter(int red, int green, int blue, int lower, int upper)
red
- The red threshold.green
- The green threshold.blue
- The blue threshold.lower
- The lower bound of the results.upper
- The upper bound of the results.public RgbFilter(int red, int green, int blue)
red
- The red threshold.green
- The green threshold.blue
- The blue threshold.public double filter(java.awt.image.BufferedImage image)
double scale(int pixels, int total)
pixels
- The number of matching pixels.total
- The total number of pixels.public java.lang.String getDescription()
getDescription
in interface Filter