public class QTReader extends FormatReader
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
altCodec
Some movies use two video codecs -- this is the second codec.
|
private int |
altPlanes
Number of frames that use the alternate codec.
|
private int |
bitsPerPixel
Pixel depth.
|
private boolean |
canUsePrevious
Flag indicating whether we can safely use prevPixels.
|
private java.util.Vector<java.lang.Integer> |
chunkSizes
Number of bytes in each plane.
|
private java.lang.String |
codec
Video codec used by this movie.
|
private static java.lang.String[] |
CONTAINER_TYPES
List of identifiers for each container atom.
|
private boolean |
flip |
private java.lang.String |
forkFile |
private boolean |
interlaced
Set to true if the scanlines in a plane are interlaced (mjpb only).
|
private java.util.Vector<java.lang.Integer> |
offsets
Offsets to each plane's pixel data.
|
private long |
pixelBytes
Total number of bytes of pixel data.
|
private long |
pixelOffset
Offset to start of pixel data.
|
private byte[] |
prevPixels
Pixel data for the previous image plane.
|
private int |
prevPlane
Previous plane number.
|
private int |
rawSize
Raw plane size, in bytes.
|
private int |
scale
Amount to subtract from each offset.
|
private boolean |
separatedFork
Flag indicating whether the resource and data fork are separated.
|
core, coreIndex, datasetDescription, domains, fillColor, filterMetadata, flattenedResolutions, group, hasCompanionFiles, in, indexedAsRGB, metadata, metadataStore, normalizeData, resolution, saveOriginalMetadata, series, suffixNecessary, suffixSufficient, THUMBNAIL_DIMENSION
COMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixes
CAN_GROUP, CANNOT_GROUP, MUST_GROUP
Constructor and Description |
---|
QTReader()
Constructs a new QuickTime reader.
|
Modifier and Type | Method and Description |
---|---|
void |
close(boolean fileOnly)
Closes the currently open file.
|
java.lang.String[] |
getSeriesUsedFiles(boolean noPixels)
Returns an array of filenames needed to open the current series.
|
protected void |
initFile(java.lang.String id)
Initializes the given file (parsing header information, etc.).
|
private boolean |
isContainer(java.lang.String type)
Checks if the given String is a container atom type.
|
boolean |
isThisType(loci.common.RandomAccessInputStream stream)
Checks if the given stream is a valid stream for this file format.
|
byte[] |
openBytes(int no,
byte[] buf,
int x,
int y,
int w,
int h)
Obtains a sub-image of the specified image plane
into a pre-allocated byte array.
|
private void |
parse(int depth,
long offset,
long length)
Parse all of the atoms in the file.
|
private void |
print(int depth,
long size,
java.lang.String type)
Debugging method; prints information on an atom.
|
private void |
stripHeader()
Cut off header bytes from a resource fork file.
|
private byte[] |
uncompress(byte[] pixs,
java.lang.String code)
Uncompresses an image plane according to the the codec identifier.
|
addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMeta, addGlobalMetaList, addMeta, addMetaList, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMeta, addSeriesMetaList, close, coreIndexToSeries, fileGroupOption, flattenHashtables, get16BitLookupTable, get8BitLookupTable, getAcquisitionMode, getAdvancedSeriesUsedFiles, getAdvancedUsedFiles, getArcType, getAvailableOptions, getBinning, getBitsPerPixel, getCompression, getContrastMethod, getCoreIndex, getCoreMetadataList, getCorrection, getCurrentCore, getCurrentFile, getDatasetStructureDescription, getDetectorType, getDimensionOrder, getDimensionOrder, getDomains, getEffectiveSizeC, getExperimentType, getFilamentType, getFillColor, getFillRule, getFilterType, getFontFamily, getFontStyle, getGlobalMeta, getGlobalMetadata, getIlluminationType, getImageCount, getImmersion, getIndex, getIndex, getLaserMedium, getLaserType, getMarker, getMedium, getMetadataStore, getMetadataStoreRoot, getMetadataValue, getMicrobeamManipulationType, getMicroscopeType, getModuloC, getModuloT, getModuloZ, getNamingConvention, getOptimalTileHeight, getOptimalTileWidth, getPixelType, getPixelType, getPossibleDomains, getPulse, getRequiredDirectories, getResolution, getResolutionCount, getRGBChannelCount, getRotationTransform, getSeries, getSeriesCount, getSeriesMeta, getSeriesMetadata, getSeriesMetadataValue, getSeriesUsedFiles, getSizeC, getSizeT, getSizeX, getSizeY, getSizeZ, getThumbSizeX, getThumbSizeY, getUnderlyingReaders, getUsedFiles, getUsedFiles, getZCTCoords, getZCTModuloCoords, hasCompanionFiles, hasFlattenedResolutions, isFalseColor, isGroupFiles, isIndexed, isInterleaved, isInterleaved, isLittleEndian, isMetadataComplete, isMetadataFiltered, isNormalized, isOrderCertain, isOriginalMetadataPopulated, isRGB, isSingleFile, isThisType, isThisType, isThisType, isThumbnailSeries, isUsedFile, makeFilterMetadata, openBytes, openBytes, openBytes, openPlane, openThumbBytes, readPlane, readPlane, readPlane, reopenFile, seriesToCoreIndex, setCoreIndex, setFillColor, setFlattenedResolutions, setGroupFiles, setId, setMetadataFiltered, setMetadataStore, setNormalized, setOriginalMetadataPopulated, setResolution, setSeries, updateMetadataLists
checkSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, setMetadataOptions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFormat, getNativeDataType, getSuffixes
getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
private static final java.lang.String[] CONTAINER_TYPES
private long pixelOffset
private long pixelBytes
private int bitsPerPixel
private int rawSize
private java.util.Vector<java.lang.Integer> offsets
private byte[] prevPixels
private int prevPlane
private boolean canUsePrevious
private java.lang.String codec
private java.lang.String altCodec
private int altPlanes
private int scale
private java.util.Vector<java.lang.Integer> chunkSizes
private boolean interlaced
private boolean separatedFork
private java.lang.String forkFile
private boolean flip
public boolean isThisType(loci.common.RandomAccessInputStream stream) throws java.io.IOException
IFormatReader
isThisType
in interface IFormatReader
isThisType
in class FormatReader
stream
- A RandomAccessInputStream representing the file to check.
The first byte in the stream is assumed to be the first byte
in the file.java.io.IOException
public java.lang.String[] getSeriesUsedFiles(boolean noPixels)
IFormatReader
IFormatHandler.setId(String)
, if appropriate based upon 'noPixels'.
The remaining elements are expected to be in a consistent order;
if a directory listing is necessary to build the list then it should
be sorted first.getSeriesUsedFiles
in interface IFormatReader
getSeriesUsedFiles
in class FormatReader
public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, java.io.IOException
IFormatReader
openBytes
in interface IFormatReader
openBytes
in class FormatReader
no
- the plane index within the current series.buf
- a pre-allocated buffer.x
- X coordinate of the upper-left corner of the sub-imagey
- Y coordinate of the upper-left corner of the sub-imagew
- width of the sub-imageh
- height of the sub-imagebuf
for convenience.FormatException
- if there was a problem parsing the metadata of the
file.java.io.IOException
- if there was a problem reading the file.IFormatReader.openBytes(int, byte[], int, int, int, int)
public void close(boolean fileOnly) throws java.io.IOException
IFormatReader
Closeable.close()
.close
in interface IFormatReader
close
in class FormatReader
java.io.IOException
protected void initFile(java.lang.String id) throws FormatException, java.io.IOException
FormatReader
initFile
in class FormatReader
FormatException
- if a parsing error occurs processing the file.java.io.IOException
- if an I/O error occurs processing the fileprivate void parse(int depth, long offset, long length) throws FormatException, java.io.IOException
FormatException
java.io.IOException
private boolean isContainer(java.lang.String type)
private void print(int depth, long size, java.lang.String type)
private byte[] uncompress(byte[] pixs, java.lang.String code) throws FormatException, java.io.IOException
FormatException
java.io.IOException
private void stripHeader() throws java.io.IOException
java.io.IOException
Copyright © 2023 Open Microscopy Environment