|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectloci.formats.FormatHandler
loci.formats.FormatReader
loci.formats.in.BMPReader
public class BMPReader
BMPReader is the file format reader for Microsoft Bitmap (BMP) files. See http://astronomy.swin.edu.au/~pbourke/dataformats/bmp/ for a nice description of the BMP file format.
Field Summary | |
---|---|
protected int |
bpp
Number of bits per pixel. |
protected int |
compression
Compression type: 0 = no compression, 1 = 8 bit run length encoding, 2 = 4 bit run length encoding, 3 = RGB bitmap with mask. |
protected int |
offset
Offset to the image data. |
protected byte[][] |
palette
The palette for indexed color images. |
Fields inherited from class loci.formats.FormatReader |
---|
collectMetadata, core, filterMetadata, group, in, metadata, metadataStore, normalizeData, saveOriginalMetadata, series, THUMBNAIL_DIMENSION |
Fields inherited from class loci.formats.FormatHandler |
---|
currentId, debug, debugLevel, format, statusListeners, suffixes |
Fields inherited from interface loci.formats.IFormatReader |
---|
CAN_GROUP, CANNOT_GROUP, MUST_GROUP |
Constructor Summary | |
---|---|
BMPReader()
Constructs a new BMP reader. |
Method Summary | |
---|---|
byte[][] |
get8BitLookupTable()
Gets the 8-bit color lookup table associated with the most recently opened image. |
protected void |
initFile(String id)
Initializes the given file (parsing header information, etc.). |
boolean |
isThisType(byte[] block)
Checks if the given block is a valid header for this file format. |
byte[] |
openBytes(int no,
byte[] buf)
Obtains the specified image from the current file into a pre-allocated byte array of (sizeX * sizeY * bytesPerPixel). |
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 |
---|
protected int offset
protected int bpp
protected byte[][] palette
protected int compression
Constructor Detail |
---|
public BMPReader()
Method Detail |
---|
public boolean isThisType(byte[] block)
IFormatReader
public byte[][] get8BitLookupTable() throws FormatException, IOException
IFormatReader
INT8
or UINT8
, this method will return null.
get8BitLookupTable
in interface IFormatReader
get8BitLookupTable
in class FormatReader
FormatException
IOException
public byte[] openBytes(int no, byte[] buf) throws FormatException, IOException
IFormatReader
no
- the image index within the file.buf
- a pre-allocated buffer.
buf
for convenience.
FormatException
- if there was a problem parsing the metadata of the
file.
IOException
- if there was a problem reading the file.protected void initFile(String id) throws FormatException, IOException
FormatReader
initFile
in class FormatReader
FormatException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |