|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.view.common.LyImageUtils
public class LyImageUtils
This class gives utility methods to handle images.
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
static java.awt.Frame |
_frame
Default Frame used in some parts of the code when a default AWT component is needed (for example to create an image). |
Constructor Summary | |
---|---|
LyImageUtils()
|
Method Summary | |
---|---|
static void |
clean()
Clean all statics used by this class. |
static boolean |
encodeImage(java.awt.Image image,
java.lang.String imageDir,
java.lang.String imageFile)
Encodes an image to JPEG format. |
static java.io.OutputStream |
encodeImageToStream(java.awt.Image image,
java.lang.String imageDir,
java.lang.String imageFile)
Encodes an image to JPEG format. |
static void |
freeImage(java.awt.Image image)
Free the resources of the image if not in the cache. |
static java.awt.Image |
getDefaultImage()
Constructs a default image. |
static java.lang.Object |
getScaledInstance(java.awt.Image image,
int width,
int height)
Creates a scaled version of the given image. |
static int[] |
getSizes(java.awt.Image image)
Gets images sizes. |
static boolean |
isSameImage(java.awt.Image image1,
java.awt.Image image2)
Compare two images pixel by pixel. |
static java.lang.Object |
loadImageFromStream(java.awt.Component component,
java.io.InputStream resource)
retreives an image from a Stream. |
static void |
waitForLoading(java.awt.Component component,
java.awt.Image image)
Waits for the image loaging. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
public static java.awt.Frame _frame
Constructor Detail |
---|
public LyImageUtils()
Method Detail |
---|
public static void clean()
public static boolean encodeImage(java.awt.Image image, java.lang.String imageDir, java.lang.String imageFile)
image
- the image to encodeimageDir
- temporary directoryimageFile
- the JPEG File
public static java.io.OutputStream encodeImageToStream(java.awt.Image image, java.lang.String imageDir, java.lang.String imageFile)
image
- the image to encodeimageDir
- temporary directoryimageFile
- the JPEG File
public static java.awt.Image getDefaultImage()
public static int[] getSizes(java.awt.Image image)
image
-
public static java.lang.Object getScaledInstance(java.awt.Image image, int width, int height)
image
- The image to scale.width
- The width to which to scale the image.height
- The height to which to scale the image.
public static void waitForLoading(java.awt.Component component, java.awt.Image image) throws java.lang.InterruptedException
component
- image
- Image to load.
java.lang.InterruptedException
public static java.lang.Object loadImageFromStream(java.awt.Component component, java.io.InputStream resource) throws java.io.IOException
component
- The client of the image creation.resource
- stream inputStream to the image data
java.io.IOException
- if something is wrong during loadingpublic static void freeImage(java.awt.Image image)
image
- The image that must be freed.public static boolean isSameImage(java.awt.Image image1, java.awt.Image image2) throws java.lang.InterruptedException
image1
- first image to compareimage2
- second image to compare
java.lang.InterruptedException
- exception if problems on grabber or loading.
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |