Package org.xhtmlrenderer.util
Class ImageUtil.AbstractFastScaler
java.lang.Object
org.xhtmlrenderer.util.ImageUtil.AbstractFastScaler
- All Implemented Interfaces:
ImageUtil.Scaler
- Direct Known Subclasses:
ImageUtil.AreaAverageScaler
,ImageUtil.OldScaler
- Enclosing class:
ImageUtil
private abstract static class ImageUtil.AbstractFastScaler
extends Object
implements ImageUtil.Scaler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract int
getScaledInstance
(BufferedImage img, ScalingOptions opt) Convenience method that returns a scaled instance of the providedBufferedImage
, taken from article on java.net by Chris Campbell.
-
Constructor Details
-
AbstractFastScaler
private AbstractFastScaler()
-
-
Method Details
-
getScaledInstance
Description copied from interface:ImageUtil.Scaler
Convenience method that returns a scaled instance of the providedBufferedImage
, taken from article on java.net by Chris Campbell.
Expects the image to be fully loaded (e.g. no need to wait for loading on requesting height or width)- Specified by:
getScaledInstance
in interfaceImageUtil.Scaler
- Parameters:
img
- the original image to be scaledopt
- scaling options described below: imageType type of image fromBufferedImage
(values starting with TYPE) hint one of the rendering hints that corresponds toRenderingHints.KEY_INTERPOLATION
(e.g.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR
,RenderingHints.VALUE_INTERPOLATION_BILINEAR
,RenderingHints.VALUE_INTERPOLATION_BICUBIC
) higherQuality if true, this method will use a multistep scaling technique that provides higher quality than the usual one-step technique (only useful in downscaling cases, wheretargetWidth
ortargetHeight
is smaller than the original dimensions, and generally only when theBILINEAR
hint is specified) targetWidth the desired width of the scaled instance, in pixels targetHeight the desired height of the scaled instance, in pixels- Returns:
- a scaled version of the original
BufferedImage
-
getImageScalingMethod
protected abstract int getImageScalingMethod()
-