public class FileFormatReader extends Object implements FileFormatBoxes
FileFormatWriter
Modifier and Type | Field and Description |
---|---|
private short[] |
associations |
private int |
bitDepth |
private byte[] |
bitDepths
Various bit depth
|
private short[] |
channels
Channel definitions
|
private Vector |
codeStreamLength
The lengths of the codestreams in the fileformat
|
private Vector |
codeStreamPos
The positions of the codestreams in the fileformat
|
private ColorModel |
colorModel
Create a IndexColorModel from the palette box if there is one
|
private int |
colorSpaceType
Color specification
|
private int |
compressionType |
private short[] |
comps
Component mapping
|
private byte[] |
compSize |
private short[] |
cType |
private int |
height |
private RandomAccessIO |
in
The random access from which the file format boxes are read
|
private int |
intelProp |
private byte[][] |
lut
The lut in the palette box
|
private byte[] |
maps |
private J2KMetadata |
metadata
The meta data
|
private int |
numComp |
private ICC_Profile |
profile
ICC profile
|
private byte[] |
type |
private int |
unknownColor |
private int |
width
Parameters in header box
|
BITS_PER_COMPONENT_BOX, CAPTURE_RESOLUTION_BOX, CHANNEL_DEFINITION_BOX, COLOUR_SPECIFICATION_BOX, COMPONENT_MAPPING_BOX, CONTIGUOUS_CODESTREAM_BOX, CSB_APPROX, CSB_ENUM_GREY, CSB_ENUM_SRGB, CSB_ENUM_YCC, CSB_METH, CSB_PREC, DEFAULT_DISPLAY_RESOLUTION_BOX, FILE_TYPE_BOX, FT_BR, IMAGE_HEADER_BOX, IMB_C, IMB_IPR, IMB_UnkC, IMB_VERS, INTELLECTUAL_PROPERTY_BOX, JP2_HEADER_BOX, JP2_SIGNATURE_BOX, PALETTE_BOX, RESOLUTION_BOX, URL_BOX, UUID_BOX, UUID_INFO_BOX, UUID_LIST_BOX, XML_BOX
Constructor and Description |
---|
FileFormatReader(RandomAccessIO in,
J2KMetadata metadata)
The constructor of the FileFormatReader
|
Modifier and Type | Method and Description |
---|---|
long[] |
getCodeStreamPos()
This method creates and returns an array of positions to contiguous
codestreams in the file
|
ColorModel |
getColorModel()
Returns the color model created from the palette box.
|
int |
getFirstCodeStreamLength()
This method returns the length of the first contiguous codestreams in
the file
|
int |
getFirstCodeStreamPos()
This method returns the position of the first contiguous codestreams in
the file
|
void |
readBitsPerComponentBox(int length)
Read the bits per component.
|
void |
readChannelDefinitionBox(int length)
This method reads the Channel Definition box
|
void |
readColourSpecificationBox(int length)
Read the color specifications.
|
void |
readComponentMappingBox(int length)
Read the component mapping channel.
|
boolean |
readContiguousCodeStreamBox(int length,
long longLength)
This method skips the Contiguous codestream box and adds position
of contiguous codestream to a vector
|
void |
readFileFormat()
This method checks whether the given RandomAccessIO is a valid JP2 file
and if so finds the first codestream in the file.
|
boolean |
readFileTypeBox(int length,
long longLength)
This method reads the File Type box
|
boolean |
readImageHeaderBox(int length)
This method reads the Image Header box
|
void |
readIntPropertyBox(int length)
This method reads the contents of the Intellectual property box
|
boolean |
readJP2HeaderBox(int length)
This method reads the JP2Header box
|
void |
readPaletteBox(int length)
This method reads the content of the palette box
|
void |
readResolutionBox(int type,
int length)
Read the resolution.
|
void |
readURLBox(int length)
This method reads the contents of the XML box
|
void |
readUUIDBox(int length)
This method reads the contents of the Intellectual property box
|
void |
readUUIDListBox(int length)
This method reads the contents of the UUID List box
|
void |
readXMLBox(int length)
This method reads the contents of the XML box
|
private RandomAccessIO in
private Vector codeStreamPos
private Vector codeStreamLength
private ColorModel colorModel
private J2KMetadata metadata
private int width
private int height
private int numComp
private int bitDepth
private int compressionType
private int unknownColor
private int intelProp
private byte[] bitDepths
private byte[][] lut
private byte[] compSize
private short[] comps
private byte[] type
private byte[] maps
private short[] channels
private short[] cType
private short[] associations
private int colorSpaceType
private ICC_Profile profile
public FileFormatReader(RandomAccessIO in, J2KMetadata metadata)
in
- The RandomAccessIO from which to read the file formatpublic void readFileFormat() throws IOException, EOFException
IOException
- If an I/O error ocurred.EOFException
- If end of file is reachedpublic boolean readFileTypeBox(int length, long longLength) throws IOException, EOFException
IOException
- If an I/O error ocurred.EOFException
- If the end of file was reachedpublic boolean readJP2HeaderBox(int length) throws IOException, EOFException
length
- The length of the JP2Header boxIOException
- If an I/O error ocurred.EOFException
- If the end of file was reachedpublic boolean readImageHeaderBox(int length) throws IOException, EOFException
length
- The length of the JP2Header boxIOException
- If an I/O error ocurred.EOFException
- If the end of file was reachedpublic boolean readContiguousCodeStreamBox(int length, long longLength) throws IOException, EOFException
length
- The length of the JP2Header boxlongLength
- The length of the JP2Header box if greater than 1<<32IOException
- If an I/O error ocurred.EOFException
- If the end of file was reachedpublic void readIntPropertyBox(int length) throws IOException
IOException
public void readXMLBox(int length) throws IOException
IOException
public void readURLBox(int length) throws IOException
IOException
public void readUUIDBox(int length) throws IOException
IOException
public void readUUIDListBox(int length) throws IOException
IOException
public void readPaletteBox(int length) throws IOException
IOException
public void readComponentMappingBox(int length) throws IOException
IOException
public void readChannelDefinitionBox(int length) throws IOException
IOException
- If an I/O error ocurred.public void readBitsPerComponentBox(int length) throws IOException
IOException
public void readColourSpecificationBox(int length) throws IOException
IOException
public void readResolutionBox(int type, int length) throws IOException
IOException
public long[] getCodeStreamPos()
public int getFirstCodeStreamPos()
public int getFirstCodeStreamLength()
public ColorModel getColorModel()
Copyright © 2017 Open Microscopy Environment