|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.coobird.thumbnailator.resizers.DefaultResizerFactory
public class DefaultResizerFactory
This class provides factory methods which provides suitable Resizers
for a given situation.
Resizers returned by this ResizerFactory:Resizers returned by this ResizerFactory depends upon
the size of the source and destination images. The conditions and the
Resizers 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 Resizers.
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 Dimensions 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()
ResizerFactoryResizer.
getResizer in interface ResizerFactoryResizer.
public Resizer getResizer(Dimension originalSize,
Dimension thumbnailSize)
ResizerFactoryResizer, given the Dimensions of the
original image and the thumbnail image.
getResizer in interface ResizerFactoryoriginalSize - 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 | ||||||||