net.aerith.misao.image.io
Class Ppm
java.lang.Object
|
+--net.aerith.misao.image.io.Format
|
+--net.aerith.misao.image.io.Ppm
- public class Ppm
- extends Format
- implements Bitmap
The Ppm
is a class to read and save ppm file. It is
just an access interface to ppm file.
Fields inherited from class net.aerith.misao.image.io.Format |
url |
Constructor Summary |
Ppm(java.net.URL url)
Constructs an Ppm with URL. |
Method Summary |
java.lang.String |
getName()
Gets the name of the image format. |
MonoImage |
read()
Reads image file and creates image buffer. |
void |
save(MonoImage image)
Saves image buffer into an image file. |
void |
save(MonoImage image,
LevelAdjustmentSet set)
Saves an image buffer into an image file, using the specified
LevelAdjustmentSet . |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
Ppm
public Ppm(java.net.URL url)
- Constructs an
Ppm
with URL.
- Parameters:
url
- the URL of the ppm file.
getName
public java.lang.String getName()
- Gets the name of the image format.
- Overrides:
- getName in class Format
- Returns:
- the name of the image format.
read
public MonoImage read()
throws java.io.IOException,
UnsupportedBufferTypeException,
UnsupportedFileTypeException
- Reads image file and creates image buffer. The url of the image
file must be set previously.
- Overrides:
- read in class Format
- Returns:
- the monochrome image buffer.
- Throws:
- java.io.IOException - if I/O error occurs.
- UnsupportedBufferTypeException - if the data type is
unsupported.
- UnsupportedFileTypeException - if the file type is
unsupported.
save
public void save(MonoImage image)
throws java.io.IOException,
UnsupportedBufferTypeException,
UnsupportedFileTypeException
- Saves image buffer into an image file. The url of the image file
must be set previously.
- Overrides:
- save in class Format
- Parameters:
image
- the monochrome image buffer to save.- Throws:
- java.io.IOException - if I/O error occurs.
- UnsupportedBufferTypeException - if the data type is
unsupported.
- UnsupportedFileTypeException - if the file type is
unsupported.
save
public void save(MonoImage image,
LevelAdjustmentSet set)
throws java.io.IOException,
UnsupportedFileTypeException
- Saves an image buffer into an image file, using the specified
LevelAdjustmentSet
. The url of the image file
must be set previously.
- Specified by:
- save in interface Bitmap
- Parameters:
image
- the monochrome image buffer to save.- Throws:
- java.io.IOException - if I/O error occurs.
- UnsupportedFileTypeException - if the file type is
unsupported.