diff options
Diffstat (limited to 'tools/source')
-rw-r--r-- | tools/source/generic/color.cxx | 13 |
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 ) ); } } |