Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

org.bounce.image
Class BaseFilter

java.lang.Object
  extended by java.awt.image.ImageFilter
      extended by java.awt.image.RGBImageFilter
          extended by 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

Field Summary
 
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
BaseFilter()
           
 
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
 

Constructor Detail

BaseFilter

public BaseFilter()
Method Detail

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).

Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

Copyright 2002-2002-2009 Edwin Dankert. All Rights Reserved.