เมธอด THotPDF.DecodeLoadedImageStreamCached
decode loaded image ทั้งภาพผ่าน bounded cache ของ renderer และ per-key singleflight coordinator
การประกาศ
function DecodeLoadedImageStreamCached(
AImageStream: THPDFStreamObject): TBitmap;
พารามิเตอร์
AImageStream คือ loaded image stream ที่เอกสารปัจจุบันเป็นเจ้าของ
ค่าที่ส่งกลับ
ส่งคืน TBitmap ที่จัดสรรใหม่ซึ่งผู้เรียกเป็นเจ้าของ หรือ nil เมื่อถอดรหัส stream ไม่ได้
การทำงานพร้อมกัน
image keys ที่ต่างกัน decode พร้อมกันได้ ส่วน key ที่ซ้ำกันจะใช้การ decode ของ owner ตัวเดียวร่วมกัน
ทางเลือกแบบไม่ต้องคัดลอก
ใช้ AcquireLoadedImageStream เมื่อ caller เก็บ immutable handle ไว้ต่อได้ หรือวาดลง canvas ตรง ๆ ได้โดยไม่ต้องมีสำเนา bitmap ที่แก้ไขได้
API ที่เกี่ยวข้อง
Sharded Loaded-Image Decode Cache · GetImageDecodeConcurrencyInfo