|
Préférences
Moteurs de recherche
|
|||||||||||||||||||||||||||||||||||||
JavaTM 2 Platform Std. Ed. v1.4.2
java.awt.image
|
Field Summary | |
protected boolean |
canFilterIndexColorModel
This boolean indicates whether or not it is acceptable to apply the color filtering of the filterRGB method to the color table entries of an IndexColorModel object in lieu of pixel by pixel filtering. |
protected ColorModel |
newmodel
The ColorModel with which to
replace origmodel when the user calls
substituteColorModel . |
protected ColorModel |
origmodel
The ColorModel to be replaced by
newmodel when the user calls
substituteColorModel . |
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 | |
RGBImageFilter()
|
Method Summary | |
IndexColorModel |
filterIndexColorModel(IndexColorModel icm)
Filters an IndexColorModel object by running each entry in its color tables through the filterRGB function that RGBImageFilter subclasses must provide. |
abstract int |
filterRGB(int x,
int y,
int rgb)
Subclasses must specify a method to convert a single input pixel in the default RGB ColorModel to a single output pixel. |
void |
filterRGBPixels(int x,
int y,
int w,
int h,
int[] pixels,
int off,
int scansize)
Filters a buffer of pixels in the default RGB ColorModel by passing them one by one through the filterRGB method. |
void |
setColorModel(ColorModel model)
If the ColorModel is an IndexColorModel, and the subclass has set the canFilterIndexColorModel flag to true, we substitute a filtered version of the color model here and wherever that original ColorModel object appears in the setPixels methods. |
void |
setPixels(int x,
int y,
int w,
int h,
ColorModel model,
byte[] pixels,
int off,
int scansize)
If the ColorModel object is the same one that has already been converted, then simply passes the pixels through with the converted ColorModel. |
void |
setPixels(int x,
int y,
int w,
int h,
ColorModel model,
int[] pixels,
int off,
int scansize)
If the ColorModel object is the same one that has already been converted, then simply passes the pixels through with the converted ColorModel, otherwise converts the buffer of integer pixels to the default RGB ColorModel and passes the converted buffer to the filterRGBPixels method to be converted one by one. |
void |
substituteColorModel(ColorModel oldcm,
ColorModel newcm)
Registers two ColorModel objects for substitution. |
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 |
protected ColorModel origmodel
ColorModel
to be replaced by
newmodel
when the user calls
substituteColorModel
.
protected ColorModel newmodel
ColorModel
with which to
replace origmodel
when the user calls
substituteColorModel
.
protected boolean canFilterIndexColorModel
Constructor Detail |
public RGBImageFilter()
Method Detail |
public void setColorModel(ColorModel model)
Note: This method is intended to be called by the
ImageProducer
of the Image
whose pixels
are being filtered. Developers using
this class to filter pixels from an image should avoid calling
this method directly since that operation could interfere
with the filtering operation.
setColorModel
in interface ImageConsumer
setColorModel
in class ImageFilter
ImageConsumer
,
ColorModel.getRGBdefault()
public void substituteColorModel(ColorModel oldcm, ColorModel newcm)
oldcm
- the ColorModel object to be replaced on the flynewcm
- the ColorModel object to replace oldcm on the flypublic IndexColorModel filterIndexColorModel(IndexColorModel icm)
icm
- the IndexColorModel object to be filtered
public void filterRGBPixels(int x, int y, int w, int h, int[] pixels, int off, int scansize)
w
- the width of the region of pixelsh
- the height of the region of pixelspixels
- the array of pixelsoff
- the offset into the pixels
arrayscansize
- the distance from one row of pixels to the next
in the arrayColorModel.getRGBdefault()
,
filterRGB(int, int, int)
public void setPixels(int x, int y, int w, int h, ColorModel model, byte[] pixels, int off, int scansize)
Note: This method is intended to be called by the
ImageProducer
of the Image
whose pixels
are being filtered. Developers using
this class to filter pixels from an image should avoid calling
this method directly since that operation could interfere
with the filtering operation.
setPixels
in interface ImageConsumer
setPixels
in class ImageFilter
public void setPixels(int x, int y, int w, int h, ColorModel model, int[] pixels, int off, int scansize)
Note: This method is intended to be called by the
ImageProducer
of the Image
whose pixels
are being filtered. Developers using
this class to filter pixels from an image should avoid calling
this method directly since that operation could interfere
with the filtering operation.
setPixels
in interface ImageConsumer
setPixels
in class ImageFilter
public abstract int filterRGB(int x, int y, int rgb)
rgb
- the integer pixel representation in the default RGB
color model
ColorModel.getRGBdefault()
,
filterRGBPixels(int, int, int, int, int[], int, int)