summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/dibtools.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2016-01-22 11:39:41 +0100
committerArmin Le Grand <Armin.Le.Grand@cib.de>2016-01-29 12:02:11 +0000
commit6f12c93703b676b1b3839caaf2c21788e5d68477 (patch)
treeb62b26ed86f6e656ca66d85e828abd2475f03bc0 /vcl/source/gdi/dibtools.cxx
parent1d0f08cdf1b9396e97e068f97fd78f31b5906748 (diff)
tdf#91017 Enhance WMF import of EMR_ALPHABLEND action
The EMR_ALPHABLEND action was added 2012/2013, but missed support for Bitmaps with Mask/Alpha. Due to that files with WMF containing these actions may look different from before. Added suport to load contained Mask/Alpha information in DIBs and the needed additional processing through the display chain. WMF import is still based on Metafile creation, when it would be using Primitives more original data could be preserved. Change-Id: I577569848cee2528328181fa0c7eb7f87857d094 Reviewed-on: https://gerrit.libreoffice.org/21709 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'vcl/source/gdi/dibtools.cxx')
-rw-r--r--vcl/source/gdi/dibtools.cxx22
1 files changed, 16 insertions, 6 deletions
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index a788c522cc65..afb0a64bfd2a 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -737,7 +737,7 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r
return( rIStm.GetError() == 0UL );
}
-bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, Bitmap* pBmpAlpha, sal_uLong nOffset, bool bMSOFormat = false )
+bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, AlphaMask* pBmpAlpha, sal_uLong nOffset, bool bMSOFormat = false )
{
DIBV5Header aHeader;
const sal_uLong nStmPos = rIStm.Tell();
@@ -869,7 +869,7 @@ bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, Bitmap* pBmpAlpha, sal_uLon
Bitmap::ReleaseAccess(pAcc);
return false;
}
- Bitmap aNewBmpAlpha;
+ AlphaMask aNewBmpAlpha;
BitmapWriteAccess* pAccAlpha = nullptr;
bool bAlphaPossible(pBmpAlpha && aHeader.nBitCount == 32);
@@ -891,7 +891,7 @@ bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, Bitmap* pBmpAlpha, sal_uLon
if (bAlphaPossible)
{
- aNewBmpAlpha = Bitmap(aSizePixel, 8);
+ aNewBmpAlpha = AlphaMask(aSizePixel);
pAccAlpha = aNewBmpAlpha.AcquireWriteAccess();
}
@@ -1523,8 +1523,8 @@ bool ImplWriteDIBFileHeader(SvStream& rOStm, BitmapReadAccess& rAcc, bool bUseDI
}
bool ImplReadDIB(
- Bitmap& rTarget, Bitmap*
- pTargetAlpha,
+ Bitmap& rTarget,
+ AlphaMask* pTargetAlpha,
SvStream& rIStm,
bool bFileHeader,
bool bMSOFormat=false)
@@ -1726,7 +1726,7 @@ bool ReadDIBBitmapEx(
bool ReadDIBV5(
Bitmap& rTarget,
- Bitmap& rTargetAlpha,
+ AlphaMask& rTargetAlpha,
SvStream& rIStm)
{
return ImplReadDIB(rTarget, &rTargetAlpha, rIStm, true);
@@ -1765,4 +1765,14 @@ bool WriteDIBBitmapEx(
return false;
}
+sal_uInt32 getDIBInfoHeaderSize()
+{
+ return DIBINFOHEADERSIZE;
+}
+
+sal_uInt32 getDIBV5HeaderSize()
+{
+ return DIBV5HEADERSIZE;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */