diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-05-11 11:49:21 +0000 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-05-13 15:43:17 +0200 |
commit | c34bb163c38cfa893d1b5b0124ab9c5929dff16c (patch) | |
tree | 8994582e896495c8fe919e7a26c2852f9d120ec2 /vcl/qa/cppunit/gen | |
parent | 0725e8a5d9add88b1289f5b1cb90b0b43059a734 (diff) |
Make BitmapColor inherit from / merge into Color
BitmapColor itself is kept to distingish the Color usage as part
of a color palette, which continues to store the offset in the
blue value. The original special mbIndex handling is long gone
since commit 1fefdd6f3b41 ("Alpha channel in BitmapColor - change
bIndex to alpha"), so there is no data difference.
This also results in the following changes:
* now has a basic_ostream<charT, traits>& operator<<
(that was my actual starting point... for an other bug fix)
* there is a minimal difference for GetLiminance
BGR(29,151,76) => BGR(28,151,77)
* no more return values for Merge and Invert
(previously returning *this)
* replaces all GetBlueOrIndex with GetIndex
This leaves one "problematic" part: the GetColorError handling.
At first glance it should probably be virtual. The Color variant
is less strict then the BitmapColor one - for whatever reason.
BitmapColor is always used to search for the best match in a
Palette. Currently I'm simply leaving both variants. Would be
nice to have an explict for functions here.
Change-Id: I251ba3024a1d60f2a9d9fde9cd0a60f08e8322a7
Reviewed-on: https://gerrit.libreoffice.org/72181
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/qa/cppunit/gen')
-rw-r--r-- | vcl/qa/cppunit/gen/gen.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/qa/cppunit/gen/gen.cxx b/vcl/qa/cppunit/gen/gen.cxx index 37692a65d5a9..776a75a05f93 100644 --- a/vcl/qa/cppunit/gen/gen.cxx +++ b/vcl/qa/cppunit/gen/gen.cxx @@ -71,7 +71,7 @@ CPPUNIT_TEST_FIXTURE(GenTest, testTdf121120) Bitmap aBitmap = load("tdf121120.png"); Bitmap::ScopedReadAccess pAccess(aBitmap); const Size& rSize = aBitmap.GetPrefSize(); - Color aColor(pAccess->GetPixel(rSize.getWidth() / 2, rSize.getHeight() / 2).GetColor()); + Color aColor(pAccess->GetPixel(rSize.getWidth() / 2, rSize.getHeight() / 2)); // Without the accompanying fix in place, this test would have failed with 'Expected: 255; // Actual : 1'. I.e. center of the preview (which has the background color) was ~black, not // white. @@ -107,7 +107,7 @@ CPPUNIT_TEST_FIXTURE(GenTest, testTdf107966) // Make sure that the polygon is visible. Bitmap aBitmap = pVirtualDevice->GetBitmap(Point(), Size(1350, 15)); Bitmap::ScopedReadAccess pAccess(aBitmap); - Color aPixel(pAccess->GetPixel(0, 0).GetColor()); + Color aPixel(pAccess->GetPixel(0, 0)); // Without the accompanying fix in place, this test would have failed with 'Expected: 000000; // Actual: ffffff', i.e. the top left pixel was white, not black. CPPUNIT_ASSERT_EQUAL(OUString("000000"), aPixel.AsRGBHexString()); |