Class TextRegion
java.lang.Object
org.apache.pdfbox.jbig2.segments.TextRegion
- All Implemented Interfaces:
Region, SegmentData
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longNumber of symbol instances, 7.4.3.1.4private intprivate ArithmeticDecoderprivate CombinationOperatorprivate longFurther parametersprivate CXprivate CXprivate CXprivate CXprivate CXprivate CXprivate CXprivate CXprivate CXprivate CXprivate CXprivate shortprivate HuffmanTableprivate HuffmanTableUser-supplied tables *private GenericRefinementRegionprivate ArithmeticIntegerDecoderprivate booleanprivate shortprivate shortprivate HuffmanTableprivate HuffmanTableprivate HuffmanTableprivate HuffmanTableprivate shortprivate Bitmapprivate RegionSegmentInformationRegion segment information field, 7.4.1private HuffmanTableprivate shortprivate shortprivate shortprivate shortprivate shortprivate shortprivate shortprivate shortprivate shortText region segment Huffman flags, 7.4.3.1.2private short[]Text region refinement AT flags, 7.4.3.1.3private short[]private shortText region segment flags, 7.4.3.1.1private intprivate SegmentHeaderprivate SubInputStreamprivate intcodeTable including a code to each symbol used in that regionprivate FixedSizeTableprivate HuffmanTableprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate final voidprivate voidprivate voidprivate voidprivate final longprivate final longprivate final longdecodeDT()private final BitmapdecodeIb(long r, long id) private final longdecodeID()private final longprivate final longprivate final longprivate final longprivate final longprivate final longdecodeRI()private final longprivate voidprivate final longDecodes and returns a regions content.Simply returns theRegionSegmentInformation.private voidprivate HuffmanTablegetUserTable(int tablePosition) voidinit(SegmentHeader header, SubInputStream sis) Parse the stream and read information of header.private voidprivate voidprivate voidprivate voidprivate voidprivate voidprivate voidprotected voidsetContexts(CX cx, CX cxIADT, CX cxIAFS, CX cxIADS, CX cxIAIT, CX cxIAID, CX cxIARDW, CX cxIARDH, CX cxIARDX, CX cxIARDY) protected voidsetParameters(ArithmeticDecoder arithmeticDecoder, ArithmeticIntegerDecoder iDecoder, boolean isHuffmanEncoded, boolean sbRefine, int sbw, int sbh, long sbNumInstances, int sbStrips, int sbNumSyms, short sbDefaultPixel, short sbCombinationOperator, short transposed, short refCorner, short sbdsOffset, short sbHuffFS, short sbHuffDS, short sbHuffDT, short sbHuffRDWidth, short sbHuffRDHeight, short sbHuffRDX, short sbHuffRDY, short sbHuffRSize, short sbrTemplate, short[] sbrATX, short[] sbrATY, ArrayList<Bitmap> sbSyms, int sbSymCodeLen) private void
-
Field Details
-
subInputStream
-
regionInfo
Region segment information field, 7.4.1 -
sbrTemplate
private short sbrTemplateText region segment flags, 7.4.3.1.1 -
sbdsOffset
private short sbdsOffset -
defaultPixel
private short defaultPixel -
combinationOperator
-
isTransposed
private short isTransposed -
referenceCorner
private short referenceCorner -
logSBStrips
private short logSBStrips -
useRefinement
private boolean useRefinement -
isHuffmanEncoded
private boolean isHuffmanEncoded -
sbHuffRSize
private short sbHuffRSizeText region segment Huffman flags, 7.4.3.1.2 -
sbHuffRDY
private short sbHuffRDY -
sbHuffRDX
private short sbHuffRDX -
sbHuffRDHeight
private short sbHuffRDHeight -
sbHuffRDWidth
private short sbHuffRDWidth -
sbHuffDT
private short sbHuffDT -
sbHuffDS
private short sbHuffDS -
sbHuffFS
private short sbHuffFS -
sbrATX
private short[] sbrATXText region refinement AT flags, 7.4.3.1.3 -
sbrATY
private short[] sbrATY -
amountOfSymbolInstances
private long amountOfSymbolInstancesNumber of symbol instances, 7.4.3.1.4 -
currentS
private long currentSFurther parameters -
sbStrips
private int sbStrips -
amountOfSymbols
private int amountOfSymbols -
regionBitmap
-
symbols
-
arithmeticDecoder
-
integerDecoder
-
genericRefinementRegion
-
cxIADT
-
cxIAFS
-
cxIADS
-
cxIAIT
-
cxIARI
-
cxIARDW
-
cxIARDH
-
cxIAID
-
cxIARDX
-
cxIARDY
-
cx
-
symbolCodeLength
private int symbolCodeLengthcodeTable including a code to each symbol used in that region -
symbolCodeTable
-
segmentHeader
-
fsTable
User-supplied tables * -
dsTable
-
table
-
rdwTable
-
rdhTable
-
rdxTable
-
rdyTable
-
rSizeTable
-
-
Constructor Details
-
TextRegion
public TextRegion() -
TextRegion
-
-
Method Details
-
parseHeader
private void parseHeader() throws IOException, InvalidHeaderValueException, IntegerMaxValueException -
readRegionFlags
- Throws:
IOException
-
readHuffmanFlags
- Throws:
IOException
-
readUseRefinement
- Throws:
IOException
-
readAmountOfSymbolInstances
- Throws:
IOException
-
getSymbols
-
computeSymbolCodeLength
- Throws:
IOException
-
checkInput
- Throws:
InvalidHeaderValueException
-
getRegionBitmap
public Bitmap getRegionBitmap() throws IOException, IntegerMaxValueException, InvalidHeaderValueExceptionDescription copied from interface:RegionDecodes and returns a regions content.- Specified by:
getRegionBitmapin interfaceRegion- Returns:
- The decoded region as
Bitmap. - Throws:
IOException- if an underlying IO operation failsIntegerMaxValueException- if the maximum value limit of an integer is exceededInvalidHeaderValueException- if the segment header value is invalid
-
setCodingStatistics
- Throws:
IOException
-
createRegionBitmap
private void createRegionBitmap() -
decodeStripT
-
decodeSymbolInstances
private void decodeSymbolInstances() throws IOException, InvalidHeaderValueException, IntegerMaxValueException -
decodeDT
- Throws:
IOException
-
decodeDfS
-
decodeIdS
-
decodeCurrentT
- Throws:
IOException
-
decodeID
- Throws:
IOException
-
decodeRI
- Throws:
IOException
-
decodeIb
private final Bitmap decodeIb(long r, long id) throws IOException, InvalidHeaderValueException, IntegerMaxValueException -
decodeRdw
-
decodeRdh
-
decodeRdx
-
decodeRdy
-
decodeSymInRefSize
-
blit
-
initSymbols
private void initSymbols() throws IOException, IntegerMaxValueException, InvalidHeaderValueException -
getUserTable
private HuffmanTable getUserTable(int tablePosition) throws InvalidHeaderValueException, IOException -
symbolIDCodeLengths
- Throws:
IOException
-
init
public void init(SegmentHeader header, SubInputStream sis) throws InvalidHeaderValueException, IntegerMaxValueException, IOException Description copied from interface:SegmentDataParse the stream and read information of header.- Specified by:
initin interfaceSegmentData- Parameters:
header- - The segments' header (to make referred-to segments available in data part).sis- - WrappedImageInputStreamintoSubInputStream.- Throws:
InvalidHeaderValueException- if the segment header value is invalidIntegerMaxValueException- if the maximum value limit of an integer is exceededIOException- if an underlying IO operation fails
-
setContexts
-
setParameters
protected void setParameters(ArithmeticDecoder arithmeticDecoder, ArithmeticIntegerDecoder iDecoder, boolean isHuffmanEncoded, boolean sbRefine, int sbw, int sbh, long sbNumInstances, int sbStrips, int sbNumSyms, short sbDefaultPixel, short sbCombinationOperator, short transposed, short refCorner, short sbdsOffset, short sbHuffFS, short sbHuffDS, short sbHuffDT, short sbHuffRDWidth, short sbHuffRDHeight, short sbHuffRDX, short sbHuffRDY, short sbHuffRSize, short sbrTemplate, short[] sbrATX, short[] sbrATY, ArrayList<Bitmap> sbSyms, int sbSymCodeLen) -
getRegionInfo
Description copied from interface:RegionSimply returns theRegionSegmentInformation.- Specified by:
getRegionInfoin interfaceRegion- Returns:
- The
RegionSegmentInformation.
-