THPDFJBIG2Decoder Class

THPDFJBIG2Decoder = class
  constructor Create;
  function LoadFromByteArray(ImageData, GlobalData: TJBIG2ByteArray): Boolean; overload;
  function LoadFromByteArray(ImageData: TJBIG2ByteArray): Boolean; overload;
  function LoadRegionFromByteArray(ImageData, GlobalData: TJBIG2ByteArray;
    RegionLeft, RegionTop, RegionWidth, RegionHeight: Integer): Boolean; overload;
  function LoadRegionFromByteArray(ImageData: TJBIG2ByteArray;
    RegionLeft, RegionTop, RegionWidth, RegionHeight: Integer): Boolean; overload;
  function GetScanline(Row: Integer; var Data: TJBIG2ByteArray): Boolean;
  property Width: Integer read FWidth;
  property Height: Integer read FHeight;
  property ScanlineByteWidth: Integer read FScanlineByteWidth;
  property LastRegionDecodeStats: TJBIG2RegionDecodeStats read FLastRegionDecodeStats;
  property UsedIncrementalRegionDecode: Boolean read FUsedIncrementalRegionDecode;
  property LastSegmentGraphValidationInfo: TJBIG2SegmentGraphValidationInfo
    read FLastSegmentGraphValidationInfo;
end;

解碼 JBIG2 影像資料,可選擇搭配共用的全域資料,並以整頁點陣圖或有上限的區域視窗呈現結果

LoadFromByteArray 解碼完整頁面,而 LoadRegionFromByteArray 只解碼要求的矩形範圍,並透過 UsedIncrementalRegionDecode 回報是否走了增量路徑

GetScanline 逐列傳回解碼後的掃描線位元組;LastRegionDecodeStats 與 LastSegmentGraphValidationInfo 則公開每次呼叫的統計與 segment graph 檢查結果

JBIG2 壓縮支援