Class GenericRegion

java.lang.Object
org.apache.pdfbox.jbig2.segments.GenericRegion
All Implemented Interfaces:
Region, SegmentData

public class GenericRegion extends Object implements Region
This class represents a generic region segment.
Parsing is done as described in 7.4.5.
Decoding procedure is done as described in 6.2.5.7 and 7.4.6.4.
  • Constructor Details

    • GenericRegion

      public GenericRegion()
    • GenericRegion

      public GenericRegion(SubInputStream subInputStream)
  • Method Details

    • getRegionBitmap

      public Bitmap getRegionBitmap() throws IOException
      The procedure is described in 6.2.5.7, page 17.
      Specified by:
      getRegionBitmap in interface Region
      Returns:
      The decoded Bitmap of this region.
      Throws:
      IOException - if an underlying IO operation fails
    • setParameters

      protected void setParameters(boolean isMMREncoded, long dataOffset, long dataLength, int gbh, int gbw)
      Parameters:
      isMMREncoded - the data is MMR encoded
      dataOffset - the offset
      dataLength - the length of the data
      gbh - bitmap height
      gbw - 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 encoded
      sdTemplate - sd template
      isTPGDon - is TPGDon
      useSkip - use skip
      sdATX - x values gbA pixels
      sdATY - y values gbA pixels
      symWidth - bitmap width
      hcHeight - bitmap height
      cx - context for the arithmetic decoder
      arithmeticDecoder - the arithmetic decode to be used Used by SymbolDictionary.
    • setParameters

      protected void setParameters(boolean isMMREncoded, long dataOffset, long dataLength, int gbh, int gbw, byte gbTemplate, boolean isTPGDon, boolean useSkip, short[] gbAtX, short[] gbAtY)
      Parameters:
      isMMREncoded - the data is MMR encoded
      dataOffset - the offset
      dataLength - the length of the data
      gbh - bitmap height
      gbw - bitmap width
      gbTemplate - gb template
      isTPGDon - is TPGDon
      useSkip - use skip
      gbAtX - x values of gbA pixels
      gbAtY - y values of gbA pixels
    • resetBitmap

      protected void resetBitmap()
      Simply sets the memory-critical bitmap of this region to null.
    • init

      public void init(SegmentHeader header, SubInputStream sis) throws InvalidHeaderValueException, IOException
      Description copied from interface: SegmentData
      Parse the stream and read information of header.
      Specified by:
      init in interface SegmentData
      Parameters:
      header - - The segments' header (to make referred-to segments available in data part).
      sis - - Wrapped ImageInputStream into SubInputStream.
      Throws:
      InvalidHeaderValueException - if the segment header value is invalid
      IOException - if an underlying IO operation fails
    • getRegionInfo

      public RegionSegmentInformation getRegionInfo()
      Description copied from interface: Region
      Simply returns the RegionSegmentInformation.
      Specified by:
      getRegionInfo in interface Region
      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()