info.magnolia.imaging.operations.cropresize
Class BoundedResize
java.lang.Object
info.magnolia.imaging.operations.cropresize.AbstractCropAndResize
info.magnolia.imaging.operations.cropresize.BoundedResize
- All Implemented Interfaces:
- ImageOperation
public class BoundedResize
- extends AbstractCropAndResize
A CropAndResize implementation which will never crop, and resize to either
maxHeight or maxWidth while keeping the original image's ratio.
- Version:
- $Id$
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BoundedResize
public BoundedResize()
getCroopCoords
protected Coords getCroopCoords(BufferedImage source,
ParameterProvider params)
throws ImagingException
- Description copied from class:
AbstractCropAndResize
- Determines the coordinates of the cropping to apply on the source image.
If no cropping needs to happen, return new Coords(0, 0, source.getWidth(), source.getHeight()).
- Specified by:
getCroopCoords
in class AbstractCropAndResize
- Throws:
ImagingException
getEffectiveTargetSize
protected Size getEffectiveTargetSize(BufferedImage source,
Coords cropCoords,
ParameterProvider params)
- Description copied from class:
AbstractCropAndResize
- Determines the actual size for the resized image based on the source image, the crop coordinates
calculated by
AbstractCropAndResize.getCroopCoords(java.awt.image.BufferedImage, P)
and the given ParameterProvider.
- Specified by:
getEffectiveTargetSize
in class AbstractCropAndResize
getMaxWidth
public int getMaxWidth()
setMaxWidth
public void setMaxWidth(int maxWidth)
getMaxHeight
public int getMaxHeight()
setMaxHeight
public void setMaxHeight(int maxHeight)
Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.