java.awt.image
Class RGBImageFilter
- Cloneable, ImageConsumer
A filter designed to filter images in the default RGBColorModel regardless of
the ImageProducer's ColorModel.
IndexColorModel | filterIndexColorModel(IndexColorModel icm) - Filters an IndexColorModel through the filterRGB function.
|
abstract int | filterRGB(int x, int y, int rgb) - Filters a single pixel from the default ColorModel.
|
void | filterRGBPixels(int x, int y, int w, int h, int[] pixels, int offset, int scansize) - This functions filters a set of RGB pixels through filterRGB.
|
void | setColorModel(ColorModel model) - Sets the ColorModel used to filter with.
|
void | setPixels(int x, int y, int w, int h, 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.
|
void | setPixels(int x, int y, int w, int h, 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).
|
void | substituteColorModel(ColorModel oldcm, ColorModel newcm) - Registers a new ColorModel to subsitute for the old ColorModel when
setPixels encounters the a pixel with the old ColorModel.
|
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
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.
filterIndexColorModel
public IndexColorModel filterIndexColorModel(IndexColorModel icm)
Filters an IndexColorModel through the filterRGB function. Uses
coordinates of -1 to indicate its filtering an index and not a pixel.
icm
- an IndexColorModel to filter
filterRGB
public abstract int filterRGB(int x,
int y,
int rgb)
Filters a single pixel from the default ColorModel.
x
- x-coordinatey
- y-coordinatergb
- color
filterRGBPixels
public void filterRGBPixels(int x,
int y,
int w,
int h,
int[] pixels,
int offset,
int scansize)
This functions filters a set of RGB pixels through filterRGB.
x
- the x coordinate of the rectangley
- the y coordinate of the rectanglew
- the width of the rectangleh
- the height of the rectanglepixels
- the array of pixel valuesoffset
- the index of the first pixels in the
pixels
arrayscansize
- the width to use in extracting pixels from the
pixels
array
setColorModel
public void setColorModel(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
- setColorModel in interface ImageConsumer
- setColorModel in interface ImageFilter
model
- the color model to be used most often by setPixels
setPixels
public void setPixels(int x,
int y,
int w,
int h,
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.
- setPixels in interface ImageConsumer
- setPixels in interface ImageFilter
x
- the x coordinate of the rectangley
- the y coordinate of the rectanglew
- the width of the rectangleh
- the height of the rectanglemodel
- the ColorModel
used to translate the pixelspixels
- the array of pixel valuesoffset
- the index of the first pixels in the pixels
arrayscansize
- the width to use in extracting pixels from the
pixels
array
setPixels
public void setPixels(int x,
int y,
int w,
int h,
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).
- setPixels in interface ImageConsumer
- setPixels in interface ImageFilter
x
- the x coordinate of the rectangley
- the y coordinate of the rectanglew
- the width of the rectangleh
- the height of the rectanglemodel
- the ColorModel
used to translate the pixelspixels
- the array of pixel valuesoffset
- the index of the first pixels in the pixels
arrayscansize
- the width to use in extracting pixels from the
pixels
array
substituteColorModel
public void substituteColorModel(ColorModel oldcm,
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.
oldcm
- the old ColorModelnewcm
- the new ColorModel
RGBImageFilter.java -- Java class for filtering Pixels by RGB values
Copyright (C) 1999, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.