public class JPCMainHeaderEncoder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.HashMap<java.lang.Integer,COCParameters> |
cocParametersList
Definition in
COCParameters . |
private CODParameters |
codParameters
Definition in
CODParameters . |
private COMParameters |
comParameters |
private boolean[] |
definedPrecincts
Tells if precincts are defined within the headers or not.
|
private BufferedDataOutputStream |
headerStream
Contains headers of the JPC file.
|
private java.util.HashMap<java.lang.Integer,QCCParameters> |
qccParametersList
Definition in
QCCParameters . |
private QCDParameters |
qcdParameters
Definition in
QCDParameters . |
private SIZParameters |
sizParameters
Definition in
SIZParameters . |
private int[] |
tileParts
Number of tile-parts in each tile.
|
Constructor and Description |
---|
JPCMainHeaderEncoder(JPCParameters jpcParameters) |
JPCMainHeaderEncoder(SIZParameters sizParameters,
CODParameters codParameters,
QCDParameters qcdParameters)
Constructor of JPCMainHeaderEncoder.
|
JPCMainHeaderEncoder(SIZParameters sizParameters,
CODParameters codParameters,
QCDParameters qcdParameters,
java.util.HashMap<java.lang.Integer,COCParameters> cocParametersList,
java.util.HashMap<java.lang.Integer,QCCParameters> qccParametersList)
Constructor of JPCMainHeaderEncoder.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getMainHeader()
Returns the
headerStream attribute as a byte array. |
void |
list(java.io.PrintStream out)
Prints this JPC Main Header Encoder out to the specified output stream.
|
byte[] |
run()
Generates the JPC file headers.
|
java.lang.String |
toString() |
private void |
writeCOC(int z,
COCParameters cocParameters)
Generates the COC marker segment, COC has the coding style for a specific component.
|
private void |
writeCOD()
Generates the COD marker segment COD has the default coding style for all components; first component is considered to have the default values.
|
private void |
writeCOM()
Generates the COM marker segment.
|
private void |
writePrecinctSizes(int z,
int WTLevels,
int[] precinctHeights,
int[] precinctWidths)
Recives the COD or COC BitStream marker and fill it with the precinct Sizes
|
private void |
writeQCC(int z,
QCCParameters qccParameters)
Generates the QCC marker segment, QCC has the quantization parameters for a specific component.
|
private void |
writeQCD()
Generates the QCD marker segment, QCD has the default quantization parameters for all components.
|
private void |
writeQuantization(int z,
int WTLevels,
int quantizationStyle,
int[][] exponents,
int[][] mantisas)
Receives the COD or COC BitStream marker and fill it with the precinct Sizes
|
private void |
writeSIZ()
Generates the SIZ marker segment.
|
private SIZParameters sizParameters
SIZParameters
.private CODParameters codParameters
CODParameters
.private java.util.HashMap<java.lang.Integer,COCParameters> cocParametersList
COCParameters
.private QCDParameters qcdParameters
QCDParameters
.private java.util.HashMap<java.lang.Integer,QCCParameters> qccParametersList
QCCParameters
.private COMParameters comParameters
private BufferedDataOutputStream headerStream
private boolean[] definedPrecincts
private int[] tileParts
Values must be between 0 - 254.
public JPCMainHeaderEncoder(SIZParameters sizParameters, CODParameters codParameters, QCDParameters qcdParameters)
sizParameters
- definition in
SIZParameters
.codParameters
- definition in
CODParameters
.qcdParameters
- definition in
QCDParameters
.public JPCMainHeaderEncoder(SIZParameters sizParameters, CODParameters codParameters, QCDParameters qcdParameters, java.util.HashMap<java.lang.Integer,COCParameters> cocParametersList, java.util.HashMap<java.lang.Integer,QCCParameters> qccParametersList)
sizParameters
- definition in
SIZParameters
.codParameters
- definition in
CODParameters
.qcdParameters
- definition in
QCDParameters
.cocParametersList
- qccParametersList
- public JPCMainHeaderEncoder(JPCParameters jpcParameters)
jpcParameters
- public byte[] run() throws WarningException, java.io.IOException
WarningException
- when the header cannot be generatedjava.io.IOException
public byte[] getMainHeader()
headerStream
attribute as a byte array.headerStream
as a byte array.public java.lang.String toString()
toString
in class java.lang.Object
public void list(java.io.PrintStream out)
out
- an output stream.private void writeSIZ() throws WarningException, java.io.IOException
WarningException
- when the header cannot be generatedjava.io.IOException
- when an I/O error has occurred.private void writeCOD() throws WarningException, java.io.IOException
WarningException
- when COD marker segment cannot be generated due to CADI optionsjava.io.IOException
- when an I/O error has occurred.private void writeCOC(int z, COCParameters cocParameters) throws WarningException, java.io.IOException
z
- image componentWarningException
- when COC marker segment cannot be generated due to BOI optionsjava.io.IOException
- when an I/O error has occurred.private void writePrecinctSizes(int z, int WTLevels, int[] precinctHeights, int[] precinctWidths) throws WarningException, java.io.IOException
z
- image componentWarningException
- when COD or COC marker segment cannot be generated due to CADI optionsjava.io.IOException
- when an I/O error has occurred.private void writeQCD() throws WarningException, java.io.IOException
WarningException
- when QCD marker segment cannot be generated due to CADI optionsjava.io.IOException
- when an I/O error has occurred.private void writeQCC(int z, QCCParameters qccParameters) throws WarningException, java.io.IOException
z
- image componentWarningException
- when QCC marker segment cannot be generated due to CADI optionsjava.io.IOException
- when an I/O error has occurred.private void writeQuantization(int z, int WTLevels, int quantizationStyle, int[][] exponents, int[][] mantisas) throws WarningException, java.io.IOException
z
- image componentWarningException
- when COD or COC marker segment cannot be generated due to CADI optionsjava.io.IOException
- when an I/O error has occurred.private void writeCOM() throws java.io.IOException
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)