Package loci.formats.out
Class ImageIOWriter
java.lang.Object
loci.formats.FormatHandler
loci.formats.FormatWriter
loci.formats.out.ImageIOWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileWriter,IFormatHandler,IFormatWriter,IMetadataConfigurable,IPyramidHandler
- Direct Known Subclasses:
JPEGWriter
ImageIOWriter is the superclass for file format writers that use the
javax.imageio library.
- Author:
- Curtis Rueden ctrueden at wisc.edu
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionImageIOWriter(String format, String[] suffixes, String kind) Constructs an ImageIO-based writer with the given name, default suffixes and output type (e.g., png, jpeg).ImageIOWriter(String format, String suffix, String kind) Constructs an ImageIO-based writer with the given name, default suffix and output type (e.g., png, jpeg). -
Method Summary
Modifier and TypeMethodDescriptionClass<?> Returns the native data type of image planes for this reader, as returned byIFormatReader.openPlane(int, int, int, int, int)orIFormatWriter.savePlane(int, java.lang.Object).int[]getPixelTypes(String codec) Gets the supported pixel types for the given codec.voidsaveBytes(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.voidSaves the given image plane to the current series in the current file.Methods inherited from class loci.formats.FormatWriter
canDoStacks, changeOutputFile, checkParams, close, createOutputStream, getCodecOptions, getColorModel, getCompression, getCompressionTypes, getFramesPerSecond, getMetadataRetrieve, getPixelTypes, getPlaneCount, getPlaneCount, getResolution, getResolutionCount, getResolutions, getSamplesPerPixel, getSamplesPerPixel, getSeries, getSizeX, getSizeY, getTileSizeX, getTileSizeY, hasResolutions, isFullPlane, isInterleaved, isSupportedType, saveBytes, saveBytes, savePlane, savePlane, seekToPlaneOffset, setCodecOptions, setColorModel, setCompression, setFramesPerSecond, setId, setInterleaved, setMetadataRetrieve, setResolution, setResolutions, setSeries, setTileSizeX, setTileSizeY, setValidBitsPerPixel, setWriteSequentiallyMethods inherited from class loci.formats.FormatHandler
checkSuffix, checkSuffix, getFormat, getMetadataOptions, 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.ICompressedTileWriter
getCodec, saveCompressedBytesMethods inherited from interface loci.formats.IFormatHandler
getFormat, getSuffixes, isThisTypeMethods inherited from interface loci.formats.IMetadataConfigurable
getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
-
Field Details
-
kind
-
-
Constructor Details
-
ImageIOWriter
Constructs an ImageIO-based writer with the given name, default suffix and output type (e.g., png, jpeg). -
ImageIOWriter
Constructs an ImageIO-based writer with the given name, default suffixes and output type (e.g., png, jpeg).
-
-
Method Details
-
saveBytes
public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException Description copied from interface:IFormatWriterSaves the given image tile to the current series in the current file.- Parameters:
no- the plane index within the series.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.- Throws:
FormatException- if one of the parameters is invalid.IOException- if there was a problem writing to the file.- See Also:
-
savePlane
public void savePlane(int no, Object plane, int x, int y, int w, int h) throws FormatException, IOException Description copied from interface:IFormatWriterSaves the given image plane to the current series in the current file.- Specified by:
savePlanein interfaceIFormatWriter- Overrides:
savePlanein classFormatWriter- Parameters:
no- the plane index within the series.plane- the image plane.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.- Throws:
FormatException- if one of the parameters is invalid.IOException- if there was a problem writing to the file.- See Also:
-
getPixelTypes
Description copied from interface:IFormatWriterGets the supported pixel types for the given codec.- Specified by:
getPixelTypesin interfaceIFormatWriter- Overrides:
getPixelTypesin classFormatWriter
-
getNativeDataType
Description copied from interface:IFormatHandlerReturns the native data type of image planes for this reader, as returned byIFormatReader.openPlane(int, int, int, int, int)orIFormatWriter.savePlane(int, java.lang.Object). For most readers this type will be a byte array; however, some readers call external APIs that work with other types such asBufferedImage.- Specified by:
getNativeDataTypein interfaceIFormatHandler- Overrides:
getNativeDataTypein classFormatHandler
-