summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-10-15 21:42:59 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-10-15 21:42:59 +0200
commitbd2f6ab505a2b76da0b829607a73b5f9a6be3008 (patch)
treea6a9bcc9ba9181777c724d68b84edc4d1d143115 /tools
parent7b3e0aa8ad02c12706547616d7a5fd695bf0d75c (diff)
Reuse FRound from tools/helpers.hxx
Change-Id: I74ec4fc6a685c59dbc79978bf8a9afff0a1f9501
Diffstat (limited to 'tools')
-rw-r--r--tools/source/generic/color.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/tools/source/generic/color.cxx b/tools/source/generic/color.cxx
index 6d7ebaff092c..697de7ebc2f8 100644
--- a/tools/source/generic/color.cxx
+++ b/tools/source/generic/color.cxx
@@ -32,11 +32,6 @@
#include <tools/helpers.hxx>
#include <basegfx/color/bcolortools.hxx>
-static inline long _FRound( double fVal )
-{
- return( fVal > 0.0 ? (long) ( fVal + 0.5 ) : -(long) ( -fVal + 0.5 ) );
-}
-
Color::Color( const ResId& rResId )
{
rResId.SetRT( RSC_COLOR );
@@ -68,7 +63,7 @@ sal_uInt8 Color::GetColorError( const Color& rCompareColor ) const
labs( (long) rCompareColor.GetGreen() - GetGreen() ) +
labs( (long) rCompareColor.GetBlue() - GetBlue() );
- return (sal_uInt8) _FRound( nErrAbs * 0.3333333333 );
+ return (sal_uInt8) FRound( nErrAbs * 0.3333333333 );
}
void Color::IncreaseLuminance( sal_uInt8 cLumInc )
@@ -92,9 +87,9 @@ void Color::DecreaseContrast( sal_uInt8 cContDec )
const double fM = ( 128.0 - 0.4985 * cContDec ) / 128.0;
const double fOff = 128.0 - fM * 128.0;
- SetRed( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_RED( mnColor ) * fM + fOff ), 0L, 255L ) );
- SetGreen( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_GREEN( mnColor ) * fM + fOff ), 0L, 255L ) );
- SetBlue( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_BLUE( mnColor ) * fM + fOff ), 0L, 255L ) );
+ SetRed( (sal_uInt8) SAL_BOUND( FRound( COLORDATA_RED( mnColor ) * fM + fOff ), 0L, 255L ) );
+ SetGreen( (sal_uInt8) SAL_BOUND( FRound( COLORDATA_GREEN( mnColor ) * fM + fOff ), 0L, 255L ) );
+ SetBlue( (sal_uInt8) SAL_BOUND( FRound( COLORDATA_BLUE( mnColor ) * fM + fOff ), 0L, 255L ) );
}
}