Package loci.formats.out
Class QTWriter
java.lang.Object
loci.formats.FormatHandler
loci.formats.FormatWriter
loci.formats.out.QTWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,ICompressedTileWriter,IFormatHandler,IFormatWriter,IMetadataConfigurable,IPyramidHandler
QTWriter is the file format writer for uncompressed QuickTime movie files.
- Author:
- Melissa Linkert melissa at glencoesoftware.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longSeek to this offset to update the total number of pixel bytes.protected intThe codec to use.static final intValue indicating Animation codec.static final intValue indicating Cinepak codec.static final intValue indicating H.263 codec.static final intValue indicating Motion JPEG-B codec.static final intValue indicating MPEG-4 codec.static final intValue indicating Raw codec.static final intValue indicating Sorenson codec.static final intValue indicating Sorenson 3 codec.protected intTime the file was created.protected intTotal number of pixel bytes.private intVector of plane offsets.protected intNumber of padding bytes in each row.protected intThe quality to use.static final intValue indicating High quality.static final intValue indicating Low quality.static final intValue indicating Maximum quality.static final intValue indicating Normal quality.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 TypeMethodDescriptionbooleanReports whether the writer can save multiple images to a single file.voidclose()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.private voidsetCodec()voidsetCodec(int codec) Sets the encoded movie's codec.voidInitializes a writer from the input file name.voidsetQuality(int quality) Sets the quality of the encoded movie.private voidWrite the atom length and type.private voidprivate voidWrite the 3x3 matrix that describes how to rotate the image.Methods inherited from class loci.formats.FormatWriter
changeOutputFile, checkParams, 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, savePlane, seekToPlaneOffset, setCodecOptions, setColorModel, setCompression, setFramesPerSecond, setInterleaved, setMetadataRetrieve, setResolution, setResolutions, setSeries, setTileSizeX, setTileSizeY, 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.ICompressedTileWriter
getCodec, saveCompressedBytesMethods inherited from interface loci.formats.IFormatHandler
getFormat, getNativeDataType, getSuffixes, isThisTypeMethods inherited from interface loci.formats.IMetadataConfigurable
getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
-
Field Details
-
CODEC_MOTION_JPEG_B
public static final int CODEC_MOTION_JPEG_BValue indicating Motion JPEG-B codec.- See Also:
-
CODEC_CINEPAK
public static final int CODEC_CINEPAKValue indicating Cinepak codec.- See Also:
-
CODEC_ANIMATION
public static final int CODEC_ANIMATIONValue indicating Animation codec.- See Also:
-
CODEC_H_263
public static final int CODEC_H_263Value indicating H.263 codec.- See Also:
-
CODEC_SORENSON
public static final int CODEC_SORENSONValue indicating Sorenson codec.- See Also:
-
CODEC_SORENSON_3
public static final int CODEC_SORENSON_3Value indicating Sorenson 3 codec.- See Also:
-
CODEC_MPEG_4
public static final int CODEC_MPEG_4Value indicating MPEG-4 codec.- See Also:
-
CODEC_RAW
public static final int CODEC_RAWValue indicating Raw codec.- See Also:
-
QUALITY_LOW
public static final int QUALITY_LOWValue indicating Low quality.- See Also:
-
QUALITY_NORMAL
public static final int QUALITY_NORMALValue indicating Normal quality.- See Also:
-
QUALITY_HIGH
public static final int QUALITY_HIGHValue indicating High quality.- See Also:
-
QUALITY_MAXIMUM
public static final int QUALITY_MAXIMUMValue indicating Maximum quality.- See Also:
-
BYTE_COUNT_OFFSET
private static final long BYTE_COUNT_OFFSETSeek to this offset to update the total number of pixel bytes.- See Also:
-
codec
protected int codecThe codec to use. -
quality
protected int qualityThe quality to use. -
numBytes
protected int numBytesTotal number of pixel bytes. -
offsets
Vector of plane offsets. -
created
protected int createdTime the file was created. -
pad
protected int padNumber of padding bytes in each row. -
numWritten
private int numWritten
-
-
Constructor Details
-
QTWriter
public QTWriter()
-
-
Method Details
-
setCodec
public void setCodec(int codec) Sets the encoded movie's codec.- Parameters:
codec- Codec value:- QTWriterCODEC_CINEPAK
- QTWriter.CODEC_ANIMATION
- QTWriter.CODEC_H_263
- QTWriter.CODEC_SORENSON
- QTWriter.CODEC_SORENSON_3
- QTWriter.CODEC_MPEG_4
- QTWriter.CODEC_RAW
-
setQuality
public void setQuality(int quality) Sets the quality of the encoded movie.- Parameters:
quality- Quality value:- QTWriter.QUALITY_LOW
- QTWriter.QUALITY_MEDIUM
- QTWriter.QUALITY_HIGH
- QTWriter.QUALITY_MAXIMUM
-
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:
-
canDoStacks
public boolean canDoStacks()Description copied from interface:IFormatWriterReports whether the writer can save multiple images to a single file.- Specified by:
canDoStacksin interfaceIFormatWriter- Overrides:
canDoStacksin classFormatWriter
-
getPixelTypes
Description copied from interface:IFormatWriterGets the supported pixel types for the given codec.- Specified by:
getPixelTypesin interfaceIFormatWriter- Overrides:
getPixelTypesin classFormatWriter
-
setId
Description copied from class:FormatWriterInitializes a writer from the input file name. Initializes aRandomAccessOutputStreamfor the output file and initializes the metadata for all the series usingFormatWriter.setSeries(int).- Specified by:
setIdin interfaceIFormatHandler- Overrides:
setIdin classFormatWriter- Parameters:
id- aStringspecifying the path to the file- Throws:
FormatExceptionIOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFormatWriter- Throws:
IOException
-
setCodec
private void setCodec() -
writeRotationMatrix
Write the 3x3 matrix that describes how to rotate the image.- Throws:
IOException
-
writeAtom
Write the atom length and type.- Throws:
IOException
-