From df1298a228abb59eb167d0be43d46a50c0333497 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Tue, 8 May 2018 22:22:41 +0000 Subject: Add several FPDFPageObj_* APIs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL adds the following APIs: FPDFPageObj_SetStrokeColor FPDFPageObj_GetStrokeColor FPDFPageObj_SetStrokeWidth FPDFPageObj_SetLineJoin FPDFPageObj_SetLineCap FPDFPageObj_SetFillColor FPDFPageObj_GetFillColor Bug: pdfium:980 Change-Id: I19f9abb6756314ba8bd2f66a6c38e2e722cd8473 Reviewed-on: https://pdfium-review.googlesource.com/32192 Reviewed-by: Lei Zhang Commit-Queue: Nicolás Peña Moreno --- public/fpdf_edit.h | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) (limited to 'public') diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h index 74c2700733..c0766a33b8 100644 --- a/public/fpdf_edit.h +++ b/public/fpdf_edit.h @@ -612,6 +612,22 @@ FPDFPath_SetStrokeColor(FPDF_PAGEOBJECT path, unsigned int B, unsigned int A); +// Set the stroke RGBA of a page object. Range of values: 0 - 255. +// +// page_object - the handle to the page object. +// R - the red component for the object's stroke color. +// G - the green component for the object's stroke color. +// B - the blue component for the object's stroke color. +// A - the stroke alpha for the object. +// +// Returns TRUE on success. +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPageObj_SetStrokeColor(FPDF_PAGEOBJECT page_object, + unsigned int R, + unsigned int G, + unsigned int B, + unsigned int A); + // Get the stroke RGBA of a path. Range of values: 0 - 255. // // path - the handle to the path object. @@ -628,6 +644,22 @@ FPDFPath_GetStrokeColor(FPDF_PAGEOBJECT path, unsigned int* B, unsigned int* A); +// Get the stroke RGBA of a page object. Range of values: 0 - 255. +// +// page_object - the handle to the page object. +// R - the red component of the path stroke color. +// G - the green component of the object's stroke color. +// B - the blue component of the object's stroke color. +// A - the stroke alpha of the object. +// +// Returns TRUE on success. +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPageObj_GetStrokeColor(FPDF_PAGEOBJECT page_object, + unsigned int* R, + unsigned int* G, + unsigned int* B, + unsigned int* A); + // Set the stroke width of a path. // // path - the handle to the path object. @@ -637,6 +669,15 @@ FPDFPath_GetStrokeColor(FPDF_PAGEOBJECT path, FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_SetStrokeWidth(FPDF_PAGEOBJECT path, float width); +// Set the stroke width of a page object. +// +// path - the handle to the page object. +// width - the width of the stroke. +// +// Returns TRUE on success +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPageObj_SetStrokeWidth(FPDF_PAGEOBJECT page_object, float width); + // Set the line join of |page_object|. // // page_object - handle to a page object. @@ -647,6 +688,16 @@ FPDFPath_SetStrokeWidth(FPDF_PAGEOBJECT path, float width); FPDF_EXPORT void FPDF_CALLCONV FPDFPath_SetLineJoin(FPDF_PAGEOBJECT page_object, int line_join); +// Set the line join of |page_object|. +// +// page_object - handle to a page object. +// line_join - line join +// +// Line join can be one of following: FPDF_LINEJOIN_MITER, FPDF_LINEJOIN_ROUND, +// FPDF_LINEJOIN_BEVEL +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPageObj_SetLineJoin(FPDF_PAGEOBJECT page_object, int line_join); + // Set the line cap of |page_object|. // // page_object - handle to a page object. @@ -657,6 +708,16 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFPath_SetLineJoin(FPDF_PAGEOBJECT page_object, FPDF_EXPORT void FPDF_CALLCONV FPDFPath_SetLineCap(FPDF_PAGEOBJECT page_object, int line_cap); +// Set the line cap of |page_object|. +// +// page_object - handle to a page object. +// line_cap - line cap +// +// Line cap can be one of following: FPDF_LINECAP_BUTT, FPDF_LINECAP_ROUND, +// FPDF_LINECAP_PROJECTING_SQUARE +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPageObj_SetLineCap(FPDF_PAGEOBJECT page_object, int line_cap); + // Set the fill RGBA of a path. Range of values: 0 - 255. // // path - the handle to the path object. @@ -672,6 +733,22 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_SetFillColor(FPDF_PAGEOBJECT path, unsigned int B, unsigned int A); +// Set the fill RGBA of a page object. Range of values: 0 - 255. +// +// page_object - the handle to the page object. +// R - the red component for the object's fill color. +// G - the green component for the object's fill color. +// B - the blue component for the object's fill color. +// A - the fill alpha for the object. +// +// Returns TRUE on success. +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPageObj_SetFillColor(FPDF_PAGEOBJECT page_object, + unsigned int R, + unsigned int G, + unsigned int B, + unsigned int A); + // Get the fill RGBA of a path. Range of values: 0 - 255. // // path - the handle to the path object. @@ -687,6 +764,22 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_GetFillColor(FPDF_PAGEOBJECT path, unsigned int* B, unsigned int* A); +// Get the fill RGBA of a page object. Range of values: 0 - 255. +// +// page_object - the handle to the page object. +// R - the red component of the object's fill color. +// G - the green component of the object's fill color. +// B - the blue component of the object's fill color. +// A - the fill alpha of the object. +// +// Returns TRUE on success. +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPageObj_GetFillColor(FPDF_PAGEOBJECT page_object, + unsigned int* R, + unsigned int* G, + unsigned int* B, + unsigned int* A); + // Experimental API. // Get number of segments inside |path|. // -- cgit v1.2.3