From be63ab97e0385b4024ef84fda79fc84dc111ab23 Mon Sep 17 00:00:00 2001 From: Jane Liu Date: Wed, 9 Aug 2017 14:09:34 -0400 Subject: API and test for retrieving image filters from image objects Added FPDFImageObj_GetImageFilterCount() and FPDFImageObj_GetImageFilters() for retrieving image filters of image objects. * Added a corresponding embedder test. * Changed the filter of an image object in embedded_image.pdf from DCTDecode to ASCIIHexDecode + DCTDecode, so we have a test case for images with more than one filter. Bug=pdfium:677 Change-Id: I398790a2cad33fea4ca16a0eb0889c04caa6b962 Reviewed-on: https://pdfium-review.googlesource.com/10130 Reviewed-by: Lei Zhang Reviewed-by: dsinclair Commit-Queue: Jane Liu --- public/fpdf_edit.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'public') diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h index aab48af3f1..54127d80ea 100644 --- a/public/fpdf_edit.h +++ b/public/fpdf_edit.h @@ -336,6 +336,31 @@ FPDFImageObj_GetImageDataRaw(FPDF_PAGEOBJECT image_object, void* buffer, unsigned long buflen); +// Get the number of filters (i.e. decoders) of the image in |image_object|. +// +// image_object - handle to an image object. +// +// Returns the number of |image_object|'s filters. +DLLEXPORT int STDCALL +FPDFImageObj_GetImageFilterCount(FPDF_PAGEOBJECT image_object); + +// Get the filter at |index| of |image_object|'s list of filters. Note that the +// filters need to be applied in order, i.e. the first filter should be applied +// first, then the second, etc. |buffer| is only modified if |buflen| is longer +// than the length of the filter string. +// +// image_object - handle to an image object. +// index - the index of the filter requested. +// buffer - buffer for holding filter string, encoded in UTF16-LE. +// buflen - length of the buffer. +// +// Returns the length of the filter string. +DLLEXPORT unsigned long STDCALL +FPDFImageObj_GetImageFilter(FPDF_PAGEOBJECT image_object, + int index, + void* buffer, + unsigned long buflen); + // Create a new path object at an initial position. // // x - initial horizontal position. -- cgit v1.2.3