public class TiffWriter extends FormatWriter
Modifier and Type | Field and Description |
---|---|
protected boolean |
checkParams
Whether or not to check the parameters passed to saveBytes.
|
static java.lang.String |
COMPRESSION_J2K |
static java.lang.String |
COMPRESSION_J2K_LOSSY |
static java.lang.String |
COMPRESSION_JPEG |
static java.lang.String |
COMPRESSION_LZW |
static java.lang.String |
COMPRESSION_UNCOMPRESSED |
protected RandomAccessInputStream |
in
Input stream to use when overwriting data.
|
protected boolean |
isBigTiff
Whether or not the output file is a BigTIFF file.
|
protected TiffSaver |
tiffSaver
The TiffSaver that will do most of the writing.
|
cm, compression, compressionTypes, fps, initialized, interleaved, metadataRetrieve, options, out, sequential, series, validBits
COMPRESSION_SUFFIXES, currentId, format, LOGGER, suffixes
Constructor and Description |
---|
TiffWriter() |
TiffWriter(java.lang.String format,
java.lang.String[] exts) |
Modifier and Type | Method and Description |
---|---|
boolean |
canDoStacks()
Reports whether the writer can save multiple images to a single file.
|
void |
close() |
int[] |
getPixelTypes(java.lang.String codec)
Gets the supported pixel types for the given codec.
|
int |
getPlaneCount()
Retrieve the total number of planes in the current series.
|
protected int |
prepareToWriteImage(int no,
byte[] buf,
IFD ifd,
int x,
int y,
int w,
int h)
Performs the preparation for work prior to the usage of the TIFF saver.
|
void |
saveBytes(int no,
byte[] buf,
IFD ifd)
Saves the given image to the specified (possibly already open) file.
|
void |
saveBytes(int no,
byte[] buf,
IFD ifd,
int x,
int y,
int w,
int h)
Saves the given image to the specified series in the current file.
|
void |
saveBytes(int no,
byte[] buf,
int x,
int y,
int w,
int h)
Saves the given image tile to the current series in the current file.
|
void |
setBigTiff(boolean bigTiff)
Sets whether or not BigTIFF files should be written.
|
void |
setId(java.lang.String id)
Sets the current file name.
|
protected void |
setupTiffSaver() |
changeOutputFile, checkParams, getColorModel, getCompression, getCompressionTypes, getFramesPerSecond, getMetadataRetrieve, getPixelTypes, getSamplesPerPixel, getSeries, isFullPlane, isInterleaved, isSupportedType, saveBytes, saveBytes, savePlane, savePlane, savePlane, seekToPlaneOffset, setCodecOptions, setColorModel, setCompression, setFramesPerSecond, setInterleaved, setMetadataRetrieve, setSeries, setValidBitsPerPixel, setWriteSequentially
checkSuffix, checkSuffix, getFormat, getNativeDataType, getSuffixes, isThisType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFormat, getNativeDataType, getSuffixes, isThisType
public static final java.lang.String COMPRESSION_UNCOMPRESSED
public static final java.lang.String COMPRESSION_LZW
public static final java.lang.String COMPRESSION_J2K
public static final java.lang.String COMPRESSION_J2K_LOSSY
public static final java.lang.String COMPRESSION_JPEG
protected boolean isBigTiff
protected TiffSaver tiffSaver
protected RandomAccessInputStream in
protected boolean checkParams
public TiffWriter()
public TiffWriter(java.lang.String format, java.lang.String[] exts)
public void setId(java.lang.String id) throws FormatException, java.io.IOException
IFormatHandler
setId
in interface IFormatHandler
setId
in class FormatWriter
FormatException
java.io.IOException
public void saveBytes(int no, byte[] buf, IFD ifd) throws java.io.IOException, FormatException
java.io.IOException
FormatException
public void saveBytes(int no, byte[] buf, IFD ifd, int x, int y, int w, int h) throws java.io.IOException, FormatException
java.io.IOException
FormatException
protected int prepareToWriteImage(int no, byte[] buf, IFD ifd, int x, int y, int w, int h) throws java.io.IOException, FormatException
saveBytes()
in an attempt to
ensure thread safety.java.io.IOException
FormatException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class FormatWriter
java.io.IOException
public int getPlaneCount()
FormatWriter
getPlaneCount
in class FormatWriter
public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, java.io.IOException
IFormatWriter
no
- the image index within the current file, starting from 0.buf
- the byte array that represents the image tile.x
- the X coordinate of the upper-left corner of the image tile.y
- the Y coordinate of the upper-left corner of the image tile.w
- the width (in pixels) of the image tile.h
- the height (in pixels) of the image tile.FormatException
- if one of the parameters is invalid.java.io.IOException
- if there was a problem writing to the file.IFormatWriter.saveBytes(int, byte[], int, int, int, int)
public boolean canDoStacks()
IFormatWriter
canDoStacks
in interface IFormatWriter
canDoStacks
in class FormatWriter
public int[] getPixelTypes(java.lang.String codec)
IFormatWriter
getPixelTypes
in interface IFormatWriter
getPixelTypes
in class FormatWriter
public void setBigTiff(boolean bigTiff)
protected void setupTiffSaver() throws java.io.IOException
java.io.IOException
Copyright © 2014 Open Microscopy Environment