jsky.image
Class GreyscaleFilter

java.lang.Object
  extended by java.awt.image.ImageFilter
      extended by java.awt.image.RGBImageFilter
          extended by jsky.image.GreyscaleFilter
All Implemented Interfaces:
java.awt.image.ImageConsumer, java.lang.Cloneable

public class GreyscaleFilter
extends java.awt.image.RGBImageFilter

Filters an image by converting colors to greyscale.

This code was developed by NASA, Goddard Space Flight Center, Code 588 for the Scientist's Expert Assistant (SEA) project.

Version:
07/30/98
Author:
J. Jones / 588

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
GreyscaleFilter()
          The only constructor.
 
Method Summary
 int filterRGB(int x, int y, int rgb)
          This method is never called because we override filterRGBPixels() (this is done for efficiency, since don't have to call this method for every pixel).
 void filterRGBPixels(int x, int y, int w, int h, int[] pixels, int off, int scansize)
          This method performs the actual modification of the image.
 
Methods inherited from class java.awt.image.RGBImageFilter
filterIndexColorModel, 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

GreyscaleFilter

public GreyscaleFilter()
The only constructor.

Method Detail

filterRGB

public int filterRGB(int x,
                     int y,
                     int rgb)
This method is never called because we override filterRGBPixels() (this is done for efficiency, since don't have to call this method for every pixel). Normally this method would return a single filtered pixel value.

Specified by:
filterRGB in class java.awt.image.RGBImageFilter

filterRGBPixels

public void filterRGBPixels(int x,
                            int y,
                            int w,
                            int h,
                            int[] pixels,
                            int off,
                            int scansize)
This method performs the actual modification of the image. It is overridden for efficiency, since the filterRGB() method is normally called for each individual pixel in the image.

Overrides:
filterRGBPixels in class java.awt.image.RGBImageFilter