summaryrefslogtreecommitdiff
path: root/vcl/source/pdf/PDFiumLibrary.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-10-14 22:47:51 +0200
committerTomaž Vajngerl <quikee@gmail.com>2020-10-15 15:41:01 +0200
commitc43e4005e7b0f19920a3e50120298391251cf8af (patch)
tree5e5583f92c47a7db2871c602bfd1c74e576cef63 /vcl/source/pdf/PDFiumLibrary.cxx
parent1e383097aa929176bac33f46787e16d945a0a98b (diff)
pdfium: add getColor and getInteriourColor to PDFiumAnnotation
Interiour color is used as a fill color. Change-Id: If0c55fdaef083001abeb55e5c7ce3bae8d232713 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104360 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/source/pdf/PDFiumLibrary.cxx')
-rw-r--r--vcl/source/pdf/PDFiumLibrary.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx
index 074863156f97..c5d27316944f 100644
--- a/vcl/source/pdf/PDFiumLibrary.cxx
+++ b/vcl/source/pdf/PDFiumLibrary.cxx
@@ -465,6 +465,28 @@ basegfx::B2DRectangle PDFiumAnnotation::getRectangle()
return aB2DRectangle;
}
+Color PDFiumAnnotation::getColor()
+{
+ Color aColor = COL_TRANSPARENT;
+ unsigned int nR, nG, nB, nA;
+ if (FPDFAnnot_GetColor(mpAnnotation, FPDFANNOT_COLORTYPE_Color, &nR, &nG, &nB, &nA))
+ {
+ aColor = Color(0xFF - nA, nR, nG, nB);
+ }
+ return aColor;
+}
+
+Color PDFiumAnnotation::getInteriorColor()
+{
+ Color aColor = COL_TRANSPARENT;
+ unsigned int nR, nG, nB, nA;
+ if (FPDFAnnot_GetColor(mpAnnotation, FPDFANNOT_COLORTYPE_InteriorColor, &nR, &nG, &nB, &nA))
+ {
+ aColor = Color(0xFF - nA, nR, nG, nB);
+ }
+ return aColor;
+}
+
bool PDFiumAnnotation::hasKey(OString const& rKey)
{
return FPDFAnnot_HasKey(mpAnnotation, rKey.getStr());