|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jj2000.j2k.util.CodestreamManipulator
This class takes a legal JPEG 2000 codestream and performs some manipulation on it. Currently the manipulations supported are: Tile-parts
Field Summary | |
private byte[] |
mainHeader
The main header |
private static int |
MAX_TPSOT
The maximum number of a tile part index (TPsot) |
private int |
maxtp
The maximum number of tile parts in any tile |
private int |
nt
The number of tiles in the image |
private java.lang.String |
outname
The name of the outfile |
private byte[][][] |
packetData
Buffers containing the packet data |
private byte[][][] |
packetHeaders
Buffers contaning the packet headers |
private java.lang.Integer[] |
positions
The positions of the SOT, SOP and EPH markers |
private boolean |
ppmUsed
Flag indicating whether packed packet headers in main header is used |
private int[] |
ppt
The number of packets per tile |
private int |
pptp
The number of packets per tile-part |
private boolean |
pptUsed
Flag indicating whether packed packet headers in tile headers is used |
private byte[][][] |
sopMarkSeg
Buffers containing the SOP marker segments |
private boolean |
tempEph
Flag indicating whether EPH marker was only intended for parsing in This class and should be removed |
private boolean |
tempSop
Flag indicating whether SOP marker was only intended for parsing in This class and should be removed |
private byte[][] |
tileHeaders
Buffers containing the original tile headers |
private byte[][][] |
tileParts
Buffers containing the tile parts |
private static int |
TP_HEAD_LEN
The length of a SOT plus a SOD marker |
Constructor Summary | |
CodestreamManipulator(java.lang.String outname,
int nt,
int pptp,
boolean ppm,
boolean ppt,
boolean tempSop,
boolean tempEph)
Instantiates a codestream manipulator.. |
Method Summary | |
private void |
createTileParts()
This method creates the tileparts from the buffered tile headers, packet headers and packet data |
int |
doCodestreamManipulation()
This method performs the actual manipulation of the codestream which is the reparsing for tile parts and packed packet headers |
private void |
parseAndFind(BufferedRandomAccessFile fi)
This method parses the codestream for SOT, SOP and EPH markers and removes header header bits signalling SOP and EPH markers if packed packet headers are used |
private void |
readAndBuffer(BufferedRandomAccessFile fi)
This method reads and buffers the tile headers, packet headers and packet data. |
private void |
writeNewCodestream(BufferedRandomAccessFile fi)
This method writes the new codestream to the file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean ppmUsed
private boolean pptUsed
private boolean tempSop
private boolean tempEph
private int nt
private int pptp
private java.lang.String outname
private static int TP_HEAD_LEN
private static int MAX_TPSOT
private int maxtp
private int[] ppt
private java.lang.Integer[] positions
private byte[] mainHeader
private byte[][][] tileParts
private byte[][] tileHeaders
private byte[][][] packetHeaders
private byte[][][] packetData
private byte[][][] sopMarkSeg
Constructor Detail |
public CodestreamManipulator(java.lang.String outname, int nt, int pptp, boolean ppm, boolean ppt, boolean tempSop, boolean tempEph)
outname
- The name of the original outfilent
- The number of tiles in the imagepptp
- Packets per tile-part. If zero, no division into tileparts
is performedppm
- Flag indicating that PPM marker is usedppt
- Flag indicating that PPT marker is usedtempSop
- Flag indicating whether SOP merker should be removedtempEph
- Flag indicating whether EPH merker should be removedMethod Detail |
public int doCodestreamManipulation() throws java.io.IOException
java.io.IOException
- If an I/O error ocurred.private void parseAndFind(BufferedRandomAccessFile fi) throws java.io.IOException
fi
- The file to parse the markers from
java.io.IOException
- If an I/O error ocurred.private void readAndBuffer(BufferedRandomAccessFile fi) throws java.io.IOException
fi
- The file to read the headers and data from
java.io.IOException
- If an I/O error ocurred.private void createTileParts() throws java.io.IOException
java.io.IOException
- If an I/O error ocurred.private void writeNewCodestream(BufferedRandomAccessFile fi) throws java.io.IOException
fi
- The file to write the new codestream to
java.io.IOException
- If an I/O error ocurred.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |