diff options
author | Jane Liu <janeliulwq@google.com> | 2017-08-09 14:09:34 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-09 18:35:54 +0000 |
commit | be63ab97e0385b4024ef84fda79fc84dc111ab23 (patch) | |
tree | bd56d9e46aefc7f9617f27da624831df1abe67b0 /public | |
parent | d24b97ee1d065eff482355ea3ff82be59bb528b1 (diff) | |
download | pdfium-be63ab97e0385b4024ef84fda79fc84dc111ab23.tar.xz |
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 <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Jane Liu <janeliulwq@google.com>
Diffstat (limited to 'public')
-rw-r--r-- | public/fpdf_edit.h | 25 |
1 files changed, 25 insertions, 0 deletions
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. |