From 548334e57cae1039824d3db97bab5348fbe674e2 Mon Sep 17 00:00:00 2001 From: Jane Liu Date: Thu, 3 Aug 2017 16:33:40 -0400 Subject: APIs and tests for retrieving raw/decoded data from image objects Added FPDFImageObj_GetImageDataDecoded() for retrieving the uncompressed data of an image, and FPDFImageObj_GetImageDataRaw() for retrieving the raw data of an image. * Refactored out DecodeStreamMaybeCopyAndReturnLength(), which is used to decode both attachment data and image data. * Within DecodeStreamMaybeCopyAndReturnLength(), used a different decoder function which takes care of multiple filters if exist. As a result, CPDF_StreamParser::DecodeInlineStream() which was made static previously is now moved back into namespace. Bug=pdfium:677 Change-Id: I22a22c99acaca98ef8c15f88911f2646a2c854d5 Reviewed-on: https://pdfium-review.googlesource.com/9811 Commit-Queue: Jane Liu Reviewed-by: Lei Zhang --- fpdfsdk/fsdk_define.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fpdfsdk/fsdk_define.h') diff --git a/fpdfsdk/fsdk_define.h b/fpdfsdk/fsdk_define.h index 610b854a9d..91efc27f1a 100644 --- a/fpdfsdk/fsdk_define.h +++ b/fpdfsdk/fsdk_define.h @@ -26,6 +26,7 @@ class CPDF_Page; class CPDF_PageObject; class CPDF_PageRenderContext; class CPDF_PathObject; +class CPDF_Stream; class IFSDK_PAUSE_Adapter; // Layering prevents fxcrt from knowing about FPDF_FILEACCESS, so this can't @@ -77,6 +78,10 @@ unsigned long Utf16EncodeMaybeCopyAndReturnLength(const CFX_WideString& text, void* buffer, unsigned long buflen); +unsigned long DecodeStreamMaybeCopyAndReturnLength(const CPDF_Stream* stream, + void* buffer, + unsigned long buflen); + void FSDK_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable); FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy); void FPDF_RenderPage_Retail(CPDF_PageRenderContext* pContext, -- cgit v1.2.3