public class APNGWriter extends FormatWriter
Modifier and Type | Field and Description |
---|---|
private long |
footerPointer |
private boolean |
littleEndian |
private int |
nextSequenceNumber |
private int |
numFrames |
private long |
numFramesPointer |
private static byte[] |
PNG_SIG |
cm, compression, compressionTypes, fps, initialized, interleaved, metadataRetrieve, options, out, resolution, resolutionData, sequential, series, validBits
COMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixes
Constructor and Description |
---|
APNGWriter() |
Modifier and Type | Method and Description |
---|---|
boolean |
canDoStacks()
Reports whether the writer can save multiple images to a single file.
|
void |
close() |
private int |
crc(byte[] buf) |
private int |
crc(byte[] buf,
int off,
int len) |
int[] |
getPixelTypes(java.lang.String codec)
Gets the supported pixel types for the given codec.
|
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 |
setId(java.lang.String id)
Initializes a writer from the input file name.
|
private void |
writeFCTL(int width,
int height) |
private void |
writeFooter() |
private void |
writePixels(java.lang.String chunk,
byte[] stream,
int x,
int y,
int width,
int height) |
private void |
writePLTE() |
changeOutputFile, checkParams, createOutputStream, 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, savePlane, seekToPlaneOffset, setCodecOptions, setColorModel, setCompression, setFramesPerSecond, setInterleaved, setMetadataRetrieve, setResolution, setResolutions, setSeries, setTileSizeX, setTileSizeY, setValidBitsPerPixel, setWriteSequentially
checkSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, isThisType, setMetadataOptions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFormat, getNativeDataType, getSuffixes, isThisType
getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
private static final byte[] PNG_SIG
private int numFrames
private long numFramesPointer
private int nextSequenceNumber
private boolean littleEndian
private long footerPointer
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 setId(java.lang.String id) throws FormatException, java.io.IOException
FormatWriter
RandomAccessOutputStream
for the output
file and initializes the metadata for all the series using
FormatWriter.setSeries(int)
.setId
in interface IFormatHandler
setId
in class FormatWriter
id
- a String
specifying the path to the fileFormatException
java.io.IOException
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
private int crc(byte[] buf)
private int crc(byte[] buf, int off, int len)
private void writeFCTL(int width, int height) throws java.io.IOException
java.io.IOException
private void writePLTE() throws java.io.IOException
java.io.IOException
private void writePixels(java.lang.String chunk, byte[] stream, int x, int y, int width, int height) throws FormatException, java.io.IOException
FormatException
java.io.IOException
private void writeFooter() throws java.io.IOException
java.io.IOException
Copyright © 2019 Open Microscopy Environment