diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-04-20 11:38:26 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-04-22 05:51:44 +0200 |
commit | d370b676be33c03b5d8e7bdbfe11cb7ea6423e79 (patch) | |
tree | e608617dd7830315b3f0eabb03323fe2f3acc1b5 /tools | |
parent | 60de1cb01986ff6c9aba58dc05dec6b3dc2402d4 (diff) |
cleanup and rename COLORDATA_RGB to color::extractRGB
Change-Id: I8d53c7010b4fea2a74e48f0649e944a498c211c7
Reviewed-on: https://gerrit.libreoffice.org/71003
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/generic/color.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/source/generic/color.cxx b/tools/source/generic/color.cxx index 4bb5221c13d6..f79342d37862 100644 --- a/tools/source/generic/color.cxx +++ b/tools/source/generic/color.cxx @@ -35,7 +35,7 @@ sal_uInt8 Color::GetColorError( const Color& rCompareColor ) const labs(long(rCompareColor.G) - G) + labs(long(rCompareColor.B) - B); - return static_cast<sal_uInt8>(FRound( nErrAbs * 0.3333333333 )); + return sal_uInt8(FRound(double(nErrAbs) / 3.0)); } void Color::IncreaseLuminance(sal_uInt8 cLumInc) @@ -52,11 +52,11 @@ void Color::DecreaseLuminance(sal_uInt8 cLumDec) B = sal_uInt8(std::clamp(long(B) - cLumDec, 0L, 255L)); } -void Color::DecreaseContrast( sal_uInt8 cContDec ) +void Color::DecreaseContrast(sal_uInt8 nContDec) { - if( cContDec ) + if (nContDec) { - const double fM = ( 128.0 - 0.4985 * cContDec ) / 128.0; + const double fM = (128.0 - 0.4985 * nContDec) / 128.0; const double fOff = 128.0 - fM * 128.0; R = sal_uInt8(std::clamp(FRound(R * fM + fOff), 0L, 255L)); |