summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-12-02 09:08:49 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-12-02 10:14:27 +0100
commitd8fe51f9a4d1669578c162d87a6e65125096d720 (patch)
tree108dba7e03750313851dcbb771ec94178b7d35c5 /svx
parentea9863c0104bfa74e7542f850768c2c0ee63a577 (diff)
pdfium: add width/height/format wrappers for bitmap
Change-Id: Ic8c85c4224b89d1e7bb8ded1a11c5fd8139f5701 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107044 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdpdf.cxx21
1 files changed, 10 insertions, 11 deletions
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx
index 47ea46c62801..6f2f1de42f72 100644
--- a/svx/source/svdraw/svdpdf.cxx
+++ b/svx/source/svdraw/svdpdf.cxx
@@ -883,35 +883,34 @@ void ImpSdrPdfImport::ImportImage(std::unique_ptr<vcl::pdf::PDFiumPageObject> co
return;
}
- const int format = FPDFBitmap_GetFormat(bitmap->getPointer());
- if (format == FPDFBitmap_Unknown)
+ const vcl::pdf::PDFBitmapType format = bitmap->getFormat();
+ if (format == vcl::pdf::PDFBitmapType::Unknown)
{
SAL_WARN("sd.filter", "Failed to get IMAGE format");
return;
}
- const unsigned char* pBuf
- = static_cast<const unsigned char*>(FPDFBitmap_GetBuffer(bitmap->getPointer()));
- const int nWidth = FPDFBitmap_GetWidth(bitmap->getPointer());
- const int nHeight = FPDFBitmap_GetHeight(bitmap->getPointer());
- const int nStride = FPDFBitmap_GetStride(bitmap->getPointer());
+ const unsigned char* pBuf = bitmap->getBuffer();
+ const int nWidth = bitmap->getWidth();
+ const int nHeight = bitmap->getHeight();
+ const int nStride = bitmap->getStride();
BitmapEx aBitmap(Size(nWidth, nHeight), 24);
switch (format)
{
- case FPDFBitmap_BGR:
+ case vcl::pdf::PDFBitmapType::BGR:
ReadRawDIB(aBitmap, pBuf, ScanlineFormat::N24BitTcBgr, nHeight, nStride);
break;
- case FPDFBitmap_BGRx:
+ case vcl::pdf::PDFBitmapType::BGRx:
ReadRawDIB(aBitmap, pBuf, ScanlineFormat::N32BitTcRgba, nHeight, nStride);
break;
- case FPDFBitmap_BGRA:
+ case vcl::pdf::PDFBitmapType::BGRA:
ReadRawDIB(aBitmap, pBuf, ScanlineFormat::N32BitTcBgra, nHeight, nStride);
break;
default:
SAL_WARN("sd.filter", "Got IMAGE width: " << nWidth << ", height: " << nHeight
<< ", stride: " << nStride
- << ", format: " << format);
+ << ", format: " << static_cast<int>(format));
break;
}