public class TiffWriter extends FormatWriter
| Modifier and Type | Field and Description |
|---|---|
private static long |
BIG_TIFF_CUTOFF
Number of bytes at which to automatically switch to BigTIFF
This is approximately 3.9 GB instead of 4 GB,
to allow space for the IFDs.
|
private static String[] |
BIG_TIFF_SUFFIXES |
protected boolean |
checkParams
Whether or not to check the parameters passed to saveBytes.
|
static String |
COMPRESSION_J2K |
static String |
COMPRESSION_J2K_LOSSY |
static String |
COMPRESSION_JPEG |
static String |
COMPRESSION_LZW |
static 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, validBitsCOMPRESSION_SUFFIXES, currentId, format, LOGGER, suffixes| Constructor and Description |
|---|
TiffWriter() |
TiffWriter(String format,
String[] exts) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canDoStacks()
Reports whether the writer can save multiple images to a single file.
|
void |
close() |
private void |
formatCompression(IFD ifd)
Sets the compression code for the specified IFD.
|
int[] |
getPixelTypes(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 |
getPlaneCount(int series)
Retrieve the total number of planes in given 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(String id)
Initializes a writer from the input file name.
|
protected void |
setupTiffSaver() |
changeOutputFile, checkParams, getColorModel, getCompression, getCompressionTypes, getFramesPerSecond, getMetadataRetrieve, getPixelTypes, getSamplesPerPixel, getSamplesPerPixel, getSeries, isFullPlane, isInterleaved, isSupportedType, saveBytes, saveBytes, savePlane, savePlane, savePlane, seekToPlaneOffset, setCodecOptions, setColorModel, setCompression, setFramesPerSecond, setInterleaved, setMetadataRetrieve, setSeries, setValidBitsPerPixel, setWriteSequentiallycheckSuffix, checkSuffix, getFormat, getNativeDataType, getSuffixes, isThisTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFormat, getNativeDataType, getSuffixes, isThisTypepublic static final String COMPRESSION_UNCOMPRESSED
public static final String COMPRESSION_LZW
public static final String COMPRESSION_J2K
public static final String COMPRESSION_J2K_LOSSY
public static final String COMPRESSION_JPEG
private static final String[] BIG_TIFF_SUFFIXES
private static final long BIG_TIFF_CUTOFF
protected boolean isBigTiff
protected TiffSaver tiffSaver
protected RandomAccessInputStream in
protected boolean checkParams
private void formatCompression(IFD ifd) throws FormatException
ifd - The IFD table to handle.FormatExceptionpublic void setId(String id) throws FormatException, IOException
FormatWriterRandomAccessOutputStream for the output
file and initializes the metadata for all the series using
FormatWriter.setSeries(int).setId in interface IFormatHandlersetId in class FormatWriterid - a String specifying the path to the fileFormatExceptionIOExceptionpublic void saveBytes(int no,
byte[] buf,
IFD ifd)
throws IOException,
FormatException
IOExceptionFormatExceptionpublic void saveBytes(int no,
byte[] buf,
IFD ifd,
int x,
int y,
int w,
int h)
throws IOException,
FormatException
IOExceptionFormatExceptionprotected int prepareToWriteImage(int no,
byte[] buf,
IFD ifd,
int x,
int y,
int w,
int h)
throws IOException,
FormatException
saveBytes() in an attempt to
ensure thread safety.IOExceptionFormatExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FormatWriterIOExceptionpublic int getPlaneCount()
FormatWritergetPlaneCount in class FormatWriterprotected int getPlaneCount(int series)
FormatWritergetPlaneCount in class FormatWriterpublic void saveBytes(int no,
byte[] buf,
int x,
int y,
int w,
int h)
throws FormatException,
IOException
IFormatWriterno - 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.IOException - if there was a problem writing to the file.IFormatWriter.saveBytes(int, byte[], int, int, int, int)public boolean canDoStacks()
IFormatWritercanDoStacks in interface IFormatWritercanDoStacks in class FormatWriterpublic int[] getPixelTypes(String codec)
IFormatWritergetPixelTypes in interface IFormatWritergetPixelTypes in class FormatWriterpublic void setBigTiff(boolean bigTiff)
protected void setupTiffSaver()
throws IOException
IOExceptionCopyright © 2016 Open Microscopy Environment