Class GenericRegion
java.lang.Object
org.apache.pdfbox.jbig2.segments.GenericRegion
- All Implemented Interfaces:
Region, SegmentData
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected short[]getGbAtX()protected short[]getGbAtY()protected byteThe procedure is described in 6.2.5.7, page 17.Simply returns theRegionSegmentInformation.voidinit(SegmentHeader header, SubInputStream sis) Parse the stream and read information of header.protected booleanprotected booleanisTPGDon()protected voidSimply sets the memory-critical bitmap of this region tonull.protected voidsetParameters(boolean isMMREncoded, byte sdTemplate, boolean isTPGDon, boolean useSkip, short[] sdATX, short[] sdATY, int symWidth, int hcHeight, CX cx, ArithmeticDecoder arithmeticDecoder) protected voidsetParameters(boolean isMMREncoded, long dataOffset, long dataLength, int gbh, int gbw) Used bySymbolDictionary.protected voidsetParameters(boolean isMMREncoded, long dataOffset, long dataLength, int gbh, int gbw, byte gbTemplate, boolean isTPGDon, boolean useSkip, short[] gbAtX, short[] gbAtY) Used byPatternDictionaryandHalftoneRegion.protected boolean
-
Constructor Details
-
GenericRegion
public GenericRegion() -
GenericRegion
-
-
Method Details
-
getRegionBitmap
The procedure is described in 6.2.5.7, page 17.- Specified by:
getRegionBitmapin interfaceRegion- Returns:
- The decoded
Bitmapof this region. - Throws:
IOException- if an underlying IO operation fails
-
setParameters
protected void setParameters(boolean isMMREncoded, long dataOffset, long dataLength, int gbh, int gbw) Used bySymbolDictionary.- Parameters:
isMMREncoded- the data is MMR encodeddataOffset- the offsetdataLength- the length of the datagbh- bitmap heightgbw- bitmap width
-
setParameters
protected void setParameters(boolean isMMREncoded, byte sdTemplate, boolean isTPGDon, boolean useSkip, short[] sdATX, short[] sdATY, int symWidth, int hcHeight, CX cx, ArithmeticDecoder arithmeticDecoder) - Parameters:
isMMREncoded- the data is MMR encodedsdTemplate- sd templateisTPGDon- is TPGDonuseSkip- use skipsdATX- x values gbA pixelssdATY- y values gbA pixelssymWidth- bitmap widthhcHeight- bitmap heightcx- context for the arithmetic decoderarithmeticDecoder- the arithmetic decode to be used Used bySymbolDictionary.
-
setParameters
protected void setParameters(boolean isMMREncoded, long dataOffset, long dataLength, int gbh, int gbw, byte gbTemplate, boolean isTPGDon, boolean useSkip, short[] gbAtX, short[] gbAtY) Used byPatternDictionaryandHalftoneRegion.- Parameters:
isMMREncoded- the data is MMR encodeddataOffset- the offsetdataLength- the length of the datagbh- bitmap heightgbw- bitmap widthgbTemplate- gb templateisTPGDon- is TPGDonuseSkip- use skipgbAtX- x values of gbA pixelsgbAtY- y values of gbA pixels
-
resetBitmap
protected void resetBitmap()Simply sets the memory-critical bitmap of this region tonull. -
init
public void init(SegmentHeader header, SubInputStream sis) throws InvalidHeaderValueException, 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 invalidIOException- if an underlying IO operation fails
-
getRegionInfo
Description copied from interface:RegionSimply returns theRegionSegmentInformation.- Specified by:
getRegionInfoin interfaceRegion- Returns:
- The
RegionSegmentInformation.
-
useExtTemplates
protected boolean useExtTemplates() -
isTPGDon
protected boolean isTPGDon() -
getGbTemplate
protected byte getGbTemplate() -
isMMREncoded
protected boolean isMMREncoded() -
getGbAtX
protected short[] getGbAtX() -
getGbAtY
protected short[] getGbAtY()
-