rework Color to have R,G,B,A public variables

Desktop / LibreOffice - Toma┼ż Vajngerl [] - 21 April 2019 12:20 EDT

Color is a wrapper around a sal_uInt32 variable. With a union, separate channels R, G, B, A sal_uInt8 variables can be added that occupy the same memory. This makes it much easier to access each color component separately, which is used quite a lot by
various algorithms. This also adds the variables to public so everyone can enjoy the benefits.

Tests have been extended to make sure this doesn't break the existing algroithms.

Change-Id: I2e78e12df68e8c7f0f49420eef5e659b335ee397 Reviewed-on:

d487d6e082bc rework Color to have R,G,B,A public variables
include/tools/color.hxx | 85 +++++++++++++++------------
tools/ | 1 +
tools/qa/cppunit/test_color.cxx | 124 ++++++++++++++++++++++++++++++++++++++++
tools/source/generic/color.cxx | 50 ++++++++--------
4 files changed, 197 insertions(+), 63 deletions(-)


  • Share