THPDFJpegReducedDecoder
Decodes an encoded JPEG region straight into an exact low-resolution BGR24 bitmap
Declaration
function LoadFromBytes(const Data: THPDFJpegByteArray;
const Region: TRect; TargetWidth, TargetHeight: Integer;
MaxOutputBytes: Int64 = 268435456): Boolean;
function Decode: THPDFJpegReducedDecodeStatus;
Usage
Decoder := THPDFJpegReducedDecoder.Create;
try
if Decoder.LoadFromBytes(Data, Rect(0, 0, 12000, 12000), 300, 300) and
(Decoder.Decode = jrdsCompleted) then
begin
Bitmap.Assign(Decoder.Bitmap);
Info := Decoder.Info;
end;
finally
Decoder.Free;
end;
Ownership and limits
- The decoder copies encoded input and owns the bitmap exposed by
Bitmap - The returned bitmap remains valid until the decoder is loaded again or destroyed
MaxOutputBytesbounds the target bitmap and zero disables that explicit limitOnCancellationCheckis invoked from the scanline loopInfoexposes decoder-reported scaled geometry and working-memory estimates
Related APIs
THPDFJpegReducedDecodeInfo · THPDFJpegReducedDecodeStatus · Reduced-DCT JPEG Decoding