com.atlassian.jira.avatar
Class ImageScaler

java.lang.Object
  extended by com.atlassian.jira.avatar.ImageScaler

public class ImageScaler
extends Object

Helper class for managing image scaling for Avatars.

Since:
v4.0

Constructor Summary
ImageScaler()
           
 
Method Summary
 RenderedImage getSelectedImageData(BufferedImage sourceImage, Selection crop, int size)
          Creates an image consisting of the given selection of the source image rescaled to a square with the given size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageScaler

public ImageScaler()
Method Detail

getSelectedImageData

public RenderedImage getSelectedImageData(BufferedImage sourceImage,
                                          Selection crop,
                                          int size)
Creates an image consisting of the given selection of the source image rescaled to a square with the given size. If the selection is null, a not-entirely-stupid algorithm for determining a plausible square subselection.

Parameters:
sourceImage - the image source to crop and scale from.
crop - the subrectangle to use, usually square to avoid aspect ratio changes.
size - the desired size of the edge of the resulting square image.
Returns:
the new image.


Copyright © 2002-2012 Atlassian. All Rights Reserved.