Package com.day.image
Class ResizeOp
java.lang.Object
com.day.image.AbstractBufferedImageOp
com.day.image.ResizeOp
- All Implemented Interfaces:
BufferedImageOp
The ResizeOp class implements a weighted resize filter which produces better
results than the scaling AffineTransformOp and is faster than a blurring
ConvolveOp with a following scaling AffineTransformOp.
The RenderingHints defined at construction time are used if the
destination color model has to be adapted for the filter operation.
Note that the following constraints have to be met
- The
sourceanddestinationmust be different.
- Since:
- coati
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionResizeOp(double scale) Creates a newResizeOpwith no rendering hints and the same horizontal and vertical scale factor.ResizeOp(double scaleX, double scaleY) Creates a newResizeOpwith no rendering hints.ResizeOp(double scaleX, double scaleY, RenderingHints hints) Creates a newResizeOpobject. -
Method Summary
Modifier and TypeMethodDescriptiongetBounds2D(BufferedImage src) Returns the bounding box of the filtered destination image.getPoint2D(Point2D srcPt, Point2D dstPt) Returns the location of the destination point given a point in the source image.booleanisFast()voidsetFast(boolean fast) Methods inherited from class com.day.image.AbstractBufferedImageOp
createCompatibleDestImage, filter, getRenderingHints
-
Constructor Details
-
ResizeOp
Creates a newResizeOpobject.- Parameters:
scaleX- The horizontal scale factorscaleY- The vertical scale factorhints- The rendering hints. May benull.
-
ResizeOp
public ResizeOp(double scaleX, double scaleY) Creates a newResizeOpwith no rendering hints.- Parameters:
scaleX- The horizontal scale factorscaleY- The vertical scale factor
-
ResizeOp
public ResizeOp(double scale) Creates a newResizeOpwith no rendering hints and the same horizontal and vertical scale factor.- Parameters:
scale- The scale factor used for both horizontal and vertical scaling.
-
-
Method Details
-
getBounds2D
Returns the bounding box of the filtered destination image. The IllegalArgumentException may be thrown if the source image is incompatible with the types of images allowed by the class implementing this filter.- Specified by:
getBounds2Din interfaceBufferedImageOp- Overrides:
getBounds2Din classAbstractBufferedImageOp
-
getPoint2D
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.- Specified by:
getPoint2Din interfaceBufferedImageOp- Overrides:
getPoint2Din classAbstractBufferedImageOp
-
isFast
public boolean isFast() -
setFast
public void setFast(boolean fast)
-