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 逐行返回已解码的 scanline 字节,LastRegionDecodeStats 加上 LastSegmentGraphValidationInfo 则暴露每次调用的统计信息和 segment 图检查结果