public class TiffSaver
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ByteArrayHandle |
bytes
Output bytes.
|
protected java.lang.String |
filename
Output filename.
|
protected RandomAccessOutputStream |
out
Output stream to use when saving TIFF data.
|
Constructor and Description |
---|
TiffSaver(RandomAccessOutputStream out,
ByteArrayHandle bytes)
Constructs a new TIFF saver from the given output source.
|
TiffSaver(RandomAccessOutputStream out,
java.lang.String filename)
Constructs a new TIFF saver from the given output source.
|
TiffSaver(java.lang.String filename)
Constructs a new TIFF saver from the given filename.
|
Modifier and Type | Method and Description |
---|---|
RandomAccessOutputStream |
getStream()
Gets the stream from which TIFF data is being saved.
|
boolean |
isBigTiff()
Returns whether or not we are writing BigTIFF data.
|
boolean |
isLittleEndian()
Returns whether or not we are writing little-endian data.
|
void |
overwriteComment(RandomAccessInputStream in,
java.lang.Object value)
Convenience method for overwriting a file's first ImageDescription.
|
void |
overwriteIFDValue(RandomAccessInputStream raf,
int ifd,
int tag,
java.lang.Object value)
Surgically overwrites an existing IFD value with the given one.
|
void |
overwriteLastIFDOffset(RandomAccessInputStream raf) |
void |
setBigTiff(boolean bigTiff)
Sets whether or not BigTIFF data should be written.
|
void |
setCodecOptions(CodecOptions options)
Sets the codec options.
|
void |
setLittleEndian(boolean littleEndian)
Sets whether or not little-endian data should be written.
|
void |
setWritingSequentially(boolean sequential)
Sets whether or not we know that the planes will be written sequentially.
|
void |
writeHeader()
Writes the TIFF file header.
|
void |
writeIFD(IFD ifd,
long nextOffset) |
void |
writeIFDValue(RandomAccessOutputStream extraOut,
long offset,
int tag,
java.lang.Object value)
Writes the given IFD value to the given output object.
|
void |
writeImage(byte[][] buf,
IFDList ifds,
int pixelType) |
void |
writeImage(byte[] buf,
IFD ifd,
int no,
int pixelType,
boolean last) |
void |
writeImage(byte[] buf,
IFD ifd,
int no,
int pixelType,
int x,
int y,
int w,
int h,
boolean last)
Writes to any rectangle from the passed block.
|
void |
writeImage(byte[] buf,
IFD ifd,
int no,
int pixelType,
int x,
int y,
int w,
int h,
boolean last,
java.lang.Integer nChannels,
boolean copyDirectly) |
protected RandomAccessOutputStream out
protected java.lang.String filename
protected ByteArrayHandle bytes
public TiffSaver(java.lang.String filename) throws java.io.IOException
filename
- Filename of the output stream that we may use to create
extra input or output streams as required.java.io.IOException
public TiffSaver(RandomAccessOutputStream out, java.lang.String filename)
out
- Output stream to save TIFF data to.filename
- Filename of the output stream that we may use to create
extra input or output streams as required.public TiffSaver(RandomAccessOutputStream out, ByteArrayHandle bytes)
out
- Output stream to save TIFF data to.bytes
- In memory byte array handle that we may use to create
extra input or output streams as required.public void setWritingSequentially(boolean sequential)
public RandomAccessOutputStream getStream()
public void setLittleEndian(boolean littleEndian)
public void setBigTiff(boolean bigTiff)
public boolean isLittleEndian()
public boolean isBigTiff()
public void setCodecOptions(CodecOptions options)
options
- The value to set.public void writeHeader() throws java.io.IOException
java.io.IOException
public void writeImage(byte[][] buf, IFDList ifds, int pixelType) throws FormatException, java.io.IOException
FormatException
java.io.IOException
public void writeImage(byte[] buf, IFD ifd, int no, int pixelType, boolean last) throws FormatException, java.io.IOException
FormatException
java.io.IOException
public void writeImage(byte[] buf, IFD ifd, int no, int pixelType, int x, int y, int w, int h, boolean last) throws FormatException, java.io.IOException
buf
- The block that is to be written.ifd
- The Image File Directories. Mustn't be null
.no
- The image index within the current file, starting from 0.pixelType
- The type of pixels.x
- The X-coordinate of the top-left corner.y
- The Y-coordinate of the top-left corner.w
- The width of the rectangle.h
- The height of the rectangle.last
- Pass true
if it is the last image,
false
otherwise.FormatException
java.io.IOException
public void writeImage(byte[] buf, IFD ifd, int no, int pixelType, int x, int y, int w, int h, boolean last, java.lang.Integer nChannels, boolean copyDirectly) throws FormatException, java.io.IOException
FormatException
java.io.IOException
public void writeIFD(IFD ifd, long nextOffset) throws FormatException, java.io.IOException
FormatException
java.io.IOException
public void writeIFDValue(RandomAccessOutputStream extraOut, long offset, int tag, java.lang.Object value) throws FormatException, java.io.IOException
extraOut
- buffer to which "extra" IFD information should be writtenoffset
- global offset to use for IFD offset valuestag
- IFD tag to writevalue
- IFD value to writeFormatException
java.io.IOException
public void overwriteLastIFDOffset(RandomAccessInputStream raf) throws FormatException, java.io.IOException
FormatException
java.io.IOException
public void overwriteIFDValue(RandomAccessInputStream raf, int ifd, int tag, java.lang.Object value) throws FormatException, java.io.IOException
FormatException
java.io.IOException
public void overwriteComment(RandomAccessInputStream in, java.lang.Object value) throws FormatException, java.io.IOException
FormatException
java.io.IOException
Copyright © 2014 Open Microscopy Environment