info.magnolia.imaging.operations.cropresize
Class Size

java.lang.Object
  extended by 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)
           
 
Method Summary
static Size conformToCropRatio(Coords cropCoords, int targetWidth, int targetHeight)
           
 int getHeight()
           
 int getWidth()
           
static Size maxSizeComplyingWithSourceRatio(int sourceWidth, int sourceHeight, int maxWidth, int maxHeight)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Size

public Size(int width,
            int height)
Method Detail

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 © 2013 Magnolia International Ltd.. All Rights Reserved.