P
- type of ParameterProviderpublic abstract class AbstractCropAndResize<P extends ParameterProvider<?>> extends Object implements ImageOperation<P>
Constructor and Description |
---|
AbstractCropAndResize() |
Modifier and Type | Method and Description |
---|---|
BufferedImage |
apply(BufferedImage source,
P params) |
protected abstract Coords |
getCroopCoords(BufferedImage source,
P params)
Determines the coordinates of the cropping to apply on the source image.
|
protected abstract Size |
getEffectiveTargetSize(BufferedImage source,
Coords cropCoords,
P params)
Determines the actual size for the resized image based on the source image, the crop coordinates
calculated by
getCroopCoords(java.awt.image.BufferedImage, P) and the given ParameterProvider. |
Resizer |
getResizer() |
protected BufferedImage |
resize(BufferedImage src,
Coords srcCoords,
Size targetSize) |
void |
setResizer(Resizer resizer) |
public BufferedImage apply(BufferedImage source, P params) throws ImagingException
apply
in interface ImageOperation<P extends ParameterProvider<?>>
ImagingException
protected abstract Coords getCroopCoords(BufferedImage source, P params) throws ImagingException
ImagingException
protected abstract Size getEffectiveTargetSize(BufferedImage source, Coords cropCoords, P params)
getCroopCoords(java.awt.image.BufferedImage, P)
and the given ParameterProvider.protected BufferedImage resize(BufferedImage src, Coords srcCoords, Size targetSize)
public Resizer getResizer()
public void setResizer(Resizer resizer)
Copyright © 2016 Magnolia International Ltd.. All rights reserved.