org.bounce.image
Class BaseFilter
java.lang.Object
java.awt.image.ImageFilter
java.awt.image.RGBImageFilter
org.bounce.image.BaseFilter
- All Implemented Interfaces:
- java.awt.image.ImageConsumer, java.lang.Cloneable
- Direct Known Subclasses:
- BlueFilter, BrighterFilter, CyanFilter, DarkerFilter, GrayFilter, GreenFilter, MagentaFilter, RedFilter, SilhouetteFilter, YellowFilter
public abstract class BaseFilter
- extends java.awt.image.RGBImageFilter
The base filter for all the image filters in the bounce package.
Contains a couple of handy Utility methods.
- Version:
- $Revision: 1.4 $, $Date: 2008/01/28 21:28:37 $
- Author:
- Edwin Dankert
| 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 |
|
Method Summary |
protected int |
getBlue(int rgb)
Gets the blue value out of the rgb value. |
protected int |
getGreen(int rgb)
Gets the green value out of the rgb value. |
protected int |
getNTSCValue(int rgb)
Converts the red green and blue values to one value. |
protected int |
getRed(int rgb)
Gets the red value out of the rgb value. |
protected int |
getRGB(int rgb,
int red,
int green,
int blue)
Returns the rgb value for the blue, red and green values. |
| Methods inherited from class java.awt.image.RGBImageFilter |
filterIndexColorModel, filterRGB, 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 |
BaseFilter
public BaseFilter()
getRed
protected int getRed(int rgb)
- Gets the red value out of the rgb value.
- Parameters:
rgb - the rgb value of the pixel.
- Returns:
- the red component value.
getBlue
protected int getBlue(int rgb)
- Gets the blue value out of the rgb value.
- Parameters:
rgb - the rgb value of the pixel.
- Returns:
- the blue component value.
getGreen
protected int getGreen(int rgb)
- Gets the green value out of the rgb value.
- Parameters:
rgb - the rgb value of the pixel.
- Returns:
- the green component value.
getRGB
protected int getRGB(int rgb,
int red,
int green,
int blue)
- Returns the rgb value for the blue, red and green values.
- Parameters:
rgb - the previous rgb value of the pixel, with alpha value.red - the red component value of the pixel.green - the green component value of the pixel.blue - the blue component value of the pixel.
- Returns:
- the rgb value.
getNTSCValue
protected int getNTSCValue(int rgb)
- Converts the red green and blue values to one value.
- Parameters:
rgb - the rgb value of the pixel.
- Returns:
- a component value (between 0-255).
Copyright 2002-2002-2010 Edwin Dankert. All Rights Reserved.