From 28fb7ba083dba5e09493fd37a11994de51527dfc Mon Sep 17 00:00:00 2001 From: Jane Liu Date: Wed, 2 Aug 2017 21:45:57 -0400 Subject: APIs and tests for extracting bitmaps from image objects Added FPDFImageObj_GetBitmap() that returns the bitmap of an image object, and a FPDFBitmap_GetFormat() that returns the format of a bitmap. * Fixed a small bitmap conversion bug in cfx_dibsource.cpp. * Enabled EmbedderTest::CompareBitmap() to support different formats of bitmaps. * Added an embedder test and a test PDF file with images of many different formats. Bug=pdfium:677 Change-Id: I6a72f9d969cf5f3577db9400ca33197c213622ed Reviewed-on: https://pdfium-review.googlesource.com/9690 Reviewed-by: Lei Zhang Commit-Queue: Jane Liu --- public/fpdf_edit.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'public/fpdf_edit.h') diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h index cfed93172f..e5607d1716 100644 --- a/public/fpdf_edit.h +++ b/public/fpdf_edit.h @@ -288,6 +288,16 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages, FPDF_PAGEOBJECT image_object, FPDF_BITMAP bitmap); +// Get a bitmap rasterisation of |image_object|. The returned bitmap will be +// owned by the caller, and FPDFBitmap_Destroy() must be called on the returned +// bitmap when it is no longer needed. +// +// image_object - handle to an image object. +// +// Returns the bitmap. +DLLEXPORT FPDF_BITMAP STDCALL +FPDFImageObj_GetBitmap(FPDF_PAGEOBJECT image_object); + // Create a new path object at an initial position. // // x - initial horizontal position. -- cgit v1.2.3