vcl/qa/cppunit/graphicfilter/filters-webp-test.cxx | 4 ++-- vcl/source/filter/webp/writer.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
New commits: commit f36ad145d878980911ffb777cacc5a0f85fbfe0b Author: Patrick Luby <guibmac...@gmail.com> AuthorDate: Wed Jul 24 10:25:30 2024 -0400 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Thu Jul 25 05:28:24 2024 +0200 tdf#162171 alpha mask pixels are now alpha instead of transparency Starting with commit 81994cb2b8b32453a92bcb011830fcb884f22ff3, alpha masks now store alpha instead of transparency values. Change-Id: I74d7a536e0ae1aea3b462d660ae3e4b815cf89c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170968 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Reviewed-by: Patrick Luby <guibomac...@gmail.com> (cherry picked from commit 4bbdb2f0718d71840a4e55cc7e9c82157422b0dd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170951 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/vcl/qa/cppunit/graphicfilter/filters-webp-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-webp-test.cxx index cbc23315ca30..365ed2ff1ced 100644 --- a/vcl/qa/cppunit/graphicfilter/filters-webp-test.cxx +++ b/vcl/qa/cppunit/graphicfilter/filters-webp-test.cxx @@ -95,7 +95,7 @@ void WebpFilterTest::testRoundtrip(bool lossy) pAccess->SetFillColor(COL_BLUE); pAccess->FillRect(tools::Rectangle(Point(10, 10), Size(10, 10))); BitmapScopedWriteAccess pAccessAlpha(aAlpha); - pAccessAlpha->SetFillColor(BitmapColor(0)); // opaque + pAccessAlpha->SetFillColor(BitmapColor(COL_WHITE)); // opaque pAccessAlpha->FillRect(tools::Rectangle(Point(0, 0), Size(10, 10))); pAccessAlpha->FillRect(tools::Rectangle(Point(10, 0), Size(10, 10))); pAccessAlpha->FillRect(tools::Rectangle(Point(0, 10), Size(10, 10))); @@ -144,7 +144,7 @@ void WebpFilterTest::testRoundtrip(bool lossy) CPPUNIT_ASSERT_EQUAL(sal_uInt8(255), pAccessAlpha->GetPixelIndex(0, 0)); CPPUNIT_ASSERT_EQUAL(sal_uInt8(255), pAccessAlpha->GetPixelIndex(0, 19)); CPPUNIT_ASSERT_EQUAL(sal_uInt8(255), pAccessAlpha->GetPixelIndex(19, 0)); - CPPUNIT_ASSERT_EQUAL(sal_uInt8(191), pAccessAlpha->GetPixelIndex(19, 19)); + CPPUNIT_ASSERT_EQUAL(sal_uInt8(64), pAccessAlpha->GetPixelIndex(19, 19)); } aStream.Seek(STREAM_SEEK_TO_BEGIN); diff --git a/vcl/source/filter/webp/writer.cxx b/vcl/source/filter/webp/writer.cxx index c5249b5adf41..a009a28032af 100644 --- a/vcl/source/filter/webp/writer.cxx +++ b/vcl/source/filter/webp/writer.cxx @@ -148,8 +148,8 @@ static bool writeWebp(SvStream& rStream, const BitmapEx& bitmapEx, bool lossless for (tools::Long x = 0; x < access->Width(); ++x) { BitmapColor color = access->GetPixelFromData(srcB, x); - BitmapColor transparency = accessAlpha->GetPixelFromData(srcA, x); - color.SetAlpha(255 - transparency.GetIndex()); + BitmapColor alpha = accessAlpha->GetPixelFromData(srcA, x); + color.SetAlpha(alpha.GetIndex()); dst[0] = color.GetRed(); dst[1] = color.GetGreen(); dst[2] = color.GetBlue();