|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.image.RescaleOp
public class RescaleOp
RescaleOp is a filter that changes each pixel by a scaling factor and offset. For filtering Rasters, either one scaling factor and offset can be specified, which will be applied to all bands; or a scaling factor and offset can be specified for each band. For BufferedImages, the scaling may apply to both color and alpha components. If only one scaling factor is provided, or if the number of factors provided equals the number of color components, the scaling is performed on all color components. Otherwise, the scaling is performed on all components including alpha. Alpha premultiplication is ignored. After filtering, if color conversion is necessary, the conversion happens, taking alpha premultiplication into account.
| Constructor Summary | |
|---|---|
RescaleOp(float[] scaleFactors,
float[] offsets,
RenderingHints hints)
Create a new RescaleOp object using the given scale factors and offsets. |
|
RescaleOp(float scaleFactor,
float offset,
RenderingHints hints)
Create a new RescaleOp object using the given scale factor and offset. |
|
| Method Summary | |
|---|---|
BufferedImage |
createCompatibleDestImage(BufferedImage src,
ColorModel dstCM)
Returns a new BufferedImage that can be used by this
BufferedImageOp as the destination image when filtering
the specified source image. |
WritableRaster |
createCompatibleDestRaster(Raster src)
Returns a raster that can be used by this RasterOp as the
destination raster when operating on the specified source raster. |
BufferedImage |
filter(BufferedImage src,
BufferedImage dst)
Converts the source image using the scale factors and offsets specified in the constructor. |
WritableRaster |
filter(Raster src,
WritableRaster dest)
Performs an operation on the source raster, returning the result in a writable raster. |
Rectangle2D |
getBounds2D(BufferedImage src)
Returns the bounds of the destination image on the basis of this BufferedImageOp being applied to the specified source image. |
Rectangle2D |
getBounds2D(Raster src)
Returns the bounds of the destination raster on the basis of this RasterOp being applied to the specified source raster. |
int |
getNumFactors()
Returns the number of scaling factors / offsets. |
float[] |
getOffsets(float[] offsets)
Returns the offsets. |
Point2D |
getPoint2D(Point2D src,
Point2D dst)
Returns the point on the destination image that corresponds to the given point on the source image. |
RenderingHints |
getRenderingHints()
Returns the rendering hints for this operation. |
float[] |
getScaleFactors(float[] scaleFactors)
Returns the scaling factors. |
| 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,
RenderingHints hints)
scaleFactors - an array of scale factors.offsets - an array of offsets.hints - any rendering hints to use (can be null).
NullPointerException - if the scaleFactors or offsets array is null.
public RescaleOp(float scaleFactor,
float offset,
RenderingHints hints)
scaleFactor - the scale factor to use.offset - the offset to use.hints - any rendering hints to use (can be null).| Method Detail |
|---|
public final float[] getScaleFactors(float[] scaleFactors)
scaleFactors - array to store the scaling factors in (can be null).
public final float[] getOffsets(float[] offsets)
offsets - array to store the offsets in (can be null).
public final int getNumFactors()
public final RenderingHints getRenderingHints()
BufferedImageOp
getRenderingHints in interface BufferedImageOpgetRenderingHints in interface RasterOp
public final BufferedImage filter(BufferedImage src,
BufferedImage dst)
filter in interface BufferedImageOpsrc - The source image.dst - The destination image.
IllegalArgumentException - if the rasters and/or color spaces are
incompatible.
public final WritableRaster filter(Raster src,
WritableRaster dest)
RasterOpdest is null, a new
WritableRaster will be created by calling the
RasterOp.createCompatibleDestRaster(Raster) method. If dest
is not null, the result is written to dest then
returned (this avoids creating a new WritableRaster each
time this method is called).
filter in interface RasterOpsrc - the source raster.dest - the destination raster (null permitted).
public BufferedImage createCompatibleDestImage(BufferedImage src,
ColorModel dstCM)
BufferedImageOpBufferedImage that can be used by this
BufferedImageOp as the destination image when filtering
the specified source image.
createCompatibleDestImage in interface BufferedImageOpsrc - the source image.dstCM - the color model for the destination image.
public WritableRaster createCompatibleDestRaster(Raster src)
RasterOpRasterOp as the
destination raster when operating on the specified source raster.
createCompatibleDestRaster in interface RasterOpsrc - the source raster.
public final Rectangle2D getBounds2D(BufferedImage src)
BufferedImageOpBufferedImageOp being applied to the specified source image.
getBounds2D in interface BufferedImageOpsrc - the source image.
public final Rectangle2D getBounds2D(Raster src)
RasterOpRasterOp being applied to the specified source raster.
getBounds2D in interface RasterOpsrc - the source raster.
public final Point2D getPoint2D(Point2D src,
Point2D dst)
BufferedImageOp
getPoint2D in interface BufferedImageOpgetPoint2D in interface RasterOpsrc - the source point.dst - the destination point (null permitted).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||