DESY ACOP Beans Home

de.desy.video.sw
Class CBasicImageLoaderV3

java.lang.Object
  extended by de.desy.video.sw.CBasicImageLoaderV3

public final class CBasicImageLoaderV3
extends java.lang.Object

CBasicImageLoaderV3 provides loading of any Java SE supported bitmap image file format to Video System v3 TINE IMAGE format type. While loading, conversion to grayscale image data can be done if desired. Main interest for current usage is PNG file loading from disk.

The loadable formats are (according to tests using printLoadableFormats()):

Please note that upper- and lowercase file extensions are outlined, which I think could mean that case sensitivity of file extention plays a role and (possibly, unchecked) .PnG file extension is rejected.

Version:
$Id: Templates.xml,v 1.10 2008/06/20 16:00:13 sweisse Exp $
Author:
Stefan Weisse

Constructor Summary
CBasicImageLoaderV3()
           
 
Method Summary
static boolean loadImageFile(java.lang.String aFileName, IMAGE aOutImage)
          convenience overload, defaults grayscale conversion to false
static boolean loadImageFile(java.lang.String aFileName, IMAGE aOutImage, boolean aChangeToGrey)
          loads an image file with a give filename from disk and puts its contents to TINE IMAGE data type
static boolean loadImageResource(java.lang.String aFileName, IMAGE aOutImage, boolean aChangeToGrey)
          loads an image file with a give filename out of a resource bundle (e.g.
static void printLoadableFormats()
          prints all formats that Java ImageIO class is able to read to stdout.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CBasicImageLoaderV3

public CBasicImageLoaderV3()
Method Detail

printLoadableFormats

public static final 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.


loadImageResource

public static final boolean loadImageResource(java.lang.String aFileName,
                                              IMAGE aOutImage,
                                              boolean aChangeToGrey)
loads an image file with a give filename out of a resource bundle (e.g. JAR file) and puts its contents to TINE IMAGE data type

This method is untested!

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

loadImageFile

public static final boolean loadImageFile(java.lang.String aFileName,
                                          IMAGE aOutImage)
convenience overload, defaults grayscale conversion to false

See Also:
loadImageFile( String, IMAGE, boolean )

loadImageFile

public static final boolean loadImageFile(java.lang.String aFileName,
                                          IMAGE aOutImage,
                                          boolean aChangeToGrey)
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 downscaled to grayscale before returned
Returns:
true - image contents were successfully put into aOutImage
false - some error (aOutImage is null, IOException, URISyntaxException, error img.getRGB)


Copyright © 2009. All Rights Reserved.