|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.lentikit.Utils
Field Summary | |
static boolean |
PRESERVE_ASPECT_RATIO
|
Constructor Summary | |
Utils()
|
Method Summary | |
static java.awt.image.BufferedImage |
createBufferedImage(int x,
int y,
int typeHint)
returns a BufferedImage of the desired size,
it may use the typeHint but is not guaranteed to do so. |
static double |
inchesToMeters(double inches)
Simple method to convert incehs to Meters |
static java.awt.image.BufferedImage |
readImage(java.io.File f)
Returns a bufferedImage made from the file, can return null! |
static void |
saveImageAsPNG(java.awt.image.BufferedImage image,
java.io.File saveTo)
Saves the image in PNG format to the specified file |
static void |
saveImageAsPNG(java.awt.image.BufferedImage image,
java.lang.String filename)
Saves the image in PNG format to the specified file |
static java.awt.image.BufferedImage |
scaleImage(java.awt.image.BufferedImage im,
java.awt.Dimension destImageSize,
boolean preserveAspectRatio)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean PRESERVE_ASPECT_RATIO
Constructor Detail |
public Utils()
Method Detail |
public static final java.awt.image.BufferedImage readImage(java.io.File f) throws java.io.IOException
java.io.IOException
public static java.awt.image.BufferedImage scaleImage(java.awt.image.BufferedImage im, java.awt.Dimension destImageSize, boolean preserveAspectRatio)
public static java.awt.image.BufferedImage createBufferedImage(int x, int y, int typeHint)
BufferedImage
of the desired size,
it may use the typeHint but is not guaranteed to do so.
This utility method is provided for lentikit as a central place
for trying out different types of BufferedImage to evaluate performance and
memory usage. In addition it checks for OutOfMemoryError and displays a JOptionPane
dialog, since buffered images are far and away the most greedy users of memory creating a
BufferedImage is the most likely time to run out of memory.
public static double inchesToMeters(double inches)
public static void saveImageAsPNG(java.awt.image.BufferedImage image, java.lang.String filename)
public static void saveImageAsPNG(java.awt.image.BufferedImage image, java.io.File saveTo)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |