public class JPCMainHeaderDecoder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) int[] |
definedPrecincts
Tells if precincts are defined within the headers or not (1 or 0).
|
private BufferedDataInputStream |
in
Is an object with the input stream where the main header is read from.
|
private JPCParameters |
jpcParameters
Is an object where the main header are saved.
|
private long |
mainHeaderInitialPos
Is the file pointer to the first byte of the main header.
|
private int |
mainHeaderLength
Is the length of the main header.
|
(package private) boolean |
markerFound
To know if a marker has been found.
|
Constructor and Description |
---|
JPCMainHeaderDecoder(BufferedDataInputStream in)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
JPCParameters |
getJPCParameters()
This function returns the JPC codestream parameters.
|
long |
getMainHeaderInitialPos()
Returns the first position of the main header first byte in the image
codestream.
|
int |
getMainHeaderLength()
Returns the length of the main header.
|
private void |
readCBD() |
private void |
readCOC()
Reads a COD/COC marker segment and retrieves the parameters contained.
|
private void |
readCOD()
Reads a COD marker segment and retrieves the parameters contained.
|
void |
readCOM()
Reads a COM marker segment and retrieves the parameters contained.
|
private void |
readMCC()
Reads the MCC marker.
|
private void |
readMCO()
Reads the MCO marker.
|
private void |
readMCT() |
private void |
readQCC()
Reads a QCD/QCC marker segment and retrieves the parameters contained.
|
private void |
readQCD()
Reads a QCD/QCC marker segment and retrieves the parameters contained.
|
private void |
readSIZ()
Reads the SIZ marker segment and retrieves the parameters contained.
|
private void |
readSOC()
Reads the SOC marke and retrieves the parameters contained.
|
void |
run()
Reads the J2C file headers and retrieves the parameters contained.
|
private BufferedDataInputStream in
private JPCParameters jpcParameters
private long mainHeaderInitialPos
private int mainHeaderLength
int[] definedPrecincts
Index in the array is component index
boolean markerFound
public JPCMainHeaderDecoder(BufferedDataInputStream in)
in
- public void run() throws ErrorException
ErrorException
- when the header information is ambiguous or incorrectpublic long getMainHeaderInitialPos()
public int getMainHeaderLength()
public JPCParameters getJPCParameters()
JPCParameters
private void readSOC() throws ErrorException, java.io.IOException
ErrorException
- when the SOC marker is not unique in the codestreamjava.io.IOException
private void readSIZ() throws ErrorException, java.io.IOException
ErrorException
- when the SIZ marker or its marker segment is ambiguous or incorrectjava.io.IOException
private void readCOD() throws ErrorException, java.io.IOException
ErrorException
- when the COD marker segment is ambiguous or incorrectjava.io.IOException
private void readCOC() throws ErrorException, java.io.IOException
ErrorException
- when the COD/COC marker segment is ambiguous or incorrectjava.io.IOException
private void readQCD() throws ErrorException, java.io.IOException
ErrorException
- when the QCD/QCC marker segment is ambiguous or incorrectjava.io.IOException
private void readQCC() throws ErrorException, java.io.IOException
ErrorException
- when the QCD/QCC marker segment is ambiguous or incorrectjava.io.IOException
public void readCOM() throws ErrorException, java.io.IOException
ErrorException
java.io.IOException
private void readCBD() throws ErrorException, java.io.IOException
ErrorException
java.io.IOException
private void readMCT() throws ErrorException, java.io.IOException
ErrorException
java.io.IOException
private void readMCC() throws ErrorException, java.io.IOException
ErrorException
java.io.IOException
private void readMCO() throws ErrorException, java.io.IOException
ErrorException
java.io.IOException
CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Group on Interactive Coding of Images (GICI) (contact)