summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/BitmapExTest.cxx4
-rw-r--r--vcl/qa/cppunit/canvasbitmaptest.cxx4
-rw-r--r--vcl/qa/cppunit/skia/skia.cxx27
-rw-r--r--vcl/source/bitmap/BitmapEx.cxx8
-rw-r--r--vcl/source/bitmap/alpha.cxx63
-rw-r--r--vcl/source/bitmap/bitmap.cxx8
-rw-r--r--vcl/source/bitmap/bitmappaint.cxx14
-rw-r--r--vcl/source/bitmap/dibtools.cxx2
-rw-r--r--vcl/source/filter/jpeg/JpegReader.cxx2
-rw-r--r--vcl/source/filter/png/PngImageWriter.cxx4
-rw-r--r--vcl/source/filter/wmf/emfwr.cxx6
-rw-r--r--vcl/source/filter/wmf/wmfwr.cxx4
-rw-r--r--vcl/source/gdi/FileDefinitionWidgetDraw.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx4
-rw-r--r--vcl/source/graphic/UnoGraphic.cxx2
-rw-r--r--vcl/source/outdev/background.cxx2
-rw-r--r--vcl/source/outdev/bitmap.cxx4
-rw-r--r--vcl/source/outdev/bitmapex.cxx12
-rw-r--r--vcl/workben/vcldemo.cxx2
19 files changed, 87 insertions, 87 deletions
diff --git a/vcl/qa/cppunit/BitmapExTest.cxx b/vcl/qa/cppunit/BitmapExTest.cxx
index 757cc8999538..8313de37fc60 100644
--- a/vcl/qa/cppunit/BitmapExTest.cxx
+++ b/vcl/qa/cppunit/BitmapExTest.cxx
@@ -205,7 +205,7 @@ void BitmapExTest::testCombineMaskOr()
}
AlphaMask aAlphaBitmap(Size(3, 3));
{
- BitmapScopedWriteAccess pWriteAccess(aAlphaBitmap);
+ AlphaMask::ScopedWriteAccess pWriteAccess(aAlphaBitmap);
pWriteAccess->Erase(Color(0xff, 0xff, 0xff));
for (int i = 1; i < 3; ++i)
{
@@ -217,7 +217,7 @@ void BitmapExTest::testCombineMaskOr()
{
AlphaMask aMask = aBitmap.CreateAlphaMask(COL_RED, 1);
- Bitmap::ScopedReadAccess pAccess(aMask);
+ AlphaMask::ScopedReadAccess pAccess(aMask);
// the output is a greyscale palette bitmap
CPPUNIT_ASSERT_EQUAL(sal_uInt8(0xff), pAccess->GetPixelIndex(0, 0));
CPPUNIT_ASSERT_EQUAL(sal_uInt8(0xff), pAccess->GetPixelIndex(0, 1));
diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx
index 5aba5982427e..d2a62ad8bfce 100644
--- a/vcl/qa/cppunit/canvasbitmaptest.cxx
+++ b/vcl/qa/cppunit/canvasbitmaptest.cxx
@@ -675,7 +675,7 @@ void CanvasBitmapTest::runTest()
AlphaMask aMask(Size(200,200));
aMask.Erase(255);
{
- BitmapScopedWriteAccess pAcc(aMask);
+ AlphaMask::ScopedWriteAccess pAcc(aMask);
if( pAcc.get() )
{
pAcc->SetFillColor(COL_ALPHA_OPAQUE);
@@ -693,7 +693,7 @@ void CanvasBitmapTest::runTest()
AlphaMask aAlpha(Size(200,200));
aAlpha.Erase(0);
{
- BitmapWriteAccess* pAcc = aAlpha.AcquireWriteAccess();
+ BitmapWriteAccess* pAcc = aAlpha.AcquireAlphaWriteAccess();
if( pAcc )
{
pAcc->SetFillColor(COL_ALPHA_OPAQUE);
diff --git a/vcl/qa/cppunit/skia/skia.cxx b/vcl/qa/cppunit/skia/skia.cxx
index b90b915e17ea..0caa1922280e 100644
--- a/vcl/qa/cppunit/skia/skia.cxx
+++ b/vcl/qa/cppunit/skia/skia.cxx
@@ -126,7 +126,8 @@ void SkiaTest::testDrawShaders()
CPPUNIT_ASSERT(skiaBitmap->PreferSkShader());
AlphaMask alpha(Size(10, 10));
alpha.Erase(64);
- SkiaSalBitmap* skiaAlpha = dynamic_cast<SkiaSalBitmap*>(alpha.ImplGetSalBitmap().get());
+ SkiaSalBitmap* skiaAlpha
+ = dynamic_cast<SkiaSalBitmap*>(alpha.GetBitmap().ImplGetSalBitmap().get());
CPPUNIT_ASSERT(skiaAlpha->PreferSkShader());
device->DrawBitmap(Point(5, 5), bitmap);
@@ -235,13 +236,15 @@ void SkiaTest::testAlphaBlendWith()
AlphaMask bitmap(Size(10, 10));
// Test with erase colors set.
alpha.Erase(64);
- SkiaSalBitmap* skiaAlpha = dynamic_cast<SkiaSalBitmap*>(alpha.ImplGetSalBitmap().get());
+ SkiaSalBitmap* skiaAlpha
+ = dynamic_cast<SkiaSalBitmap*>(alpha.GetBitmap().ImplGetSalBitmap().get());
CPPUNIT_ASSERT(skiaAlpha->unittestHasEraseColor());
bitmap.Erase(64);
- SkiaSalBitmap* skiaBitmap = dynamic_cast<SkiaSalBitmap*>(bitmap.ImplGetSalBitmap().get());
+ SkiaSalBitmap* skiaBitmap
+ = dynamic_cast<SkiaSalBitmap*>(bitmap.GetBitmap().ImplGetSalBitmap().get());
CPPUNIT_ASSERT(skiaBitmap->unittestHasEraseColor());
alpha.BlendWith(bitmap);
- skiaAlpha = dynamic_cast<SkiaSalBitmap*>(alpha.ImplGetSalBitmap().get());
+ skiaAlpha = dynamic_cast<SkiaSalBitmap*>(alpha.GetBitmap().ImplGetSalBitmap().get());
CPPUNIT_ASSERT(skiaAlpha->unittestHasEraseColor());
CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N8_BPP, alpha.getPixelFormat());
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(208),
@@ -250,18 +253,18 @@ void SkiaTest::testAlphaBlendWith()
// Test with images set.
alpha.Erase(64);
AlphaMask::ScopedReadAccess(alpha)->GetColor(0, 0); // Reading a pixel will create pixel data.
- skiaAlpha = dynamic_cast<SkiaSalBitmap*>(alpha.ImplGetSalBitmap().get());
+ skiaAlpha = dynamic_cast<SkiaSalBitmap*>(alpha.GetBitmap().ImplGetSalBitmap().get());
skiaAlpha->GetSkImage();
CPPUNIT_ASSERT(!skiaAlpha->unittestHasEraseColor());
CPPUNIT_ASSERT(skiaAlpha->unittestHasImage());
bitmap.Erase(64);
- Bitmap::ScopedReadAccess(bitmap)->GetColor(0, 0); // Reading a pixel will create pixel data.
- skiaBitmap = dynamic_cast<SkiaSalBitmap*>(bitmap.ImplGetSalBitmap().get());
+ AlphaMask::ScopedReadAccess(bitmap)->GetColor(0, 0); // Reading a pixel will create pixel data.
+ skiaBitmap = dynamic_cast<SkiaSalBitmap*>(bitmap.GetBitmap().ImplGetSalBitmap().get());
skiaBitmap->GetSkImage();
CPPUNIT_ASSERT(!skiaBitmap->unittestHasEraseColor());
CPPUNIT_ASSERT(skiaBitmap->unittestHasImage());
alpha.BlendWith(bitmap);
- skiaAlpha = dynamic_cast<SkiaSalBitmap*>(alpha.ImplGetSalBitmap().get());
+ skiaAlpha = dynamic_cast<SkiaSalBitmap*>(alpha.GetBitmap().ImplGetSalBitmap().get());
CPPUNIT_ASSERT(skiaAlpha->unittestHasImage());
CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N8_BPP, alpha.getPixelFormat());
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(207),
@@ -269,16 +272,16 @@ void SkiaTest::testAlphaBlendWith()
// Test with erase color for alpha and image for other bitmap.
alpha.Erase(64);
- skiaAlpha = dynamic_cast<SkiaSalBitmap*>(alpha.ImplGetSalBitmap().get());
+ skiaAlpha = dynamic_cast<SkiaSalBitmap*>(alpha.GetBitmap().ImplGetSalBitmap().get());
CPPUNIT_ASSERT(skiaAlpha->unittestHasEraseColor());
bitmap.Erase(64);
- Bitmap::ScopedReadAccess(bitmap)->GetColor(0, 0); // Reading a pixel will create pixel data.
- skiaBitmap = dynamic_cast<SkiaSalBitmap*>(bitmap.ImplGetSalBitmap().get());
+ AlphaMask::ScopedReadAccess(bitmap)->GetColor(0, 0); // Reading a pixel will create pixel data.
+ skiaBitmap = dynamic_cast<SkiaSalBitmap*>(bitmap.GetBitmap().ImplGetSalBitmap().get());
skiaBitmap->GetSkImage();
CPPUNIT_ASSERT(!skiaBitmap->unittestHasEraseColor());
CPPUNIT_ASSERT(skiaBitmap->unittestHasImage());
alpha.BlendWith(bitmap);
- skiaAlpha = dynamic_cast<SkiaSalBitmap*>(alpha.ImplGetSalBitmap().get());
+ skiaAlpha = dynamic_cast<SkiaSalBitmap*>(alpha.GetBitmap().ImplGetSalBitmap().get());
CPPUNIT_ASSERT(skiaAlpha->unittestHasImage());
CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N8_BPP, alpha.getPixelFormat());
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(207),
diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx
index 11f35c219ddb..b4d48b0dfc0d 100644
--- a/vcl/source/bitmap/BitmapEx.cxx
+++ b/vcl/source/bitmap/BitmapEx.cxx
@@ -578,9 +578,7 @@ sal_uInt8 BitmapEx::GetAlpha(sal_Int32 nX, sal_Int32 nY) const
}
else
{
- Bitmap aTestBitmap(maAlphaMask);
- Bitmap::ScopedReadAccess pRead(aTestBitmap);
-
+ AlphaMask::ScopedReadAccess pRead(const_cast<AlphaMask&>(maAlphaMask));
if(pRead)
{
const BitmapColor aBitmapColor(pRead->GetPixel(nY, nX));
@@ -1363,7 +1361,7 @@ tools::Polygon BitmapEx::GetContour( bool bContourEdgeDetect,
void BitmapEx::ChangeColorAlpha( sal_uInt8 cIndexFrom, sal_Int8 nAlphaTo )
{
AlphaMask aAlphaMask(GetAlphaMask());
- BitmapScopedWriteAccess pAlphaWriteAccess(aAlphaMask);
+ AlphaMask::ScopedWriteAccess pAlphaWriteAccess(aAlphaMask);
Bitmap::ScopedReadAccess pReadAccess(maBitmap);
assert( pReadAccess.get() && pAlphaWriteAccess.get() );
if ( !(pReadAccess.get() && pAlphaWriteAccess.get()) )
@@ -1394,7 +1392,7 @@ void BitmapEx::AdjustTransparency(sal_uInt8 cTrans)
else
{
aAlpha = GetAlphaMask();
- BitmapScopedWriteAccess pA(aAlpha);
+ AlphaMask::ScopedWriteAccess pA(aAlpha);
assert(pA);
if( !pA )
diff --git a/vcl/source/bitmap/alpha.cxx b/vcl/source/bitmap/alpha.cxx
index 65b63dd1ffd0..2b0d544624b5 100644
--- a/vcl/source/bitmap/alpha.cxx
+++ b/vcl/source/bitmap/alpha.cxx
@@ -33,11 +33,10 @@
AlphaMask::AlphaMask() = default;
AlphaMask::AlphaMask( const Bitmap& rBitmap ) :
- Bitmap( rBitmap )
+ maBitmap( rBitmap )
{
- // no need to do any conversion if it is already an AlphaMask
- if ( typeid(rBitmap) != typeid(AlphaMask) && !rBitmap.IsEmpty() )
- Convert( BmpConversion::N8BitNoConversion );
+ if ( !rBitmap.IsEmpty() )
+ maBitmap.Convert( BmpConversion::N8BitNoConversion );
#if HAVE_FEATURE_SKIA
// Related tdf#156866 force snapshot of alpha mask when using Skia
// In release builds, tdf#156629 and tdf#156630 reappear in many
@@ -46,10 +45,10 @@ AlphaMask::AlphaMask( const Bitmap& rBitmap ) :
// create one here to force the alpha mask to handle any pending
// scaling and make the alpha mask immutable.
else if ( SkiaHelper::isVCLSkiaEnabled() )
- BitmapInfoAccess aInfoAccess( *this );
+ BitmapInfoAccess aInfoAccess( maBitmap );
#endif
- assert( (IsEmpty() || getPixelFormat() == vcl::PixelFormat::N8_BPP) && "alpha bitmap should be 8bpp" );
- assert( (IsEmpty() || HasGreyPalette8Bit()) && "alpha bitmap should have greyscale palette" );
+ assert( (IsEmpty() || maBitmap.getPixelFormat() == vcl::PixelFormat::N8_BPP) && "alpha bitmap should be 8bpp" );
+ assert( (IsEmpty() || maBitmap.HasGreyPalette8Bit()) && "alpha bitmap should have greyscale palette" );
}
AlphaMask::AlphaMask( const AlphaMask& ) = default;
@@ -57,59 +56,49 @@ AlphaMask::AlphaMask( const AlphaMask& ) = default;
AlphaMask::AlphaMask( AlphaMask&& ) = default;
AlphaMask::AlphaMask( const Size& rSizePixel, const sal_uInt8* pEraseTransparency )
- : Bitmap(rSizePixel, vcl::PixelFormat::N8_BPP, &Bitmap::GetGreyPalette(256))
+ : maBitmap(rSizePixel, vcl::PixelFormat::N8_BPP, &Bitmap::GetGreyPalette(256))
{
if( pEraseTransparency )
{
sal_uInt8 nAlpha = 255 - *pEraseTransparency;
- Bitmap::Erase( Color( nAlpha, nAlpha, nAlpha ) );
+ maBitmap.Erase( Color( nAlpha, nAlpha, nAlpha ) );
}
else
- Bitmap::Erase( COL_ALPHA_OPAQUE );
+ maBitmap.Erase( COL_ALPHA_OPAQUE );
}
AlphaMask::~AlphaMask() = default;
AlphaMask& AlphaMask::operator=( const Bitmap& rBitmap )
{
- *static_cast<Bitmap*>(this) = rBitmap;
+ maBitmap = rBitmap;
if( !rBitmap.IsEmpty() )
- Convert( BmpConversion::N8BitNoConversion );
+ maBitmap.Convert( BmpConversion::N8BitNoConversion );
- assert( getPixelFormat() == vcl::PixelFormat::N8_BPP && "alpha bitmap should be 8bpp" );
- assert( HasGreyPalette8Bit() && "alpha bitmap should have greyscale palette" );
+ assert( maBitmap.getPixelFormat() == vcl::PixelFormat::N8_BPP && "alpha bitmap should be 8bpp" );
+ assert( maBitmap.HasGreyPalette8Bit() && "alpha bitmap should have greyscale palette" );
return *this;
}
-const Bitmap& AlphaMask::ImplGetBitmap() const
-{
- return *this;
-}
-
-Bitmap const & AlphaMask::GetBitmap() const
-{
- return ImplGetBitmap();
-}
-
void AlphaMask::Erase( sal_uInt8 cTransparency )
{
sal_uInt8 nAlpha = 255 - cTransparency;
- Bitmap::Erase( Color( nAlpha, nAlpha, nAlpha ) );
+ maBitmap.Erase( Color( nAlpha, nAlpha, nAlpha ) );
}
void AlphaMask::BlendWith(const AlphaMask& rOther)
{
std::shared_ptr<SalBitmap> xImpBmp(ImplGetSVData()->mpDefInst->CreateSalBitmap());
- if (xImpBmp->Create(*ImplGetSalBitmap()) && xImpBmp->AlphaBlendWith(*rOther.ImplGetSalBitmap()))
+ if (xImpBmp->Create(*maBitmap.ImplGetSalBitmap()) && xImpBmp->AlphaBlendWith(*rOther.maBitmap.ImplGetSalBitmap()))
{
- ImplSetSalBitmap(xImpBmp);
- assert( getPixelFormat() == vcl::PixelFormat::N8_BPP && "alpha bitmap should be 8bpp" );
- assert( HasGreyPalette8Bit() && "alpha bitmap should have greyscale palette" );
+ maBitmap.ImplSetSalBitmap(xImpBmp);
+ assert( maBitmap.getPixelFormat() == vcl::PixelFormat::N8_BPP && "alpha bitmap should be 8bpp" );
+ assert( maBitmap.HasGreyPalette8Bit() && "alpha bitmap should have greyscale palette" );
return;
}
- Bitmap::ScopedReadAccess pOtherAcc(const_cast<AlphaMask&>(rOther));
+ AlphaMask::ScopedReadAccess pOtherAcc(const_cast<AlphaMask&>(rOther));
AlphaScopedWriteAccess pAcc(*this);
assert (pOtherAcc && pAcc && pOtherAcc->GetBitCount() == 8 && pAcc->GetBitCount() == 8 && "cannot BlendWith this combination");
if (!(pOtherAcc && pAcc && pOtherAcc->GetBitCount() == 8 && pAcc->GetBitCount() == 8))
@@ -144,8 +133,8 @@ void AlphaMask::BlendWith(const AlphaMask& rOther)
}
}
pAcc.reset();
- assert( getPixelFormat() == vcl::PixelFormat::N8_BPP && "alpha bitmap should be 8bpp" );
- assert( HasGreyPalette8Bit() && "alpha bitmap should have greyscale palette" );
+ assert( maBitmap.getPixelFormat() == vcl::PixelFormat::N8_BPP && "alpha bitmap should be 8bpp" );
+ assert( maBitmap.HasGreyPalette8Bit() && "alpha bitmap should have greyscale palette" );
}
bool AlphaMask::hasAlpha() const
@@ -207,4 +196,14 @@ bool AlphaMask::AlphaCombineOr(const AlphaMask& rMask)
return true;
}
+bool AlphaMask::Invert()
+{
+ if (IsEmpty())
+ return false;
+ bool b = maBitmap.Invert();
+ assert( maBitmap.getPixelFormat() == vcl::PixelFormat::N8_BPP && "alpha bitmap should be 8bpp" );
+ assert( maBitmap.HasGreyPalette8Bit() && "alpha bitmap should have greyscale palette" );
+ return b;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx
index 1167789b7986..0bcd581f62d8 100644
--- a/vcl/source/bitmap/bitmap.cxx
+++ b/vcl/source/bitmap/bitmap.cxx
@@ -726,10 +726,10 @@ bool Bitmap::CopyPixel_AlphaOptimized( const tools::Rectangle& rRectDst, const t
}
bool Bitmap::CopyPixel_AlphaOptimized( const tools::Rectangle& rRectDst, const tools::Rectangle& rRectSrc,
- const Bitmap& rBmpSrc )
+ const AlphaMask& rBmpSrc )
{
assert(HasGreyPalette8Bit());
- assert(rBmpSrc.HasGreyPalette8Bit());
+ assert(rBmpSrc.GetBitmap().HasGreyPalette8Bit());
// Note: this code is copied from Bitmap::CopyPixel but avoids any palette lookups
// This optimization is possible because the palettes of AlphaMasks are always identical (8bit GreyPalette, see ctor)
const Size aSizePix( GetSizePixel() );
@@ -740,10 +740,10 @@ bool Bitmap::CopyPixel_AlphaOptimized( const tools::Rectangle& rRectDst, const t
if( aRectDst.IsEmpty() )
return false;
- if( rBmpSrc.mxSalBmp == mxSalBmp ) // self-copy
+ if( rBmpSrc.GetBitmap().mxSalBmp == mxSalBmp ) // self-copy
return CopyPixel_AlphaOptimized(rRectDst, rRectSrc);
- Bitmap* pSrc = &const_cast<Bitmap&>(rBmpSrc);
+ Bitmap* pSrc = &const_cast<Bitmap&>(rBmpSrc.GetBitmap());
const Size aCopySizePix( pSrc->GetSizePixel() );
tools::Rectangle aRectSrc( rRectSrc );
diff --git a/vcl/source/bitmap/bitmappaint.cxx b/vcl/source/bitmap/bitmappaint.cxx
index 758f36bc1e93..64c42bec3b44 100644
--- a/vcl/source/bitmap/bitmappaint.cxx
+++ b/vcl/source/bitmap/bitmappaint.cxx
@@ -660,7 +660,7 @@ AlphaMask Bitmap::CreateAlphaMask(const Color& rTransColor) const
}
AlphaMask aNewBmp(GetSizePixel());
- BitmapScopedWriteAccess pWriteAcc(aNewBmp);
+ AlphaMask::ScopedWriteAccess pWriteAcc(aNewBmp);
if (!pWriteAcc)
return AlphaMask();
@@ -709,8 +709,8 @@ AlphaMask Bitmap::CreateAlphaMask(const Color& rTransColor) const
pWriteAcc.reset();
pReadAcc.reset();
- aNewBmp.maPrefSize = maPrefSize;
- aNewBmp.maPrefMapMode = maPrefMapMode;
+ aNewBmp.SetPrefSize(maPrefSize);
+ aNewBmp.SetPrefMapMode(maPrefMapMode);
return aNewBmp;
}
@@ -730,7 +730,7 @@ AlphaMask Bitmap::CreateAlphaMask(const Color& rTransColor, sal_uInt8 nTol) cons
// TODO: Possibly remove the 1bpp code later.
AlphaMask aNewBmp(GetSizePixel());
- BitmapScopedWriteAccess pWriteAcc(aNewBmp);
+ AlphaMask::ScopedWriteAccess pWriteAcc(aNewBmp);
if (!pWriteAcc)
return AlphaMask();
@@ -802,8 +802,8 @@ AlphaMask Bitmap::CreateAlphaMask(const Color& rTransColor, sal_uInt8 nTol) cons
pWriteAcc.reset();
pReadAcc.reset();
- aNewBmp.maPrefSize = maPrefSize;
- aNewBmp.maPrefMapMode = maPrefMapMode;
+ aNewBmp.SetPrefSize(maPrefSize);
+ aNewBmp.SetPrefMapMode(maPrefMapMode);
return aNewBmp;
}
@@ -903,7 +903,7 @@ vcl::Region Bitmap::CreateRegion(const Color& rColor, const tools::Rectangle& rR
bool Bitmap::ReplaceMask(const AlphaMask& rMask, const Color& rReplaceColor)
{
- ScopedReadAccess pMaskAcc(const_cast<AlphaMask&>(rMask));
+ AlphaMask::ScopedReadAccess pMaskAcc(const_cast<AlphaMask&>(rMask));
BitmapScopedWriteAccess pAcc(*this);
if (!pMaskAcc || !pAcc)
diff --git a/vcl/source/bitmap/dibtools.cxx b/vcl/source/bitmap/dibtools.cxx
index f5c393848b25..6e62191ead0e 100644
--- a/vcl/source/bitmap/dibtools.cxx
+++ b/vcl/source/bitmap/dibtools.cxx
@@ -1754,7 +1754,7 @@ bool WriteDIBBitmapEx(
// invert the alpha because the other routines actually want transparency
AlphaMask tmpAlpha = rSource.maAlphaMask;
tmpAlpha.Invert();
- return ImplWriteDIB(tmpAlpha, rOStm, true, true);
+ return ImplWriteDIB(tmpAlpha.GetBitmap(), rOStm, true, true);
}
}
diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx
index 186105603904..d985bbf215e7 100644
--- a/vcl/source/filter/jpeg/JpegReader.cxx
+++ b/vcl/source/filter/jpeg/JpegReader.cxx
@@ -260,7 +260,7 @@ Graphic JPEGReader::CreateIntermediateGraphic(tools::Long nLines)
if (nNewLines > 0)
{
{
- BitmapScopedWriteAccess pAccess(*mpIncompleteAlpha);
+ AlphaMask::ScopedWriteAccess pAccess(*mpIncompleteAlpha);
pAccess->SetFillColor(COL_ALPHA_OPAQUE);
pAccess->FillRect(tools::Rectangle(Point(0, mnLastLines), Size(pAccess->Width(), nNewLines)));
}
diff --git a/vcl/source/filter/png/PngImageWriter.cxx b/vcl/source/filter/png/PngImageWriter.cxx
index 5d8f2c7372a8..6a4bf6340a83 100644
--- a/vcl/source/filter/png/PngImageWriter.cxx
+++ b/vcl/source/filter/png/PngImageWriter.cxx
@@ -162,7 +162,7 @@ static bool pngWrite(SvStream& rStream, const Graphic& rGraphic, int nCompressio
Bitmap aBitmap;
AlphaMask aAlphaMask;
Bitmap::ScopedReadAccess pAccess;
- Bitmap::ScopedReadAccess pAlphaAccess;
+ AlphaMask::ScopedReadAccess pAlphaAccess;
if (setjmp(png_jmpbuf(pPng)))
{
@@ -183,7 +183,7 @@ static bool pngWrite(SvStream& rStream, const Graphic& rGraphic, int nCompressio
bool bCombineChannels = false;
pAccess = Bitmap::ScopedReadAccess(aBitmap);
if (bTranslucent)
- pAlphaAccess = Bitmap::ScopedReadAccess(aAlphaMask);
+ pAlphaAccess = AlphaMask::ScopedReadAccess(aAlphaMask);
Size aSize = aBitmapEx.GetSizePixel();
int bitDepth = -1;
diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx
index 6fcd294cdaad..0277affb829f 100644
--- a/vcl/source/filter/wmf/emfwr.cxx
+++ b/vcl/source/filter/wmf/emfwr.cxx
@@ -1301,7 +1301,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
if( !aMsk.IsEmpty() )
{
aBmp.Replace( aMsk, COL_WHITE );
- ImplWriteBmpRecord( aMsk, pA->GetPoint(), maVDev->PixelToLogic( aMsk.GetSizePixel() ), WIN_SRCPAINT );
+ ImplWriteBmpRecord( aMsk.GetBitmap(), pA->GetPoint(), maVDev->PixelToLogic( aMsk.GetSizePixel() ), WIN_SRCPAINT );
ImplWriteBmpRecord( aBmp, pA->GetPoint(), maVDev->PixelToLogic( aBmp.GetSizePixel() ), WIN_SRCAND );
}
else
@@ -1318,7 +1318,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
if( !aMsk.IsEmpty() )
{
aBmp.Replace( aMsk, COL_WHITE );
- ImplWriteBmpRecord( aMsk, pA->GetPoint(), pA->GetSize(), WIN_SRCPAINT );
+ ImplWriteBmpRecord( aMsk.GetBitmap(), pA->GetPoint(), pA->GetSize(), WIN_SRCPAINT );
ImplWriteBmpRecord( aBmp, pA->GetPoint(), pA->GetSize(), WIN_SRCAND );
}
else
@@ -1337,7 +1337,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
if( !aMsk.IsEmpty() )
{
aBmp.Replace( aMsk, COL_WHITE );
- ImplWriteBmpRecord( aMsk, pA->GetDestPoint(), pA->GetDestSize(), WIN_SRCPAINT );
+ ImplWriteBmpRecord( aMsk.GetBitmap(), pA->GetDestPoint(), pA->GetDestSize(), WIN_SRCPAINT );
ImplWriteBmpRecord( aBmp, pA->GetDestPoint(), pA->GetDestSize(), WIN_SRCAND );
}
else
diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx
index c6612a9bbf25..5f1089c77759 100644
--- a/vcl/source/filter/wmf/wmfwr.cxx
+++ b/vcl/source/filter/wmf/wmfwr.cxx
@@ -1267,7 +1267,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
if( !aMsk.IsEmpty() )
{
aBmp.Replace( aMsk, COL_WHITE );
- WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), aMsk, W_SRCPAINT );
+ WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), aMsk.GetBitmap(), W_SRCPAINT );
WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), aBmp, W_SRCAND );
}
else
@@ -1286,7 +1286,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
if( !aMsk.IsEmpty() )
{
aBmp.Replace( aMsk, COL_WHITE );
- WMFRecord_StretchDIB( pA->GetDestPoint(), pA->GetDestSize(), aMsk, W_SRCPAINT );
+ WMFRecord_StretchDIB( pA->GetDestPoint(), pA->GetDestSize(), aMsk.GetBitmap(), W_SRCPAINT );
WMFRecord_StretchDIB( pA->GetDestPoint(), pA->GetDestSize(), aBmp, W_SRCAND );
}
else
diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index 6426491f25d7..0be4c829ddf4 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -498,7 +498,7 @@ void munchDrawCommands(std::vector<std::shared_ptr<WidgetDrawAction>> const& rDr
if (aBitmap.IsAlpha())
{
const std::shared_ptr<SalBitmap> pSalBitmapAlpha
- = aBitmap.GetAlphaMask().ImplGetSalBitmap();
+ = aBitmap.GetAlphaMask().GetBitmap().ImplGetSalBitmap();
FileDefinitionWidgetDraw::drawBitmap(rGraphics, aTR, *pSalBitmap,
*pSalBitmapAlpha);
}
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index d23a97c4e204..cdf10ab30585 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -9056,7 +9056,7 @@ void PDFWriterImpl::writeJPG( const JPGEmit& rObject )
{
BitmapEmit aEmit;
aEmit.m_nObject = nMaskObject;
- aEmit.m_aBitmap = BitmapEx( rObject.m_aAlphaMask, rObject.m_aAlphaMask );
+ aEmit.m_aBitmap = BitmapEx( rObject.m_aAlphaMask.GetBitmap(), rObject.m_aAlphaMask );
writeBitmapObject( aEmit, true );
}
@@ -9441,7 +9441,7 @@ bool PDFWriterImpl::writeBitmapObject( const BitmapEmit& rObject, bool bMask )
{
if( rObject.m_aBitmap.IsAlpha() )
{
- aBitmap = rObject.m_aBitmap.GetAlphaMask();
+ aBitmap = rObject.m_aBitmap.GetAlphaMask().GetBitmap();
aBitmap.Convert( BmpConversion::N1BitThreshold );
SAL_WARN_IF(aBitmap.getPixelFormat() != vcl::PixelFormat::N8_BPP, "vcl.pdfwriter", "mask conversion failed" );
}
diff --git a/vcl/source/graphic/UnoGraphic.cxx b/vcl/source/graphic/UnoGraphic.cxx
index 6448765a9056..9036f54452ba 100644
--- a/vcl/source/graphic/UnoGraphic.cxx
+++ b/vcl/source/graphic/UnoGraphic.cxx
@@ -165,7 +165,7 @@ uno::Sequence<sal_Int8> SAL_CALL Graphic::getMaskDIB()
{
SvMemoryStream aMemoryStream;
- WriteDIB(maGraphic.GetBitmapEx().GetAlphaMask(), aMemoryStream, false, true);
+ WriteDIB(maGraphic.GetBitmapEx().GetAlphaMask().GetBitmap(), aMemoryStream, false, true);
return css::uno::Sequence<sal_Int8>( static_cast<sal_Int8 const *>(aMemoryStream.GetData()), aMemoryStream.Tell() );
}
else
diff --git a/vcl/source/outdev/background.cxx b/vcl/source/outdev/background.cxx
index 118b4d4c4be4..7c07367a82b4 100644
--- a/vcl/source/outdev/background.cxx
+++ b/vcl/source/outdev/background.cxx
@@ -57,7 +57,7 @@ void OutputDevice::SetBackground( const Wallpaper& rBackground )
{
BitmapEx bitmap = rBackground.GetBitmap();
if( bitmap.IsAlpha())
- mpAlphaVDev->SetBackground( Wallpaper( BitmapEx( Bitmap( bitmap.GetAlphaMask()))));
+ mpAlphaVDev->SetBackground( Wallpaper( BitmapEx( bitmap.GetAlphaMask().GetBitmap() ) ) );
else
mpAlphaVDev->SetBackground( Wallpaper( COL_ALPHA_OPAQUE ));
}
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 1806635593d2..9df1ba41ae8c 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -331,7 +331,7 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& rBmp, const AlphaMask& r
alpha.Mirror(mirrorFlags);
}
SalBitmap* pSalSrcBmp = bitmap.ImplGetSalBitmap().get();
- SalBitmap* pSalAlphaBmp = alpha.ImplGetSalBitmap().get();
+ SalBitmap* pSalAlphaBmp = alpha.GetBitmap().ImplGetSalBitmap().get();
// #i83087# Naturally, system alpha blending (SalGraphics::DrawAlphaBitmap) cannot work
// with separate alpha VDev
@@ -346,7 +346,7 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& rBmp, const AlphaMask& r
{
if (mpGraphics->BlendAlphaBitmap(aTR, *pSalSrcBmp, *pSalAlphaBmp, *pSalAlphaBmp2, *this))
{
- mpAlphaVDev->BlendBitmap(aTR, rAlpha);
+ mpAlphaVDev->BlendBitmap(aTR, rAlpha.GetBitmap());
return;
}
}
diff --git a/vcl/source/outdev/bitmapex.cxx b/vcl/source/outdev/bitmapex.cxx
index b4fa9641a1e5..04a50d554570 100644
--- a/vcl/source/outdev/bitmapex.cxx
+++ b/vcl/source/outdev/bitmapex.cxx
@@ -190,7 +190,7 @@ void OutputDevice::DrawDeviceBitmapEx( const Point& rDestPt, const Size& rDestSi
rBitmapEx.Mirror(nMirrFlags);
const SalBitmap* pSalSrcBmp = rBitmapEx.ImplGetBitmapSalBitmap().get();
- std::shared_ptr<SalBitmap> xMaskBmp = rBitmapEx.maAlphaMask.ImplGetSalBitmap();
+ std::shared_ptr<SalBitmap> xMaskBmp = rBitmapEx.maAlphaMask.GetBitmap().ImplGetSalBitmap();
if (xMaskBmp)
{
@@ -274,7 +274,7 @@ void OutputDevice::DrawDeviceBitmapEx( const Point& rDestPt, const Size& rDestSi
if (mpAlphaVDev)
mpAlphaVDev->DrawBitmapEx(rDestPt,
rDestSize,
- BitmapEx(rBitmapEx.GetAlphaMask(),
+ BitmapEx(rBitmapEx.GetAlphaMask().GetBitmap(),
rBitmapEx.GetAlphaMask()));
}
else
@@ -305,7 +305,7 @@ bool OutputDevice::DrawTransformBitmapExDirect(
const basegfx::B2DPoint aTopX(aFullTransform * basegfx::B2DPoint(1.0, 0.0));
const basegfx::B2DPoint aTopY(aFullTransform * basegfx::B2DPoint(0.0, 1.0));
SalBitmap* pSalSrcBmp = rBitmapEx.GetBitmap().ImplGetSalBitmap().get();
- Bitmap aAlphaBitmap;
+ AlphaMask aAlphaBitmap;
if(rBitmapEx.IsAlpha())
{
@@ -314,10 +314,10 @@ bool OutputDevice::DrawTransformBitmapExDirect(
else if (mpAlphaVDev)
{
aAlphaBitmap = AlphaMask(rBitmapEx.GetSizePixel());
- aAlphaBitmap.Erase(COL_ALPHA_OPAQUE);
+ aAlphaBitmap.Erase(0); // opaque
}
- SalBitmap* pSalAlphaBmp = aAlphaBitmap.ImplGetSalBitmap().get();
+ SalBitmap* pSalAlphaBmp = aAlphaBitmap.GetBitmap().ImplGetSalBitmap().get();
bDone = mpGraphics->DrawTransformedBitmap(
aNull,
@@ -333,7 +333,7 @@ bool OutputDevice::DrawTransformBitmapExDirect(
// Merge bitmap alpha to alpha device
AlphaMask aAlpha(rBitmapEx.GetSizePixel());
aAlpha.Erase( ( 1 - fAlpha ) * 255 );
- mpAlphaVDev->DrawTransformBitmapExDirect(aFullTransform, BitmapEx(aAlpha, aAlphaBitmap));
+ mpAlphaVDev->DrawTransformBitmapExDirect(aFullTransform, BitmapEx(aAlpha.GetBitmap(), aAlphaBitmap));
}
return bDone;
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 1214a61a9406..2a8a5800bbde 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1387,7 +1387,7 @@ public:
aAbove.Move(aSrc.GetSizePixel().Width(),0);
rDev.DrawBitmap(aAbove, aSrc.GetBitmap());
aAbove.Move(aSrc.GetSizePixel().Width(),0);
- rDev.DrawBitmap(aAbove, aSrc.GetAlphaMask());
+ rDev.DrawBitmap(aAbove, aSrc.GetAlphaMask().GetBitmap());
// intermediates middle
BitmapEx aResult = AlphaRecovery(rDev, aLocation, aSrc);