summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/bitmapex.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-01-10 16:28:40 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-06-13 14:50:46 +0100
commite0cce521f1ad0cc384d30ce2f1077ea229fffe62 (patch)
treeae40b74bceb4b036d87b79e861f5eef76ec41102 /vcl/source/gdi/bitmapex.cxx
parent6ed3ef87d2472bad71b719e9ec927e72acfd2850 (diff)
Resolves: #i121504# Support for alpha channel in clipboard for all systems
(cherry picked from commit ef3931ff410117e1237b3bef7bc090e8b83b9519) Conflicts: automation/source/server/statemnt.cxx basic/source/runtime/methods.cxx canvas/source/vcl/devicehelper.cxx canvas/source/vcl/spritedevicehelper.cxx drawinglayer/source/processor2d/vclhelperbufferdevice.cxx drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx drawinglayer/source/tools/converters.cxx dtrans/source/win32/dtobj/FmtFilter.cxx editeng/source/items/bulitem.cxx extensions/source/scanner/sanedlg.cxx external/gcc3_specific/makefile.mk filter/source/graphicfilter/eos2met/eos2met.cxx filter/source/graphicfilter/ios2met/ios2met.cxx filter/source/msfilter/msdffimp.cxx fpicker/source/office/iodlg.cxx framework/source/fwe/classes/addonsoptions.cxx framework/source/fwe/helper/actiontriggerhelper.cxx sc/source/filter/excel/xiescher.cxx sc/source/ui/docshell/docsh.cxx sc/source/ui/inc/viewfunc.hxx sd/source/ui/app/sdxfer.cxx sd/source/ui/unoidl/unopage.cxx sd/source/ui/view/sdview3.cxx sfx2/source/appl/fileobj.cxx sfx2/source/appl/linkmgr2.cxx sfx2/source/dialog/filedlghelper.cxx sfx2/source/dialog/intro.cxx sfx2/source/doc/docinf.cxx sot/inc/sot/formats.hxx sot/source/base/formats.cxx svtools/bmpmaker/bmpcore.cxx svtools/bmpmaker/bmpsum.cxx svtools/inc/svtools/transfer.hxx svtools/source/filter/filter.cxx svtools/source/filter/wmf/emfwr.cxx svtools/source/filter/wmf/enhwmf.cxx svtools/source/filter/wmf/winwmf.cxx svtools/source/filter/wmf/wmfwr.cxx svtools/source/graphic/graphic.cxx svtools/source/graphic/provider.cxx svtools/source/misc/transfer.cxx svx/inc/svx/xoutbmp.hxx svx/source/sdr/overlay/overlaymanagerbuffered.cxx svx/source/xoutdev/_xoutbmp.cxx sw/source/core/view/viewsh.cxx sw/source/filter/ww1/w1filter.cxx sw/source/filter/ww8/ww8par.hxx sw/source/ui/dochdl/swdtflvr.cxx toolkit/source/awt/vclxbitmap.cxx toolkit/source/helper/vclunohelper.cxx vcl/Library_vcl.mk vcl/Package_inc.mk vcl/aqua/source/dtrans/DataFlavorMapping.cxx vcl/aqua/source/dtrans/OSXTransferable.cxx vcl/aqua/source/dtrans/PictToBmpFlt.cxx vcl/aqua/source/dtrans/PictToBmpFlt.hxx vcl/inc/vcl/alpha.hxx vcl/inc/vcl/bitmap.hxx vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/pngwrite.hxx vcl/inc/vcl/salbtype.hxx vcl/inc/vcl/wall.hxx vcl/source/gdi/animate.cxx vcl/source/gdi/bitmap2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/bmpconv.cxx vcl/source/gdi/cvtsvm.cxx vcl/source/gdi/impgraph.cxx vcl/source/gdi/impimagetree.cxx vcl/source/gdi/metaact.cxx vcl/source/gdi/wall.cxx Change-Id: I79938bc412c048c3d4e64f430f216e73bec16167
Diffstat (limited to 'vcl/source/gdi/bitmapex.cxx')
-rw-r--r--vcl/source/gdi/bitmapex.cxx101
1 files changed, 1 insertions, 100 deletions
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 5ac3c36c41c1..eeb68d2c101e 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -18,18 +18,17 @@
*/
#include <ctype.h>
-
#include <rtl/crc.h>
#include <rtl/strbuf.hxx>
#include <tools/stream.hxx>
#include <tools/debug.hxx>
#include <tools/rc.h>
-
#include <vcl/salbtype.hxx>
#include <vcl/outdev.hxx>
#include <vcl/alpha.hxx>
#include <vcl/bitmapex.hxx>
+#include <vcl/dibtools.hxx>
#include <vcl/pngread.hxx>
#include <vcl/svapp.hxx>
#include <vcl/bmpacc.hxx>
@@ -781,104 +780,6 @@ sal_uInt8 BitmapEx::GetTransparency(sal_Int32 nX, sal_Int32 nY) const
return nTransparency;
}
-SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx )
-{
- rBitmapEx.aBitmap.Write( rOStm );
-
- rOStm << (sal_uInt32) 0x25091962;
- rOStm << (sal_uInt32) 0xACB20201;
- rOStm << (sal_uInt8) rBitmapEx.eTransparent;
-
- if( rBitmapEx.eTransparent == TRANSPARENT_BITMAP )
- rBitmapEx.aMask.Write( rOStm );
- else if( rBitmapEx.eTransparent == TRANSPARENT_COLOR )
- rOStm << rBitmapEx.aTransparentColor;
-
- return rOStm;
-}
-
-SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx )
-{
- Bitmap aBmp;
-
- rIStm >> aBmp;
-
- if( !rIStm.GetError() )
- {
- const sal_uLong nStmPos = rIStm.Tell();
- sal_uInt32 nMagic1 = 0;
- sal_uInt32 nMagic2 = 0;
-
- rIStm >> nMagic1 >> nMagic2;
-
- if( ( nMagic1 != 0x25091962 ) || ( nMagic2 != 0xACB20201 ) || rIStm.GetError() )
- {
- rIStm.ResetError();
- rIStm.Seek( nStmPos );
- rBitmapEx = aBmp;
- }
- else
- {
- sal_uInt8 bTransparent = 0;
-
- rIStm >> bTransparent;
-
- if( bTransparent == (sal_uInt8) TRANSPARENT_BITMAP )
- {
- Bitmap aMask;
-
- rIStm >> aMask;
-
- if( !!aMask)
- {
- // fdo#59616 enforce same size for both mask and content
- if( aMask.GetSizePixel() != aBmp.GetSizePixel() )
- {
- Bitmap aNewMask;
- const Size aNominalSize=aBmp.GetSizePixel();
- BitmapReadAccess aAcc(aMask);
- if( aAcc.HasPalette() )
- aNewMask = Bitmap(aNominalSize,
- aMask.GetBitCount(),
- &aAcc.GetPalette());
- else
- aNewMask = Bitmap(aNominalSize,
- aMask.GetBitCount());
- const Rectangle aCopyArea(Point(0,0), aNominalSize);
- aNewMask.CopyPixel(aCopyArea, aCopyArea, &aMask);
- aMask = aNewMask;
- }
-
- // do we have an alpha mask?
- if( ( 8 == aMask.GetBitCount() ) && aMask.HasGreyPalette() )
- {
- AlphaMask aAlpha;
-
- // create alpha mask quickly (without greyscale conversion)
- aAlpha.ImplSetBitmap( aMask );
- rBitmapEx = BitmapEx( aBmp, aAlpha );
- }
- else
- rBitmapEx = BitmapEx( aBmp, aMask );
- }
- else
- rBitmapEx = aBmp;
- }
- else if( bTransparent == (sal_uInt8) TRANSPARENT_COLOR )
- {
- Color aTransparentColor;
-
- rIStm >> aTransparentColor;
- rBitmapEx = BitmapEx( aBmp, aTransparentColor );
- }
- else
- rBitmapEx = aBmp;
- }
- }
-
- return rIStm;
-}
-
// Shift alpha transparent pixels between cppcanvas/ implementations
// and vcl in a generally grotesque and under-performing fashion
bool BitmapEx::Create( const ::com::sun::star::uno::Reference<