IHPDFDecodedBitmapHandle Interface
提供对已解码图像存储的不可变、引用计数访问,该存储由已加载图像缓存、singleflight 等待者和渲染器共享
声明
IHPDFDecodedBitmapHandle = interface
function GetWidth: Integer;
function GetHeight: Integer;
function GetPixelFormat: TPixelFormat;
function GetByteSize: Int64;
function CreateBitmapCopy: TBitmap;
procedure StretchDraw(DestinationDC: HDC;
const Destination: TRect; StretchMode: Integer);
end;
Ownership
该接口使已解码存储的生命周期独立于缓存淘汰、缓存失效和文档销毁
引用计数是线程安全的,共享的可变 TBitmap 绝不会暴露给调用方
Drawing and copies
StretchDraw 直接从不可变的共享存储绘制,无需物化一个由调用方持有的位图,并对底层 GDI 资源的访问做串行化
CreateBitmapCopy 返回一个由调用方持有的独立 TBitmap,供需要可变像素的 API 使用
相关 API
THotPDF.AcquireLoadedImageStream · THotPDF.AcquireLoadedImageRegionAtResolution · 分片加载图像解码缓存