loci.formats
Class QTReader

java.lang.Object
  extended byloci.formats.FormatHandler
      extended byloci.formats.FormatReader
          extended byloci.formats.QTReader

public class QTReader
extends FormatReader

QTReader is the file format reader for QuickTime movie files. It does not require any external libraries to be installed. Additional video codecs will be added as time permits.


Field Summary
 
Fields inherited from class loci.formats.FormatReader
DEBUG, DEBUG_LEVEL, metadata, ome
 
Fields inherited from class loci.formats.FormatHandler
chooser, currentId, filters, format, suffixes
 
Constructor Summary
QTReader()
          Constructs a new QuickTime reader.
 
Method Summary
 void close()
          Closes any open files.
 int getImageCount(String id)
          Determines the number of images in the given QuickTime file.
protected  void initFile(String id)
          Initializes the given QuickTime file.
 boolean isContainer(String type)
          Checks if the given String is a container atom type.
 boolean isThisType(byte[] block)
          Checks if the given block is a valid header for a QuickTime file.
 byte[] jpegUncompress(byte[] input)
          Uncompresses a JPEG compressed image plane.
static void main(String[] args)
           
 BufferedImage open(String id, int no)
          Obtains the specified image from the given QuickTime file.
 void parse(int depth, long offset, long length)
          Parse all of the atoms in the file.
 void print(int depth, long size, String type, byte[] data)
          Debugging method; prints information on an atom.
 byte[] rleUncompress(byte[] input)
          Uncompresses a QT RLE compressed image plane.
 byte[] uncompress(byte[] pixs, String code)
          Uncompresses an image plane according to the the codec identifier.
 
Methods inherited from class loci.formats.FormatReader
createFilters, getMetadata, getMetadataValue, getOMENode, open, testRead
 
Methods inherited from class loci.formats.FormatHandler
getFileChooser, getFileFilters, getFormat, getSuffixes, isThisType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QTReader

public QTReader()
Constructs a new QuickTime reader.

Method Detail

isThisType

public boolean isThisType(byte[] block)
Checks if the given block is a valid header for a QuickTime file.

Specified by:
isThisType in class FormatReader

getImageCount

public int getImageCount(String id)
                  throws FormatException,
                         IOException
Determines the number of images in the given QuickTime file.

Specified by:
getImageCount in class FormatReader
Throws:
FormatException
IOException

open

public BufferedImage open(String id,
                          int no)
                   throws FormatException,
                          IOException
Obtains the specified image from the given QuickTime file.

Specified by:
open in class FormatReader
Throws:
FormatException
IOException

close

public void close()
           throws FormatException,
                  IOException
Closes any open files.

Specified by:
close in class FormatReader
Throws:
FormatException
IOException

initFile

protected void initFile(String id)
                 throws FormatException,
                        IOException
Initializes the given QuickTime file.

Overrides:
initFile in class FormatReader
Throws:
FormatException
IOException

parse

public void parse(int depth,
                  long offset,
                  long length)
           throws IOException
Parse all of the atoms in the file.

Throws:
IOException

isContainer

public boolean isContainer(String type)
Checks if the given String is a container atom type.


print

public void print(int depth,
                  long size,
                  String type,
                  byte[] data)
Debugging method; prints information on an atom.


uncompress

public byte[] uncompress(byte[] pixs,
                         String code)
                  throws FormatException
Uncompresses an image plane according to the the codec identifier.

Throws:
FormatException

jpegUncompress

public byte[] jpegUncompress(byte[] input)
                      throws FormatException
Uncompresses a JPEG compressed image plane.

Throws:
FormatException

rleUncompress

public byte[] rleUncompress(byte[] input)
                     throws FormatException
Uncompresses a QT RLE compressed image plane.

Throws:
FormatException

main

public static void main(String[] args)
                 throws FormatException,
                        IOException
Throws:
FormatException
IOException