Package org.xhtmlrenderer.util
Interface ImageUtil.Scaler
- All Known Implementing Classes:
ImageUtil.AbstractFastScaler
,ImageUtil.AreaAverageScaler
,ImageUtil.FastScaler
,ImageUtil.HighQualityScaler
,ImageUtil.OldScaler
- Enclosing class:
- ImageUtil
private static interface ImageUtil.Scaler
-
Method Summary
Modifier and TypeMethodDescriptiongetScaledInstance
(BufferedImage img, ScalingOptions opt) Convenience method that returns a scaled instance of the providedBufferedImage
, taken from article on java.net by Chris Campbell.
-
Method Details
-
getScaledInstance
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)- 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
-