Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt.image

Class RGBImageFilter

java.lang.Object
|
+--java.awt.image.ImageFilter
   |
   +--java.awt.image.RGBImageFilter


public abstract class RGBImageFilter

extends ImageFilter

A filter designed to filter images in the default RGBColorModel regardless of the ImageProducer's ColorModel.

Author:

Field Summary

booleancanFilterIndexColorModel

Specifies whether to apply the filter to the index entries of the IndexColorModel.
java.awt.image.ColorModelnewmodel

java.awt.image.ColorModelorigmodel

A filter designed to filter images in the default RGBColorModel regardless of the ImageProducer's ColorModel.

Constructor Summary

RGBImageFilter()

Construct new RGBImageFilter.

Method Summary

java.awt.image.IndexColorModelfilterIndexColorModel(java.awt.image.IndexColorModel icm)

Filters an IndexColorModel through the filterRGB function.
intfilterRGB(int x, int y, int rgb)

Filters a single pixel from the default ColorModel.
voidfilterRGBPixels(int x, int y, int w, int h, int[] pixels, int off, int scansize)

This functions filters a set of RGB pixels through filterRGB.
voidsetColorModel(java.awt.image.ColorModel model)

Sets the ColorModel used to filter with.
voidsetPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, byte[] pixels, int offset, int scansize)

If the ColorModel is the same ColorModel which as already converted then it converts it the converted ColorModel.
voidsetPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, int[] pixels, int offset, int scansize)

This function delivers a rectangle of pixels where any pixel(m,n) is stored in the array as an int at index (n * scansize + m + offset).
voidsubstituteColorModel(java.awt.image.ColorModel oldcm, java.awt.image.ColorModel newcm)

Registers a new ColorModel to subsitute for the old ColorModel when setPixels encounters the a pixel with the old ColorModel.

Field Details

canFilterIndexColorModel

protected boolean canFilterIndexColorModel

Specifies whether to apply the filter to the index entries of the IndexColorModel. Subclasses should set this to true if the filter does not depend on the pixel's coordinate.


newmodel

protected ColorModel newmodel


origmodel

protected ColorModel origmodel

A filter designed to filter images in the default RGBColorModel regardless of the ImageProducer's ColorModel.

Author:

Constructor Details

RGBImageFilter

public RGBImageFilter()

Construct new RGBImageFilter.


Method Details

filterIndexColorModel

public IndexColorModel filterIndexColorModel(java.awt.image.IndexColorModel icm)

Filters an IndexColorModel through the filterRGB function. Uses coordinates of -1 to indicate its filtering an index and not a pixel.

Parameters:


filterRGB

public int filterRGB(int x, int y, int rgb)

Filters a single pixel from the default ColorModel.

Parameters:


filterRGBPixels

public void filterRGBPixels(int x, int y, int w, int h, int[] pixels, int off, int scansize)

This functions filters a set of RGB pixels through filterRGB.

Parameters:


setColorModel

public void setColorModel(java.awt.image.ColorModel model)

Sets the ColorModel used to filter with. If the specified ColorModel is IndexColorModel and canFilterIndexColorModel is true, we subsitute the ColorModel for a filtered one here and in setPixels whenever the original one appears. Otherwise overrides the default ColorModel of ImageProducer and specifies the default RGBColorModel

Parameters:

See Also:


setPixels

public void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, byte[] pixels, int offset, int scansize)

If the ColorModel is the same ColorModel which as already converted then it converts it the converted ColorModel. Otherwise it passes the array of pixels through filterRGBpixels.

Parameters:


setPixels

public void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, int[] pixels, int offset, int scansize)

This function delivers a rectangle of pixels where any pixel(m,n) is stored in the array as an int at index (n * scansize + m + offset).

Parameters:


substituteColorModel

public void substituteColorModel(java.awt.image.ColorModel oldcm, java.awt.image.ColorModel newcm)

Registers a new ColorModel to subsitute for the old ColorModel when setPixels encounters the a pixel with the old ColorModel. The pixel remains unchanged except for a new ColorModel.

Parameters: