|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.varienaja.util.coverart.ImageScaler
public class ImageScaler
This class provides functions for scaling square jpeg-images to new sizes.
Constructor Summary | |
---|---|
ImageScaler()
|
Method Summary | |
---|---|
static java.awt.Dimension |
calculateNewDimension(int width,
int height,
int newSize)
Calculates a new dimension for an object. |
static java.awt.image.BufferedImage |
scale(java.awt.Image image,
int newSize)
Scales a source-image to a new image |
static java.awt.image.BufferedImage |
scale(java.io.InputStream input,
int newSize)
Scales a source-jpeg to a new image |
static boolean |
scale(java.io.InputStream input,
java.lang.String dest,
int newSize)
Scales a source-jpeg to a new jpeg. |
static boolean |
scale(java.lang.String source,
java.lang.String dest,
int newSize)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImageScaler()
Method Detail |
---|
public static boolean scale(java.io.InputStream input, java.lang.String dest, int newSize)
input
- The source jpeg to usedest
- The filename of the target jpeg (will be generated)newSize
- The new size of the image (will be used for both x and y)
public static boolean scale(java.lang.String source, java.lang.String dest, int newSize) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public static java.awt.image.BufferedImage scale(java.io.InputStream input, int newSize) throws java.lang.Exception
input
- The source jpeg to usenewSize
- The new size of the image (will be used for both x and y)
java.lang.Exception
public static java.awt.image.BufferedImage scale(java.awt.Image image, int newSize) throws java.lang.Exception
image
- The image to use as sourcenewSize
- The new size of the image (will be used for both x and y)
java.lang.Exception
public static java.awt.Dimension calculateNewDimension(int width, int height, int newSize)
width
- The width of an object.height
- The height of an object.newSize
- The maximum size of an object (both width and height)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |