Package loci.formats.out
Class TiffWriter
java.lang.Object
loci.formats.FormatHandler
loci.formats.FormatWriter
loci.formats.out.TiffWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,loci.formats.ICompressedTileWriter,loci.formats.IFormatHandler,loci.formats.IFormatWriter,loci.formats.IMetadataConfigurable,loci.formats.IPyramidHandler
- Direct Known Subclasses:
OMETiffWriter
TiffWriter is the file format writer for TIFF files.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanWhether or not BigTIFF can be used automatically.protected booleanWhether or not to check the parameters passed to saveBytes.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected RandomAccessInputStreamInput stream to use when overwriting data.protected booleanWhether or not the output file is a BigTIFF file.protected TiffSaverThe TiffSaver that will do most of the writing.protected intThe tile width which will be used for writing.protected intThe tile height which will be used for writing.Fields inherited from class loci.formats.FormatWriter
cm, compression, compressionTypes, fps, initialized, interleaved, metadataRetrieve, options, out, resolution, resolutionData, sequential, series, validBitsFields inherited from class loci.formats.FormatHandler
COMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidclose()protected RandomAccessInputStreamprotected TiffSavergetCodec()int[]getPixelTypes(String codec) intintintprotected IFDmakeIFD()protected intprepareToWriteImage(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.voidsaveBytes(int no, byte[] buf, int x, int y, int w, int h) voidSaves the given image to the specified (possibly already open) file.voidSaves the given image to the specified series in the current file.voidsaveCompressedBytes(int no, byte[] buf, int x, int y, int w, int h) voidsetBigTiff(boolean bigTiff) Sets whether or not BigTIFF files should be written.voidsetCanDetectBigTiff(boolean detect) Sets whether or not BigTIFF can be used automatically based upon the input data size (true by default).voidintsetTileSizeX(int tileSize) intsetTileSizeY(int tileSize) protected voidMethods inherited from class loci.formats.FormatWriter
changeOutputFile, checkParams, createOutputStream, getCodecOptions, getColorModel, getCompression, getCompressionTypes, getFramesPerSecond, getMetadataRetrieve, getPixelTypes, getPlaneCount, getResolution, getResolutionCount, getResolutions, getSamplesPerPixel, getSamplesPerPixel, getSeries, getSizeX, getSizeY, hasResolutions, isFullPlane, isInterleaved, isSupportedType, saveBytes, saveBytes, savePlane, savePlane, savePlane, seekToPlaneOffset, setCodecOptions, setColorModel, setCompression, setFramesPerSecond, setInterleaved, setMetadataRetrieve, setResolution, setResolutions, setSeries, setValidBitsPerPixel, setWriteSequentiallyMethods inherited from class loci.formats.FormatHandler
checkSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, isThisType, setMetadataOptionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface loci.formats.IFormatHandler
getFormat, getNativeDataType, getSuffixes, isThisTypeMethods inherited from interface loci.formats.IMetadataConfigurable
getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
-
Field Details
-
COMPRESSION_UNCOMPRESSED
-
COMPRESSION_LZW
-
COMPRESSION_J2K
-
COMPRESSION_J2K_LOSSY
-
COMPRESSION_JPEG
-
COMPRESSION_ZLIB
-
isBigTiff
protected boolean isBigTiffWhether or not the output file is a BigTIFF file. -
canDetectBigTiff
protected boolean canDetectBigTiffWhether or not BigTIFF can be used automatically. -
tiffSaver
The TiffSaver that will do most of the writing. -
in
Input stream to use when overwriting data. -
checkParams
protected boolean checkParamsWhether or not to check the parameters passed to saveBytes. -
tileSizeX
protected int tileSizeXThe tile width which will be used for writing. -
tileSizeY
protected int tileSizeYThe tile height which will be used for writing.
-
-
Constructor Details
-
TiffWriter
public TiffWriter() -
TiffWriter
-
-
Method Details
-
getCodec
-
saveCompressedBytes
public void saveCompressedBytes(int no, byte[] buf, int x, int y, int w, int h) throws loci.formats.FormatException, IOException -
makeIFD
-
setId
- Specified by:
setIdin interfaceloci.formats.IFormatHandler- Overrides:
setIdin classloci.formats.FormatWriter- Throws:
loci.formats.FormatExceptionIOException
-
saveBytes
Saves the given image to the specified (possibly already open) file. The IFD hashtable allows specification of TIFF parameters such as bit depth, compression and units. Use one IFD instance per plane. -
saveBytes
public void saveBytes(int no, byte[] buf, IFD ifd, int x, int y, int w, int h) throws IOException, loci.formats.FormatException Saves the given image to the specified series in the current file. The IFD hashtable allows specification of TIFF parameters such as bit depth, compression and units. Use one IFD instance per plane. -
prepareToWriteImage
protected int prepareToWriteImage(int no, byte[] buf, IFD ifd, int x, int y, int w, int h) throws IOException, loci.formats.FormatException Performs the preparation for work prior to the usage of the TIFF saver. This method is factored out fromsaveBytes()in an attempt to ensure thread safety. -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classloci.formats.FormatWriter- Throws:
IOException
-
getPlaneCount
public int getPlaneCount()- Overrides:
getPlaneCountin classloci.formats.FormatWriter
-
saveBytes
public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws loci.formats.FormatException, IOException - Throws:
loci.formats.FormatExceptionIOException- See Also:
-
canDoStacks
public boolean canDoStacks()- Specified by:
canDoStacksin interfaceloci.formats.IFormatWriter- Overrides:
canDoStacksin classloci.formats.FormatWriter
-
getPixelTypes
- Specified by:
getPixelTypesin interfaceloci.formats.IFormatWriter- Overrides:
getPixelTypesin classloci.formats.FormatWriter
-
setBigTiff
public void setBigTiff(boolean bigTiff) Sets whether or not BigTIFF files should be written. This flag is not reset when close() is called. -
setCanDetectBigTiff
public void setCanDetectBigTiff(boolean detect) Sets whether or not BigTIFF can be used automatically based upon the input data size (true by default). This flag is not reset when close() is called. -
setupTiffSaver
- Throws:
IOException
-
getTileSizeX
- Specified by:
getTileSizeXin interfaceloci.formats.IFormatWriter- Overrides:
getTileSizeXin classloci.formats.FormatWriter- Throws:
loci.formats.FormatException
-
setTileSizeX
- Specified by:
setTileSizeXin interfaceloci.formats.IFormatWriter- Overrides:
setTileSizeXin classloci.formats.FormatWriter- Throws:
loci.formats.FormatException
-
getTileSizeY
- Specified by:
getTileSizeYin interfaceloci.formats.IFormatWriter- Overrides:
getTileSizeYin classloci.formats.FormatWriter- Throws:
loci.formats.FormatException
-
setTileSizeY
- Specified by:
setTileSizeYin interfaceloci.formats.IFormatWriter- Overrides:
setTileSizeYin classloci.formats.FormatWriter- Throws:
loci.formats.FormatException
-
createInputStream
- Throws:
IOException
-
createTiffSaver
-