Enum Resizers
- java.lang.Object
-
- java.lang.Enum<Resizers>
-
- net.coobird.thumbnailator.resizers.Resizers
-
public enum Resizers extends java.lang.Enum<Resizers> implements Resizer
This enum can be used to select a specific
Resizerin order to perform a resizing operation.The instance held by a value of this enum is a single instance. When using specific implementations of
Resizers, it is preferable to obtain an instance of aResizerthrough this enum or theDefaultResizerFactoryclass in order to prevent many instances of theResizerclass implementations from being instantiated.- Usage:
-
The following example code demonstrates how to use the
Resizersenum in order to resize an image using bilinear interpolation:BufferedImage sourceImage = new BufferedImageBuilder(400, 400).build(); BufferedImage destImage = new BufferedImageBuilder(200, 200).build(); Resizers.BILINEAR.resize(sourceImage, destImage);
- See Also:
DefaultResizerFactory
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BICUBICAResizerwhich performs resizing operations using bicubic interpolation.BILINEARAResizerwhich performs resizing operations using bilinear interpolation.NULLAResizerwhich does not perform resizing operations.PROGRESSIVEAResizerwhich performs resizing operations using progressive bilinear scaling.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidresize(java.awt.image.BufferedImage srcImage, java.awt.image.BufferedImage destImage)Resizes an image.static ResizersvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static Resizers[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NULL
public static final Resizers NULL
AResizerwhich does not perform resizing operations. The source image will be drawn at the origin of the destination image.
-
BILINEAR
public static final Resizers BILINEAR
AResizerwhich performs resizing operations using bilinear interpolation.
-
BICUBIC
public static final Resizers BICUBIC
AResizerwhich performs resizing operations using bicubic interpolation.
-
PROGRESSIVE
public static final Resizers PROGRESSIVE
AResizerwhich performs resizing operations using progressive bilinear scaling.For details on this technique, refer to the documentation of the
ProgressiveBilinearResizerclass.
-
-
Field Detail
-
resizer
private final Resizer resizer
-
-
Constructor Detail
-
Resizers
private Resizers(Resizer resizer)
-
-
Method Detail
-
values
public static Resizers[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Resizers c : Resizers.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Resizers valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
resize
public void resize(java.awt.image.BufferedImage srcImage, java.awt.image.BufferedImage destImage)Description copied from interface:ResizerResizes an image.The source image is resized to fit the dimensions of the destination image and drawn.
-
-