public class PacketHeadersDecoder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private JPEG2KCodestream |
codestream |
private boolean |
EPH
Indicates whether the End of Packet marker is in the codestream and it
must be read.
|
private int[][][] |
firstLayer
Definition in
PacketHeaderDataDecoder.firstLayer . |
private long |
inClassIdentifier |
private int[][][] |
lBlock
Definition in
PacketHeaderDataDecoder.lBlock . |
private int |
Nsop
Packet sequence number.
|
private int |
NsopInHeader |
private java.util.HashMap<java.lang.Long,PacketHeaderDataDecoder> |
packetHeaders
This object is used to save the packet headers data objects.
|
private PacketHeaderDataInputStream |
PHDInputStream
Is a input stream where bits of packet headers will be read from.
|
private boolean |
SOP
Indicates whether the Start of Packet marker is in the codestream and it
must be read.
|
private TagTreeDecoder[] |
TTInclusionInformation
Definition in
PacketHeaderDataDecoder.TTInclusionInformation . |
private TagTreeDecoder[] |
TTZeroBitPlanes
Definition in
PacketHeaderDataDecoder.TTZeroBitPlanes . |
private int[][][] |
zeroBitPlanes |
Constructor and Description |
---|
PacketHeadersDecoder(JPEG2KCodestream codestream)
Constructor.
|
PacketHeadersDecoder(JPEG2KCodestream codestream,
boolean sop,
boolean eph)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private int |
DecodeCodingPasses()
Decodify the coding passes
|
private int |
DecodeLblock()
Decodify the Lblock value
|
private int[] |
DecodeLengths(int lblock,
int codingPasses)
Decodify the length of codeword segment
|
private int |
DecodeLengthsNew(int lblock,
int codingPasses)
Decode the length of codeword segment
|
private int |
getBit()
Returns the bit readed from the file.
|
int[][][] |
getZeroBitPlanes(long inClassIdentifier)
Returns the zero bit planes for a tile-component-resolution-precinct.
|
void |
list(java.io.PrintStream out)
Prints this Packet headers Decoder's fields to the specified output
stream.
|
int[][][][] |
packetHeaderDecoding(PacketHeaderDataInputStream BuffInputStream,
long inClassIdentifier)
Decodes the packet header for a precinct of a given layer, z, rLevel, precinct
|
int[][][][] |
packetHeaderDecodingNew(PacketHeaderDataInputStream BuffInputStream,
long inClassIdentifier)
Decodes the packet header for a precinct of a given layer, z, rLevel, precinct
|
private void |
readEPH()
Reads EPH marker if it is.
|
private void |
readSOP()
Reads SOP marker if it is.
|
void |
reset()
Sets the internal attributes (states) to its initial values.
|
java.lang.String |
toString()
(non-Javadoc)
|
private long inClassIdentifier
private JPEG2KCodestream codestream
private PacketHeaderDataInputStream PHDInputStream
private boolean SOP
private boolean EPH
private java.util.HashMap<java.lang.Long,PacketHeaderDataDecoder> packetHeaders
JPIPMessageHeader.inClassIdentifier
)
as a key.private TagTreeDecoder[] TTInclusionInformation
PacketHeaderDataDecoder.TTInclusionInformation
.private TagTreeDecoder[] TTZeroBitPlanes
PacketHeaderDataDecoder.TTZeroBitPlanes
.private int[][][] lBlock
PacketHeaderDataDecoder.lBlock
.private int[][][] firstLayer
PacketHeaderDataDecoder.firstLayer
.private int[][][] zeroBitPlanes
private int Nsop
Valid values between 0 to 65535.
private int NsopInHeader
public PacketHeadersDecoder(JPEG2KCodestream codestream)
This constructor assumes Start Of Packet (SOP) and End of Packet Headers (EPH) are read from the codestream information.
imageStructure
- definition in #imageStructure
public PacketHeadersDecoder(JPEG2KCodestream codestream, boolean sop, boolean eph)
public void reset() throws ErrorException
ErrorException
- when the internal attributes cannot be reseted.public int[][][][] packetHeaderDecoding(PacketHeaderDataInputStream BuffInputStream, long inClassIdentifier) throws ErrorException, java.io.EOFException, java.io.IOException
PHDataInputStream
- a input stream where packet header is read from.inClassIdentifier
- definition in JPIPMessageHeader.inClassIdentifier
.ErrorException
- when the packet header is corruptedjava.io.EOFException
- if the end of the input stream has been reached.java.io.IOException
- if a I/O error has ocurred.public int[][][][] packetHeaderDecodingNew(PacketHeaderDataInputStream BuffInputStream, long inClassIdentifier) throws ErrorException, java.io.EOFException, java.io.IOException
PHDataInputStream
- a input stream where packet header is read from.inClassIdentifier
- definition in JPIPMessageHeader.inClassIdentifier
.ErrorException
- when the packet header is corruptedjava.io.EOFException
- if the end of the input stream has been reached.java.io.IOException
- if a I/O error has ocurred.public int[][][] getZeroBitPlanes(long inClassIdentifier) throws java.lang.IllegalAccessException
inClassIdentifier
- PacketHeaderDataDecoder.zeroBitPlanes
java.lang.IllegalAccessException
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public void list(java.io.PrintStream out)
out
- an output stream.private int DecodeLblock() throws java.io.EOFException, java.io.IOException
ErrorException
- when the packet header is corruptedjava.io.EOFException
java.io.IOException
private int[] DecodeLengths(int lblock, int codingPasses) throws java.io.EOFException, java.io.IOException
lblock
- current valuecodingPasses
- coding passes number of the codeblockErrorException
- when the packet header is corruptedjava.io.EOFException
java.io.IOException
private int DecodeLengthsNew(int lblock, int codingPasses) throws java.io.EOFException, java.io.IOException
lblock
- current valuecodingPasses
- number of coding passes within the segmentErrorException
- when the packet header is corruptedjava.io.EOFException
java.io.IOException
private int DecodeCodingPasses() throws java.io.EOFException, java.io.IOException
ErrorException
- when the packet header is corruptedjava.io.EOFException
java.io.IOException
private void readSOP() throws ErrorException, java.io.EOFException, java.io.IOException
ErrorException
- when the file cannot be loadjava.io.EOFException
java.io.IOException
private void readEPH() throws ErrorException, java.io.EOFException, java.io.IOException
ErrorException
- when the file cannot be loadjava.io.EOFException
java.io.IOException
private int getBit() throws java.io.EOFException, java.io.IOException
java.io.EOFException
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)