|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.coobird.thumbnailator.resizers.DefaultResizerFactory
public class DefaultResizerFactory
This class provides factory methods which provides suitable Resizer
s
for a given situation.
Resizer
s returned by this ResizerFactory
:Resizer
s returned by this ResizerFactory
depends upon
the size of the source and destination images. The conditions and the
Resizer
s returned are as follows:
getResizer()
getResizer(Dimension, Dimension)
getResizer(Dimension, Dimension)
getResizer(Dimension, Dimension)
getResizer(Dimension, Dimension)
getResizer(Dimension, Dimension)
DefaultResizerFactory
in order to obtain the optimal Resizer
, and using that in order to
perform the resizing operation.
BufferedImage sourceImage = new BufferedImageBuilder(400, 400).build(); BufferedImage destImage = new BufferedImageBuilder(200, 200).build(); Dimension sourceSize = new Dimension(sourceImage.getWidth(), sourceImage.getHeight()); Dimension destSize = new Dimension(destImage.getWidth(), destImage.getHeight()); // Obtain the optimal Resizer for this resizing operation. Resizer resizer = DefaultResizerFactory.getInstance().getResizer(sourceSize, destSize); // Perform the resizing using the Resizer obtained from the ResizerFactory. resizer.resize(sourceImage, destImage);
Resizer
is required, the Resizers
enum
is another way to obtain Resizer
s.
Resizers
Method Summary | |
---|---|
static ResizerFactory |
getInstance()
Returns an instance of this class. |
Resizer |
getResizer()
Returns the default Resizer . |
Resizer |
getResizer(Dimension originalSize,
Dimension thumbnailSize)
Returns a suitable Resizer , given the Dimension s of the
original image and the thumbnail image. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ResizerFactory getInstance()
public Resizer getResizer()
ResizerFactory
Resizer
.
getResizer
in interface ResizerFactory
Resizer
.public Resizer getResizer(Dimension originalSize, Dimension thumbnailSize)
ResizerFactory
Resizer
, given the Dimension
s of the
original image and the thumbnail image.
getResizer
in interface ResizerFactory
originalSize
- The size of the original image.thumbnailSize
- The size of the thumbnail.
Resizer
to perform the
resizing operation for the given condition.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |