Class AbstractFilter
java.lang.Object
org.pushingpixels.flamingo.internal.utils.AbstractFilter
- All Implemented Interfaces:
BufferedImageOp
- Direct Known Subclasses:
ColorShiftFilter
Provides an abstract implementation of the BufferedImageOp
interface. This class can be used to created new image filters based on
BufferedImageOp
.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateCompatibleDestImage
(BufferedImage src, ColorModel destCM) getBounds2D
(BufferedImage src) protected int[]
getPixels
(BufferedImage img, int x, int y, int w, int h, int[] pixels) Returns an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space, from a portion of the image data.getPoint2D
(Point2D srcPt, Point2D dstPt) protected void
setPixels
(BufferedImage img, int x, int y, int w, int h, int[] pixels) Writes a rectangular area of pixels in the destinationBufferedImage
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.awt.image.BufferedImageOp
filter
-
Constructor Details
-
AbstractFilter
public AbstractFilter()
-
-
Method Details
-
getBounds2D
- Specified by:
getBounds2D
in interfaceBufferedImageOp
-
createCompatibleDestImage
- Specified by:
createCompatibleDestImage
in interfaceBufferedImageOp
-
getPoint2D
- Specified by:
getPoint2D
in interfaceBufferedImageOp
-
getRenderingHints
- Specified by:
getRenderingHints
in interfaceBufferedImageOp
-
getPixels
Returns an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space, from a portion of the image data.- Parameters:
img
- Image.x
- The starting X coordinatey
- The starting Y coordinatew
- Width of region.h
- Height of region.pixels
- If notnull
, the pixels are written here.- Returns:
- Array or RGB pixels.
-
setPixels
Writes a rectangular area of pixels in the destination
BufferedImage
. Calling this method on an image of type different fromBufferedImage.TYPE_INT_ARGB
andBufferedImage.TYPE_INT_RGB
will unmanage the image.- Parameters:
img
- the destination imagex
- the x location at which to start storing pixelsy
- the y location at which to start storing pixelsw
- the width of the rectangle of pixels to storeh
- the height of the rectangle of pixels to storepixels
- an array of pixels, stored as integers- Throws:
IllegalArgumentException
- ispixels
is non-null and of length < w*h
-