de.htwdd.rosenkoenig.util
Class GreyFilter

java.lang.Object
  extended by java.awt.image.ImageFilter
      extended by java.awt.image.RGBImageFilter
          extended by de.htwdd.rosenkoenig.util.GreyFilter
All Implemented Interfaces:
java.awt.image.ImageConsumer, java.lang.Cloneable

public class GreyFilter
extends java.awt.image.RGBImageFilter

More elaborate GreyFilter supporting brigtening of the Image


Field Summary
private static int pBlu
           
private  int pBri
          Member that determines the amount the image will be brightened.
private static int pGrn
           
private static int pRed
           
 
Fields inherited from class java.awt.image.RGBImageFilter
canFilterIndexColorModel, newmodel, origmodel
 
Fields inherited from class java.awt.image.ImageFilter
consumer
 
Fields inherited from interface java.awt.image.ImageConsumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
 
Constructor Summary
GreyFilter()
          Default constructor, uses the default brightness value of 140%
GreyFilter(int percentage)
           
 
Method Summary
 int filterRGB(int x, int y, int rgb)
           
 
Methods inherited from class java.awt.image.RGBImageFilter
filterIndexColorModel, filterRGBPixels, setColorModel, setPixels, setPixels, substituteColorModel
 
Methods inherited from class java.awt.image.ImageFilter
clone, getFilterInstance, imageComplete, resendTopDownLeftRight, setDimensions, setHints, setProperties
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pRed

private static final int pRed
See Also:
Constant Field Values

pGrn

private static final int pGrn
See Also:
Constant Field Values

pBlu

private static final int pBlu
See Also:
Constant Field Values

pBri

private int pBri
Member that determines the amount the image will be brightened.

Constructor Detail

GreyFilter

GreyFilter()
Default constructor, uses the default brightness value of 140%


GreyFilter

GreyFilter(int percentage)
Parameters:
percentage - override the classes default percentage value for brightening the Image of 140%; use a negative value to darken the Image;
Method Detail

filterRGB

public int filterRGB(int x,
                     int y,
                     int rgb)
Specified by:
filterRGB in class java.awt.image.RGBImageFilter
Parameters:
x - x coordinate of the currently processed pixel
y - y coordinate of the currently processed pixel
rgb - alpha, red, green, blue value of the pixel