org.bounce.image
Class GrayFilter
java.lang.Object
java.awt.image.ImageFilter
java.awt.image.RGBImageFilter
org.bounce.image.BaseFilter
org.bounce.image.GrayFilter
- All Implemented Interfaces:
- ImageConsumer, Cloneable
public class GrayFilter
- extends BaseFilter
A filter that creates a gray version of the image.
This is almost the same as the javax.swing.GrayFilter version.
This filter does only not allow for the brighter variable. If
the image needs to be made brighter, use the BrighterFilter.
- Version:
- $Revision: 1.4 $, $Date: 2008/01/28 21:28:37 $
- Author:
- Edwin Dankert
Constructor Summary |
GrayFilter(int p)
Constructs a Filter that can be used to construct a
grayscale image. |
Method Summary |
int |
filterRGB(int x,
int y,
int rgb)
Overrides RGBImageFilter.filterRGB . |
GrayFilter
public GrayFilter(int p)
- Constructs a Filter that can be used to construct a
grayscale image.
- Parameters:
p
- the percentage of color in the range 0..100, where 100 is
the darkest, and 0 is the lightest.
filterRGB
public int filterRGB(int x,
int y,
int rgb)
- Overrides
RGBImageFilter.filterRGB
.
- Specified by:
filterRGB
in class RGBImageFilter
- Parameters:
x
- the horizontal position of the pixel.y
- the vertical position of the pixel.rgb
- the color of the pixel.
- Returns:
- the new rgb value
Copyright © 2002-2011 Edwin Dankert. All Rights Reserved.