info.magnolia.imaging.operations.cropresize
Class Size
java.lang.Object
info.magnolia.imaging.operations.cropresize.Size
- All Implemented Interfaces:
- Serializable
public class Size
- extends Object
- implements Serializable
A simple immutable bean holding two integers reprensenting a Size, width and height.
Similar to java.awt.Dimension, without all the toolkit and environment
dependencies.
Provides factory methods to calculate sizes based on ratios, source dimensions, crop coordinates.
- Version:
- $Id$
- See Also:
- Serialized Form
Constructor Summary |
Size(int width,
int height)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Size
public Size(int width,
int height)
getWidth
public int getWidth()
getHeight
public int getHeight()
conformToCropRatio
public static Size conformToCropRatio(Coords cropCoords,
int targetWidth,
int targetHeight)
maxSizeComplyingWithSourceRatio
public static Size maxSizeComplyingWithSourceRatio(int sourceWidth,
int sourceHeight,
int maxWidth,
int maxHeight)
Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.