Class ProgressiveBilinearResizer
- java.lang.Object
-
- net.coobird.thumbnailator.resizers.AbstractResizer
-
- net.coobird.thumbnailator.resizers.ProgressiveBilinearResizer
-
- All Implemented Interfaces:
Resizer
public class ProgressiveBilinearResizer extends AbstractResizer
AResizerwhich performs resizing operations by using progressive bilinear scaling.The resizing technique used in this class is based on the technique discussed in Chapter 4: Images of Filthy Rich Clients by Chet Haase and Romain Guy.
The actual implementation of the technique is independent of the code which is provided in the book.
-
-
Field Summary
Fields Modifier and Type Field Description private BilinearResizerbilinearResizerA resizer that's used when a single-step resize is needed.-
Fields inherited from class net.coobird.thumbnailator.resizers.AbstractResizer
KEY_INTERPOLATION, RENDERING_HINTS, UNMODIFIABLE_RENDERING_HINTS
-
-
Constructor Summary
Constructors Constructor Description ProgressiveBilinearResizer()Instantiates aProgressiveBilinearResizerwith default rendering hints.ProgressiveBilinearResizer(java.util.Map<java.awt.RenderingHints.Key,java.lang.Object> hints)Instantiates aProgressiveBilinearResizerwith the specified rendering hints.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidresize(java.awt.image.BufferedImage srcImage, java.awt.image.BufferedImage destImage)Resizes an image using the progressive bilinear scaling technique.-
Methods inherited from class net.coobird.thumbnailator.resizers.AbstractResizer
createGraphics, getRenderingHints, performChecks
-
-
-
-
Field Detail
-
bilinearResizer
private final BilinearResizer bilinearResizer
A resizer that's used when a single-step resize is needed.
-
-
Constructor Detail
-
ProgressiveBilinearResizer
public ProgressiveBilinearResizer()
Instantiates aProgressiveBilinearResizerwith default rendering hints.
-
ProgressiveBilinearResizer
public ProgressiveBilinearResizer(java.util.Map<java.awt.RenderingHints.Key,java.lang.Object> hints)
Instantiates aProgressiveBilinearResizerwith the specified rendering hints.- Parameters:
hints- Additional rendering hints to apply.
-
-
Method Detail
-
resize
public void resize(java.awt.image.BufferedImage srcImage, java.awt.image.BufferedImage destImage) throws java.lang.NullPointerExceptionResizes an image using the progressive bilinear scaling technique.When the source image isn't at least twice as large as the destination image for both dimensions, a regular one-step scaling is performed.
If the source and/or destination image is
null, then aNullPointerExceptionwill be thrown.- Specified by:
resizein interfaceResizer- Overrides:
resizein classAbstractResizer- Parameters:
srcImage- The source image.destImage- The destination image.- Throws:
java.lang.NullPointerException- When the source and/or the destination image isnull.
-
-