|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jj2000.j2k.image.output.ImgWriter
This is the generic interface to be implemented by all image file (or other resource) writers for different formats.
Each object inheriting from this class should have a source ImgData object associated with it. The image data to write to the file is obtained from the associated ImgData object. In general this object would be specified at construction time.
Depending on the actual type of file that is written a call to any write() or writeAll() method will write data from one component, several components or all components. For example, a PGM writer will write data from only one component (defined in the constructor) while a PPM writer will write 3 components (normally R,G,B).
Field Summary | |
static int |
DEF_STRIP_HEIGHT
The defaukt height used when writing strip by strip in the 'write()' method. |
protected int |
h
The height of the image |
protected BlkImgDataSrc |
src
The source ImagaData object, from where to get the image data |
protected int |
w
The width of the image |
Constructor Summary | |
ImgWriter()
|
Method Summary | |
abstract void |
close()
Closes the underlying file or netwrok connection to where the data is written. |
void |
finalize()
Flushes the buffered data before the object is garbage collected. |
abstract void |
flush()
Writes all buffered data to the file or resource. |
abstract void |
write()
Writes the source's current tile to the output. |
abstract void |
write(int ulx,
int uly,
int w,
int h)
Writes the data of the specified area to the file, coordinates are relative to the current tile of the source. |
void |
writeAll()
Writes the entire image or only specified tiles to the output. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEF_STRIP_HEIGHT
protected BlkImgDataSrc src
protected int w
protected int h
Constructor Detail |
public ImgWriter()
Method Detail |
public abstract void close() throws java.io.IOException
java.io.IOException
- If an I/O error occurs.public abstract void flush() throws java.io.IOException
java.io.IOException
- If an I/O error occurs.public void finalize() throws java.io.IOException
finalize
in class java.lang.Object
java.io.IOException
- If an I/O error occurs. It halts the
finalization of the object, but is otherwise ignored.Object.finalize()
public abstract void write() throws java.io.IOException
The implementing class should only write data that is not "progressive" (in other words that it is final), see DataBlk for details.
java.io.IOException
- If an I/O error occurs.DataBlk
public void writeAll() throws java.io.IOException
java.io.IOException
- If an I/O error occurs.DataBlk
public abstract void write(int ulx, int uly, int w, int h) throws java.io.IOException
The implementing class should only write data that is not "progressive" (in other words that is final), see DataBlk for details.
ulx
- The horizontal coordinate of the upper-left corner of the
area to write, relative to the current tile.uly
- The vertical coordinate of the upper-left corner of the area
to write, relative to the current tile.
java.io.IOException
- If an I/O error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |