imager
Class DefaultImageFilter

java.lang.Object
  |
  +--java.awt.image.ImageFilter
        |
        +--java.awt.image.RGBImageFilter
              |
              +--imager.DefaultImageFilter
All Implemented Interfaces:
java.lang.Cloneable, java.awt.image.ImageConsumer

public abstract class DefaultImageFilter
extends java.awt.image.RGBImageFilter


Field Summary
protected  int m_PercentProgress
          variable to indicate the progress in percentage
 
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
DefaultImageFilter()
           
 
Method Summary
abstract  int filterRGB(int x, int y, int rgb)
          Abstract method of RGBImageFilter.
static int getBlue(int p_Pixel)
          Method to obtain the blue component of the RGB int pixel
static int getGreen(int p_Pixel)
          Method to obtain the green component of the RGB int pixel
 int getPercentProgress()
          method to get the percentage of filter operation completed.
static int getPixel(int r, int g, int b)
          Method to obtain the int pixel value in form of ARGB
static int getRed(int p_Pixel)
          Method to obtain the red component of the RGB int pixel
 void setPercentProgress(int percent)
          method to set the percentage of progress of the filter operation.
 
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

m_PercentProgress

protected int m_PercentProgress
variable to indicate the progress in percentage

Constructor Detail

DefaultImageFilter

public DefaultImageFilter()
Method Detail

filterRGB

public abstract int filterRGB(int x,
                              int y,
                              int rgb)
Abstract method of RGBImageFilter. This method must be implemented by Filters extending from this DefaultImageFilter class.

Specified by:
filterRGB in class java.awt.image.RGBImageFilter
Parameters:
x - x position of the pixel
y - y position of the pixel
rgb - int ARGB form of the pixel
Returns:
the int ARGB pixel after modification

getPercentProgress

public int getPercentProgress()
method to get the percentage of filter operation completed. Usually this method is used by the JPhotoBrush to obtain how much of the operation has been completed so far

Returns:
int value of the precentage completed

setPercentProgress

public void setPercentProgress(int percent)
method to set the percentage of progress of the filter operation. This is usually set from the method public int filterRGB(int x, int y, int rgb).


getRed

public static int getRed(int p_Pixel)
Method to obtain the red component of the RGB int pixel

Parameters:
p_Pixel - the pixel in int ARGB form
Returns:
red component of the RGB int pixel

getGreen

public static int getGreen(int p_Pixel)
Method to obtain the green component of the RGB int pixel

Parameters:
p_Pixel - the pixel in int ARGB form
Returns:
green component of the RGB int pixel

getBlue

public static int getBlue(int p_Pixel)
Method to obtain the blue component of the RGB int pixel

Parameters:
p_Pixel - the pixel in int ARGB form
Returns:
blue component of the RGB int pixel

getPixel

public static int getPixel(int r,
                           int g,
                           int b)
Method to obtain the int pixel value in form of ARGB

Parameters:
r - red component
g - green component
b - blue compoment
Returns:
the pixel in ARGB int form