All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.image.LookupOp

java.lang.Object
    |
    +----java.awt.image.LookupOp

public class LookupOp
extends Object
implements BufferedImageOp, RasterOp
This class implements a lookup operation from the source to the destination. The LookupTable object may contain a single array or multiple arrays, subject to the restrictions below.

For Rasters, the lookup operates on channel elements. The number of lookup arrays may be one, in which case the same array is applied to all channels, or it must equal the number of Source Raster channels.

For BufferedImages, the lookup operates on color and alpha components. The number of lookup arrays may be one, in which case the same array is applied to all color and alpha components, or it must equal the number of Source color components, in which case no lookup of the alpha component (if present) is performed, or it must equal the number of Source color components plus alpha components, in which case lookup is performed for all color and alpha components. This allows non-uniform rescaling of multi-channelled BufferedImages. Images with an IndexColorModel cannot be used.

This class allows the Source to be the same as Destination.

See Also:
LookupTable

Constructor Index

 o LookupOp(LookupTable)
Constructs a LookupOp object given the lookup table.

Method Index

 o createCompatibleDestImage(BufferedImage, ColorModel)
Creates an empty destination image with the correct size and number of channels.
 o createCompatibleDestRaster(Raster)
Creates an empty destination Raster with the correct size and number of channels.
 o filter(BufferedImage, BufferedImage)
Performs a lookup operation on a BufferedImage.
 o filter(Raster, WritableRaster)
Performs a lookup operation on a Raster.
 o getDestBounds(BufferedImage)
Returns the bounding box of the destination.
 o getDestBounds(Raster)
Returns the bounding box of the destination.
 o getDestPoint(Point2D, Point2D)
Returns the location of the destination point given a point in the source image.
 o getLookupTable()
Returns the LookupTable.

Constructors

 o LookupOp
public LookupOp(LookupTable lookup)
Constructs a LookupOp object given the lookup table.

Methods

 o getLookupTable
public final LookupTable getLookupTable()
Returns the LookupTable.

 o filter
public BufferedImage filter(BufferedImage src,
                            BufferedImage dst)
Performs a lookup operation on a BufferedImage. If the color model in the source image is not the same as that in the destination image, the pixels will be converted in the destination. If the destination image is null, a BufferedImage will be created with the source ColorModel. The IllegalArgumentException may be thrown if the number of arrays in the LookupTable does not meet the restrictions stated in the class comment above.

 o filter
public WritableRaster filter(Raster src,
                             WritableRaster dst)
Performs a lookup operation on a Raster. If the destination Raster is null, a new Raster will be created. The IllegalArgumentException may be thrown if the source and destination Rasters have different number of channels or if the number of arrays in the LookupTable does not meet the restrictions stated in the class comment above.

 o getDestBounds
public Rectangle2D getDestBounds(BufferedImage src)
Returns the bounding box of the destination. Since this is not a geometric operation, the bounding box does not change. The IllegalArgumentException may be thrown if the number of arrays in the LookupTable does not meet the restrictions stated in the class comment above.

 o getDestBounds
public Rectangle2D getDestBounds(Raster src)
Returns the bounding box of the destination. Since this is not a geometric operation, the bounding box does not change. The IllegalArgumentException may be thrown if the number of arrays in the LookupTable does not meet the restrictions stated in the class comment above.

 o createCompatibleDestImage
public BufferedImage createCompatibleDestImage(BufferedImage src,
                                               ColorModel destCM)
Creates an empty destination image with the correct size and number of channels. The IllegalArgumentException may be thrown if the number of arrays in the LookupTable does not meet the restrictions stated in the class comment above.

Parameters:
src - Source image for the filter operation.
destCM - ColorModel of the destination. If null, the ColorModel of the source will be used.
 o createCompatibleDestRaster
public WritableRaster createCompatibleDestRaster(Raster src)
Creates an empty destination Raster with the correct size and number of channels. The IllegalArgumentException may be thrown if the number of arrays in the LookupTable does not meet the restrictions stated in the class comment above.

 o getDestPoint
public Point2D getDestPoint(Point2D srcPt,
                            Point2D dstPt)
Returns the location of the destination point given a point in the source image. If dstPt is non-null, it will be used to hold the return value. Since this is not a geometric operation, the srcPt will equal the dstPt.


All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature