DESY ACOP Beans Home

de.desy.acop.video.displayer
Class ImageParser

java.lang.Object
  extended by de.desy.acop.video.displayer.ImageParser

public class ImageParser
extends java.lang.Object


Method Summary
static ImageParser instance()
           
static boolean loadImageFile(java.lang.String aFileName, de.desy.tine.types.IMAGE aOutImage)
          Deprecated. use loadImageFile(URL, IMAGE, boolean) instead
static boolean loadImageFile(java.lang.String aFileName, de.desy.tine.types.IMAGE aOutImage, boolean aChangeToGrey)
          Deprecated. use loadImageFile(URL, IMAGE, boolean) instead
static boolean loadImageFile(java.net.URL url, de.desy.tine.types.IMAGE outImage, boolean toGrey)
          Loads an image file with a give filename from disk and puts its contents to TINE IMAGE data type
static boolean loadIMM(java.lang.String aFileName, de.desy.tine.types.IMAGE aOutImage)
          loads an IMM (proprietary, VSV2, raw, greyscale) image file with a give filename from disk and puts its contents to TINE IMAGE data type.
static void printLoadableFormats()
          prints all formats that Java ImageIO class is able to read to stdout.
static void refresh()
           
static boolean write(java.io.File aFile, java.awt.Image aImg, de.desy.tine.types.IMAGE timage)
          saves the java.awt.Image passed to a newly created (overwritten) PNG file.
static boolean write(java.lang.String aFileName, java.awt.Image aImg, de.desy.tine.types.IMAGE timage)
          convenience overload, accepts filename as String instead of File class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static ImageParser instance()

refresh

public static void refresh()

loadImageFile

public static final boolean loadImageFile(java.lang.String aFileName,
                                          de.desy.tine.types.IMAGE aOutImage)
Deprecated. use loadImageFile(URL, IMAGE, boolean) instead

convenience overload, defaults grayscale conversion to false

See Also:
loadImageFile( String, IMAGE, boolean )

loadImageFile

public static final boolean loadImageFile(java.lang.String aFileName,
                                          de.desy.tine.types.IMAGE aOutImage,
                                          boolean aChangeToGrey)
Deprecated. use loadImageFile(URL, IMAGE, boolean) instead

loads an image file with a give filename from disk and puts its contents to TINE IMAGE data type

Parameters:
aFileName - file name (may include path)
aOutImage - TINE IMAGE data type to put image contents to
aChangeToGrey - if true, image data is down scaled to grayscale before returned
Returns:
true - image contents were successfully put into aOutImage
false - some error (aOutImage is null, IOException, URISyntaxException, error img.getRGB)

loadImageFile

public static final boolean loadImageFile(java.net.URL url,
                                          de.desy.tine.types.IMAGE outImage,
                                          boolean toGrey)
Loads an image file with a give filename from disk and puts its contents to TINE IMAGE data type

Parameters:
url - input a URL to read from.
outImage - TINE IMAGE data type to put image contents to
toGrey - if true, image data is down scaled to grayscale before returned
Returns:
true - image contents were successfully put into aOutImage
false - some error (aOutImage is null, IOException, URISyntaxException, error img.getRGB)

loadIMM

public static final boolean loadIMM(java.lang.String aFileName,
                                    de.desy.tine.types.IMAGE aOutImage)
loads an IMM (proprietary, VSV2, raw, greyscale) image file with a give filename from disk and puts its contents to TINE IMAGE data type. An IMM file can consist of multiple video frames glued together. In such case, only the first one is loaded!

Parameters:
aFileName - file name (may include path)
aOutImage - TINE IMAGE data type to put image contents to
Returns:
true - image contents were successfully put into aOutImage
false - some error (aOutImage is null, IOException)

printLoadableFormats

public static void printLoadableFormats()
prints all formats that Java ImageIO class is able to read to stdout. This helps when getting to know which file formats are supported.


write

public static boolean write(java.lang.String aFileName,
                            java.awt.Image aImg,
                            de.desy.tine.types.IMAGE timage)
convenience overload, accepts filename as String instead of File class

See Also:
write( File, Image, VideoHeaderV3)

write

public static boolean write(java.io.File aFile,
                            java.awt.Image aImg,
                            de.desy.tine.types.IMAGE timage)
saves the java.awt.Image passed to a newly created (overwritten) PNG file. Additional metadata describing the Image is taken from a special header and put into an additional textfile placed beside the PNG file.

Parameters:
aFile - java.io.File where to store the png image
aImg - Image data to be written to PNG
aHdr - contains meta properties of Image that will be written to .txt file
Returns:
true - image contents and text file were successfully saved
false - some error (IOException on png or txt)


Copyright © 2010. All Rights Reserved.