Package org.sunflow.image.writers
Class EXRBitmapWriter
java.lang.Object
org.sunflow.image.writers.EXRBitmapWriter
- All Implemented Interfaces:
BitmapWriter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClose the file, this completes the bitmap writing process.voidThis method will be called before writing begins.voidOpen a handle to the specified file for writing.voidwriteHeader(int width, int height, int tileSize) Write the bitmap header.voidWrite a tile of data.
-
Constructor Details
-
EXRBitmapWriter
public EXRBitmapWriter()
-
-
Method Details
-
configure
Description copied from interface:BitmapWriterThis method will be called before writing begins. It is used to set common attributes to file writers. Currently supported keywords include:- "compression"
- "channeltype": "byte", "short", "half", "float"
- Specified by:
configurein interfaceBitmapWriter- Parameters:
option-value-
-
openFile
Description copied from interface:BitmapWriterOpen a handle to the specified file for writing. If the writer buffers the image and writes it on close, then the filename should be stored.- Specified by:
openFilein interfaceBitmapWriter- Parameters:
filename- filename to write the bitmap to- Throws:
IOException- thrown if an I/O error occurs
-
writeHeader
public void writeHeader(int width, int height, int tileSize) throws IOException, UnsupportedOperationException Description copied from interface:BitmapWriterWrite the bitmap header. This may be defered if the image is buffered for writing all at once on close. Note that if tile size is positive, data sent to this class is guarenteed to arrive in tiles of that size (except at borders). Otherwise, it should be assumed that the data is random, and that it may overlap. The writer should then either throw an error or start buffering data manually.- Specified by:
writeHeaderin interfaceBitmapWriter- Parameters:
width- image widthheight- image heighttileSize- tile size or 0 if the image will not be sent in tiled form- Throws:
IOException- thrown if an I/O error occursUnsupportedOperationException- thrown if this writer does not support writing the image with the supplied tile size
-
writeTile
Description copied from interface:BitmapWriterWrite a tile of data. Note that this method may be called by more than one thread, so it should be made thread-safe if possible.- Specified by:
writeTilein interfaceBitmapWriter- Parameters:
x- tile x coordinatey- tile y coordinatew- tile widthh- tile heightcolor- color dataalpha- alpha data- Throws:
IOException- thrown if an I/O error occurs
-
closeFile
Description copied from interface:BitmapWriterClose the file, this completes the bitmap writing process.- Specified by:
closeFilein interfaceBitmapWriter- Throws:
IOException- thrown if an I/O error occurs
-