All Packages Class Hierarchy This Package Previous Next Index
![]() |
java.lang.Object
|
+----java.awt.image.ImageFilter
|
+----Acme.JPM.Filters.ImageFilterPlus
|
+----Acme.JPM.Filters.RGBBlockFilter
Similar in concept to java.awt.image.RGBImageFilter, but designed to run more efficiently when filtering large images.
As with RGBImageFilter, you only have to implement a single routine to use the filter. However, RGBImageFilter's routine filters a single pixel at a time. This means a lot of routine-calling overhead. RGBBlockFilter filters a block at a time.
Here's a sample RGBBlockFilter that makes an image translucent by setting all the alpha values to 0x80:
class TranslucentFilter extends RGBBlockFilter
{
public int[] filterRGBBlock(
int x, int y, int width, int height, int[][] rgbPixels )
{
for ( int row = 0; row < height; ++row )
for ( int col = 0; col < width; ++col )
rgbPixels[row][col] =
( rgbPixels[row][col] & 0x00ffffff ) | 0x80000000;
return rgbPixels;
}
}
Fetch the software.
Fetch the entire Acme package.
public RGBBlockFilter(ImageProducer producer)
public abstract int[][] filterRGBBlock(int x,
int y,
int width,
int height,
int rgbPixels[][])
public void setColorModel(ColorModel model)
public void setPixels(int x,
int y,
int width,
int height,
ColorModel model,
byte pixels[],
int offset,
int scansize)
public void setPixels(int x,
int y,
int width,
int height,
ColorModel model,
int pixels[],
int offset,
int scansize)
All Packages Class Hierarchy This Package Previous Next Index
ACME Java ACME Labs