loci.formats.out
Class QTWriter

java.lang.Object
  extended by loci.formats.FormatHandler
      extended by loci.formats.FormatWriter
          extended by loci.formats.out.QTWriter
All Implemented Interfaces:
loci.formats.IFormatHandler, loci.formats.IFormatWriter, loci.formats.StatusReporter

public class QTWriter
extends loci.formats.FormatWriter

QTWriter is the file format writer for uncompressed QuickTime movie files.

Source code:
Trac, SVN

Author:
Melissa Linkert linkert at wisc.edu

Field Summary
protected  long byteCountOffset
          Seek to this offset to update the total number of pixel bytes.
protected  int codec
          The codec to use.
static int CODEC_ANIMATION
          Value indicating Animation codec.
static int CODEC_CINEPAK
          Value indicating Cinepack codec.
static int CODEC_H_263
          Value indicating H.263 codec.
static int CODEC_MOTION_JPEG_B
          Value indicating Motion JPEG-B codec.
static int CODEC_MPEG_4
          Value indicating MPEG-4 codec.
static int CODEC_RAW
          Value indicating Raw codec.
static int CODEC_SORENSON
          Value indicating Sorenson codec.
static int CODEC_SORENSON_3
          Value indicating Sorenson 3 codec.
protected  int created
          Time the file was created.
protected  LegacyQTWriter legacy
          Legacy QuickTime writer.
protected  boolean needLegacy
          Whether we need the legacy writer.
protected  int numBytes
          Total number of pixel bytes.
protected  int numWritten
          Number of planes written.
protected  Vector offsets
          Vector of plane offsets.
protected  RandomAccessFile out
          Current file.
protected  int quality
          The quality to use.
static int QUALITY_HIGH
          Value indicating High quality.
static int QUALITY_LOW
          Value indicating Low quality.
static int QUALITY_MAXIMUM
          Value indicating Maximum quality.
static int QUALITY_NORMAL
          Value indicating Normal quality.
 
Fields inherited from class loci.formats.FormatWriter
cm, compression, compressionTypes, fps, initialized, metadataRetrieve
 
Fields inherited from class loci.formats.FormatHandler
currentId, debug, debugLevel, format, statusListeners, suffixes
 
Constructor Summary
QTWriter()
           
 
Method Summary
 boolean canDoStacks()
           
 void close()
           
 int[] getPixelTypes()
           
 void saveImage(Image image, boolean last)
           
 void setCodec(int codec)
          Sets the encoded movie's codec.
 void setQuality(int quality)
          Sets the quality of the encoded movie.
 
Methods inherited from class loci.formats.FormatWriter
canDoStacks, getColorModel, getCompressionTypes, getFramesPerSecond, getMetadataRetrieve, getPixelTypes, isSupportedType, isSupportedType, save, saveBytes, saveBytes, saveImage, setColorModel, setCompression, setFramesPerSecond, setId, setMetadataRetrieve
 
Methods inherited from class loci.formats.FormatHandler
addStatusListener, debug, getFormat, getStatusListeners, getSuffixes, isThisType, isThisType, removeStatusListener, setDebug, setDebugLevel, setId, status, status, status, trace, trace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface loci.formats.IFormatHandler
getFormat, getSuffixes, isThisType, isThisType, setId
 
Methods inherited from interface loci.formats.StatusReporter
addStatusListener, getStatusListeners, removeStatusListener
 

Field Detail

CODEC_MOTION_JPEG_B

public static final int CODEC_MOTION_JPEG_B
Value indicating Motion JPEG-B codec.

See Also:
Constant Field Values

CODEC_CINEPAK

public static final int CODEC_CINEPAK
Value indicating Cinepack codec.

See Also:
Constant Field Values

CODEC_ANIMATION

public static final int CODEC_ANIMATION
Value indicating Animation codec.

See Also:
Constant Field Values

CODEC_H_263

public static final int CODEC_H_263
Value indicating H.263 codec.

See Also:
Constant Field Values

CODEC_SORENSON

public static final int CODEC_SORENSON
Value indicating Sorenson codec.

See Also:
Constant Field Values

CODEC_SORENSON_3

public static final int CODEC_SORENSON_3
Value indicating Sorenson 3 codec.

See Also:
Constant Field Values

CODEC_MPEG_4

public static final int CODEC_MPEG_4
Value indicating MPEG-4 codec.

See Also:
Constant Field Values

CODEC_RAW

public static final int CODEC_RAW
Value indicating Raw codec.

See Also:
Constant Field Values

QUALITY_LOW

public static final int QUALITY_LOW
Value indicating Low quality.

See Also:
Constant Field Values

QUALITY_NORMAL

public static final int QUALITY_NORMAL
Value indicating Normal quality.

See Also:
Constant Field Values

QUALITY_HIGH

public static final int QUALITY_HIGH
Value indicating High quality.

See Also:
Constant Field Values

QUALITY_MAXIMUM

public static final int QUALITY_MAXIMUM
Value indicating Maximum quality.

See Also:
Constant Field Values

out

protected RandomAccessFile out
Current file.


codec

protected int codec
The codec to use.


quality

protected int quality
The quality to use.


numWritten

protected int numWritten
Number of planes written.


byteCountOffset

protected long byteCountOffset
Seek to this offset to update the total number of pixel bytes.


numBytes

protected int numBytes
Total number of pixel bytes.


offsets

protected Vector offsets
Vector of plane offsets.


created

protected int created
Time the file was created.


needLegacy

protected boolean needLegacy
Whether we need the legacy writer.


legacy

protected LegacyQTWriter legacy
Legacy QuickTime writer.

Constructor Detail

QTWriter

public QTWriter()
Method Detail

setCodec

public void setCodec(int codec)
Sets the encoded movie's codec.

Parameters:
codec - Codec value:
  • QTWriter.CODEC_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

saveImage

public void saveImage(Image image,
                      boolean last)
               throws loci.formats.FormatException,
                      IOException
Throws:
loci.formats.FormatException
IOException

canDoStacks

public boolean canDoStacks()
Specified by:
canDoStacks in interface loci.formats.IFormatWriter
Overrides:
canDoStacks in class loci.formats.FormatWriter

getPixelTypes

public int[] getPixelTypes()
Specified by:
getPixelTypes in interface loci.formats.IFormatWriter
Overrides:
getPixelTypes in class loci.formats.FormatWriter

close

public void close()
           throws IOException
Throws:
IOException