loci.formats
Class AVIReader

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

public class AVIReader
extends FormatReader

AVIReader is the file format reader for uncompressed AVI files. Much of this form's code was adapted from Wayne Rasband's AVI Movie Reader plugin for ImageJ (available at http://rsb.info.nih.gov/ij).


Field Summary
(package private)  int bigChunkSize
           
(package private)  int bmpActualColorsUsed
           
(package private)  int bmpActualSize
           
(package private)  short bmpBitsPerPixel
           
(package private)  int bmpColorsImportant
           
(package private)  int bmpColorsUsed
           
(package private)  int bmpCompression
           
(package private)  int bmpHeight
           
(package private)  int bmpHorzResolution
           
(package private)  int bmpNoOfPixels
           
(package private)  short bmpPlanes
           
(package private)  int bmpScanLineSize
           
(package private)  int bmpSize
           
(package private)  int bmpSizeOfBitmap
           
(package private)  boolean bmpTopDown
           
(package private)  int bmpVertResolution
           
(package private)  int bmpWidth
           
(package private)  byte[] byteData
           
(package private)  int dwFlags
           
(package private)  int dwHeight
           
(package private)  int dwInitialFrames
           
(package private)  int dwLength
           
(package private)  int dwMaxBytesPerSec
           
(package private)  int dwMicroSecPerFrame
           
(package private)  int dwRate
           
(package private)  int dwReserved1
           
(package private)  int dwScale
           
(package private)  int dwStart
           
(package private)  int dwStreamFlags
           
(package private)  int dwStreamInitialFrames
           
(package private)  int dwStreamLength
           
(package private)  int dwStreamQuality
           
(package private)  int dwStreamRate
           
(package private)  int dwStreamReserved1
           
(package private)  int dwStreams
           
(package private)  int dwStreamSampleSize
           
(package private)  int dwStreamScale
           
(package private)  int dwStreamStart
           
(package private)  int dwStreamSuggestedBufferSize
           
(package private)  int dwSuggestedBufferSize
           
(package private)  int dwTotalFrames
           
(package private)  int dwWidth
           
(package private)  String fcc
           
(package private)  String fccStreamHandler
           
(package private)  String fccStreamType
           
protected  RandomAccessFile in
          Current file.
(package private)  short[] intData
           
(package private)  byte[] pb
           
(package private)  byte[] pg
           
(package private)  long pos
           
(package private)  byte[] pr
           
(package private)  byte[] rawData
           
(package private)  int size
           
(package private)  String type
           
 
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
AVIReader()
          Constructs a new AVI reader.
 
Method Summary
 void close()
          Closes any open files.
 int getImageCount(String id)
          Determines the number of images in the given AVI file.
protected  void initFile(String id)
          Initializes the given AVI file.
 void initOMEMetadata()
          Initialize the OME-XML tree.
 boolean isThisType(byte[] block)
          Checks if the given block is a valid header for an AVI file.
static void main(String[] args)
           
 BufferedImage open(String id, int no)
          Obtains the specified image from the given AVI file.
 String readStringBytes()
          Reads a 4-byte String.
 void unpack(byte[] rawData, int rawOffset, byte[] byteData, int byteOffset, int w)
          Unpacks a byte array into a new byte array.
 
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
 

Field Detail

in

protected RandomAccessFile in
Current file.


type

String type

fcc

String fcc

size

int size

bigChunkSize

int bigChunkSize

pos

long pos

dwMicroSecPerFrame

int dwMicroSecPerFrame

dwMaxBytesPerSec

int dwMaxBytesPerSec

dwReserved1

int dwReserved1

dwFlags

int dwFlags

dwTotalFrames

int dwTotalFrames

dwInitialFrames

int dwInitialFrames

dwStreams

int dwStreams

dwSuggestedBufferSize

int dwSuggestedBufferSize

dwWidth

int dwWidth

dwHeight

int dwHeight

dwScale

int dwScale

dwRate

int dwRate

dwStart

int dwStart

dwLength

int dwLength

fccStreamType

String fccStreamType

fccStreamHandler

String fccStreamHandler

dwStreamFlags

int dwStreamFlags

dwStreamReserved1

int dwStreamReserved1

dwStreamInitialFrames

int dwStreamInitialFrames

dwStreamScale

int dwStreamScale

dwStreamRate

int dwStreamRate

dwStreamStart

int dwStreamStart

dwStreamLength

int dwStreamLength

dwStreamSuggestedBufferSize

int dwStreamSuggestedBufferSize

dwStreamQuality

int dwStreamQuality

dwStreamSampleSize

int dwStreamSampleSize

bmpSize

int bmpSize

bmpSizeOfBitmap

int bmpSizeOfBitmap

bmpHorzResolution

int bmpHorzResolution

bmpVertResolution

int bmpVertResolution

bmpColorsUsed

int bmpColorsUsed

bmpColorsImportant

int bmpColorsImportant

bmpNoOfPixels

int bmpNoOfPixels

bmpWidth

int bmpWidth

bmpHeight

int bmpHeight

bmpCompression

int bmpCompression

bmpActualSize

int bmpActualSize

bmpScanLineSize

int bmpScanLineSize

bmpActualColorsUsed

int bmpActualColorsUsed

bmpPlanes

short bmpPlanes

bmpBitsPerPixel

short bmpBitsPerPixel

bmpTopDown

boolean bmpTopDown

intData

short[] intData

byteData

byte[] byteData

rawData

byte[] rawData

pr

byte[] pr

pg

byte[] pg

pb

byte[] pb
Constructor Detail

AVIReader

public AVIReader()
Constructs a new AVI reader.

Method Detail

isThisType

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

Specified by:
isThisType in class FormatReader

getImageCount

public int getImageCount(String id)
                  throws FormatException,
                         IOException
Determines the number of images in the given AVI 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 AVI 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 AVI file.

Overrides:
initFile in class FormatReader
Throws:
FormatException
IOException

initOMEMetadata

public void initOMEMetadata()
Initialize the OME-XML tree.


unpack

public void unpack(byte[] rawData,
                   int rawOffset,
                   byte[] byteData,
                   int byteOffset,
                   int w)
Unpacks a byte array into a new byte array.


readStringBytes

public String readStringBytes()
                       throws IOException
Reads a 4-byte String.

Throws:
IOException

main

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