[Libreoffice-commits] core.git: include/vcl vcl/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Fri Nov 6 07:17:58 UTC 2020
include/vcl/filter/PDFiumLibrary.hxx | 3 +++
vcl/source/filter/ipdf/pdfread.cxx | 5 ++---
vcl/source/pdf/PDFiumLibrary.cxx | 7 +++++++
3 files changed, 12 insertions(+), 3 deletions(-)
New commits:
commit 6e921467c411718793422a43fb3e3060fdeaeda9
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Nov 5 21:05:13 2020 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Nov 6 08:17:24 2020 +0100
pdfium: add FPDFBitmap_GetBuffer/Stride wrappers
Change-Id: I7013e0870868017f72a8053bfe53491504f811e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105379
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx
index 84cfccae2aa2..eb5cf3b9c769 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -26,6 +26,7 @@
#include <tools/color.hxx>
#include <tools/gen.hxx>
#include <vcl/checksum.hxx>
+#include <vcl/Scanline.hxx>
#include <vcl/pdf/PDFAnnotationSubType.hxx>
#include <fpdf_doc.h>
@@ -78,6 +79,8 @@ public:
FPDF_BITMAP getPointer() { return mpBitmap; }
void fillRect(int left, int top, int width, int height, sal_uInt32 nColor);
void renderPageBitmap(PDFiumPage* pPage, int nStartX, int nStartY, int nSizeX, int nSizeY);
+ ConstScanline getBuffer();
+ int getStride();
};
class VCL_DLLPUBLIC PDFiumAnnotation final
diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx
index c027acb38777..a36eacbfd41a 100644
--- a/vcl/source/filter/ipdf/pdfread.cxx
+++ b/vcl/source/filter/ipdf/pdfread.cxx
@@ -189,9 +189,8 @@ size_t RenderPDFBitmaps(const void* pBuffer, int nSize, std::vector<BitmapEx>& r
{
BitmapScopedWriteAccess pWriteAccess(aBitmap);
AlphaScopedWriteAccess pMaskAccess(aMask);
- const auto pPdfBuffer
- = static_cast<ConstScanline>(FPDFBitmap_GetBuffer(pPdfBitmap->getPointer()));
- const int nStride = FPDFBitmap_GetStride(pPdfBitmap->getPointer());
+ ConstScanline pPdfBuffer = pPdfBitmap->getBuffer();
+ const int nStride = pPdfBitmap->getStride();
std::vector<sal_uInt8> aScanlineAlpha(nPageWidth);
for (size_t nRow = 0; nRow < nPageHeight; ++nRow)
{
diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx
index c3deee13d889..69facd1bf001 100644
--- a/vcl/source/pdf/PDFiumLibrary.cxx
+++ b/vcl/source/pdf/PDFiumLibrary.cxx
@@ -510,6 +510,13 @@ void PDFiumBitmap::renderPageBitmap(PDFiumPage* pPage, int nStartX, int nStartY,
/*rotate=*/0, /*flags=*/0);
}
+ConstScanline PDFiumBitmap::getBuffer()
+{
+ return static_cast<ConstScanline>(FPDFBitmap_GetBuffer(mpBitmap));
+}
+
+int PDFiumBitmap::getStride() { return FPDFBitmap_GetStride(mpBitmap); }
+
PDFiumAnnotation::PDFiumAnnotation(FPDF_ANNOTATION pAnnotation)
: mpAnnotation(pAnnotation)
{
More information about the Libreoffice-commits
mailing list