org.gerhardb.lib.image
Class IOImage
java.lang.Object
org.gerhardb.lib.image.IOImage
public abstract class IOImage
- extends java.lang.Object
This is used to read images and write them back out to a file.
This wraps the stream thereby keeping the Metadata.
|
Constructor Summary |
IOImage(java.io.File file)
|
|
Method Summary |
java.io.File |
getFile()
|
abstract java.awt.image.BufferedImage |
getImage()
Gets a buffered image. |
abstract java.lang.String |
getImageFactoryName()
|
abstract boolean |
isSaveInNataveFormatPossible()
|
static void |
main(java.lang.String[] args)
|
void |
save(java.awt.image.BufferedImage image)
|
abstract void |
save(java.awt.image.BufferedImage image,
java.io.File saveAsFile)
|
void |
save(java.awt.image.BufferedImage image,
java.lang.String saveAsName)
|
void |
saveJPEG(java.awt.image.BufferedImage image,
float quality)
|
void |
saveJPEG(java.awt.image.BufferedImage image,
float quality,
java.lang.String saveAsName)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IOImage
public IOImage(java.io.File file)
throws java.lang.Exception
- Throws:
java.lang.Exception
getImage
public abstract java.awt.image.BufferedImage getImage()
- Gets a buffered image.
Note that the file lock will not go away until the BufferedImage goes
away.
- Returns:
- null if no image was found.
- Throws:
java.io.IOException
save
public abstract void save(java.awt.image.BufferedImage image,
java.io.File saveAsFile)
throws java.lang.Exception
- Throws:
java.lang.Exception
getImageFactoryName
public abstract java.lang.String getImageFactoryName()
isSaveInNataveFormatPossible
public abstract boolean isSaveInNataveFormatPossible()
getFile
public java.io.File getFile()
saveJPEG
public void saveJPEG(java.awt.image.BufferedImage image,
float quality)
throws java.io.IOException
- Throws:
java.io.IOException
saveJPEG
public void saveJPEG(java.awt.image.BufferedImage image,
float quality,
java.lang.String saveAsName)
throws java.io.IOException
- Throws:
java.io.IOException
save
public void save(java.awt.image.BufferedImage image)
throws java.lang.Exception
- Throws:
java.lang.Exception
save
public void save(java.awt.image.BufferedImage image,
java.lang.String saveAsName)
throws java.lang.Exception
- Throws:
java.lang.Exception
main
public static void main(java.lang.String[] args)
Copyright ? 2007 Gerhard Beck. All rights reserved. Subject to GPL.