Contents | Package | Class | Tree | Deprecated | Index | Help | Java 1.2 Beta 3 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |
java.lang.Object | +----java.awt.image.RescaleOp
For Rasters, rescaling operates on channel elements. The number of sets of scaling constants may be one, in which case the same constants are applied to all channels, or it must equal the number of Source Raster channels.
For BufferedImages, rescaling operates on color and alpha components. The number of sets of scaling constants may be one, in which case the same constants are applied to all color and alpha components, or it must equal the number of Source color components, in which case no scaling of the alpha component (if present) is performed, or it must equal the number of Source color components plus alpha components, in which case all color and alpha components are scaled. Images with an IndexColorModel cannot be rescaled.
The pseudo code for the rescaling operation is as follows:
for each pixel from Source object { for each channel/component of the pixel { dstElement = (srcElement*scaleFactor) + offset } }Note that in-place operation is allowed (i.e. the source and destination can be the same object).
Constructor Summary | |
RescaleOp(float[] scaleFactors,
float[] offsets)
|
|
RescaleOp(float scaleFactor,
float offset)
|
Method Summary | |
BufferedImage | createCompatibleDestImage(BufferedImage src,
ColorModel destCM)
|
WritableRaster | createCompatibleDestRaster(Raster src)
|
BufferedImage | filter(BufferedImage src,
BufferedImage dst)
|
WritableRaster | filter(Raster src,
WritableRaster dst)
|
Rectangle2D | getDestBounds(BufferedImage src)
|
Rectangle2D | getDestBounds(Raster src)
|
Point2D | getDestPoint(Point2D srcPt,
Point2D dstPt)
|
int | getNumFactors()
|
float[] | getOffsets(float[] offsets)
|
float[] | getScaleFactors(float[] scaleFactors)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RescaleOp(float[] scaleFactors, float[] offsets)
public RescaleOp(float scaleFactor, float offset)
Method Detail |
public final float[] getScaleFactors(float[] scaleFactors)
public final float[] getOffsets(float[] offsets)
public final int getNumFactors()
public BufferedImage filter(BufferedImage src, BufferedImage dst)
public WritableRaster filter(Raster src, WritableRaster dst)
public Rectangle2D getDestBounds(BufferedImage src)
public Rectangle2D getDestBounds(Raster src)
public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel destCM)
src
- Source image for the filter operation.
destCM
- ColorModel of the destination. If null, the
ColorModel of the source will be used.
public WritableRaster createCompatibleDestRaster(Raster src)
public Point2D getDestPoint(Point2D srcPt, Point2D dstPt)
Contents | Package | Class | Tree | Deprecated | Index | Help | Java 1.2 Beta 3 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |