public class EntropyCodedSegment
extends java.lang.Object
A JPEG Entropy Coded Segment.
Development of this class was supported by funding from MDDX Research and Informatics.
Constructor and Description |
---|
EntropyCodedSegment(MarkerSegmentSOS sos,
MarkerSegmentSOF sof,
java.util.Map<java.lang.String,HuffmanTable> htByClassAndIdentifer,
java.util.Map<java.lang.String,QuantizationTable> qtByIdentifer,
int nMCUHorizontally,
java.util.Vector<java.awt.Shape> redactionShapes,
boolean copying,
boolean dumping,
boolean decompressing,
Parse.DecompressedOutput decompressedOutput)
Set up the environment to decode an EntropyCodedSeqment to dump, redact or copy as required.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
finish(byte[] bytesToDecompress,
int mcuCount,
int mcuOffset)
Decode the supplied bytes that comprise a complete EntropyCodedSeqment and redact or copy them as required.
|
public EntropyCodedSegment(MarkerSegmentSOS sos, MarkerSegmentSOF sof, java.util.Map<java.lang.String,HuffmanTable> htByClassAndIdentifer, java.util.Map<java.lang.String,QuantizationTable> qtByIdentifer, int nMCUHorizontally, java.util.Vector<java.awt.Shape> redactionShapes, boolean copying, boolean dumping, boolean decompressing, Parse.DecompressedOutput decompressedOutput) throws java.lang.Exception
Set up the environment to decode an EntropyCodedSeqment to dump, redact or copy as required.
sos
- SOS marker segment contentssof
- SOF marker segment contentshtByClassAndIdentifer
- Huffman tablesqtByIdentifer
- quantization tablesnMCUHorizontally
- the number of MCUs in a single rowredactionShapes
- a Vector of Shape that are Rectanglecopying
- true if copyingdumping
- true if dumpingdecompressing
- true if decompressingdecompressedOutput
- the decompressed output (with specified or default endianness if precision > 8)java.lang.Exception
- if JPEG process not supportedpublic final byte[] finish(byte[] bytesToDecompress, int mcuCount, int mcuOffset) throws java.lang.Exception, java.io.IOException
Decode the supplied bytes that comprise a complete EntropyCodedSeqment and redact or copy them as required.
bytesToDecompress
- the bytes in the EntropyCodedSeqmentmcuCount
- the number of MCUs encoded by this EntropyCodedSeqmentmcuOffset
- the number of MCUs that have previously been read for the frame containing this EntropyCodedSeqmentjava.lang.Exception
- if bad things happen parsing the EntropyCodedSeqment, like running out of bits, caused by malformed inputjava.io.IOException
- if bad things happen reading or writing the bytes