diff options
author | Philipp Riemer <ruderphilipp@gmail.com> | 2012-08-18 18:12:35 +0200 |
---|---|---|
committer | Philipp Riemer <ruderphilipp@gmail.com> | 2012-08-18 18:33:50 +0200 |
commit | 42352dff5a8dc4c89fccf399359876aea7dc7d2d (patch) | |
tree | 7747642c5ee1c7465e8a684a35713f5dbd90dc82 /tools/source/generic/color.cxx | |
parent | 0700d6a1f3524ab79b5114559fb2d15c7ba85112 (diff) |
removed ascii-art and blank lines in tools/source
Change-Id: I3f95d12a8c325c96c586253b5d9bb7dce24c0858
Diffstat (limited to 'tools/source/generic/color.cxx')
-rw-r--r-- | tools/source/generic/color.cxx | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/tools/source/generic/color.cxx b/tools/source/generic/color.cxx index ea3a4dc1892e..33e6aff5b8cc 100644 --- a/tools/source/generic/color.cxx +++ b/tools/source/generic/color.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include <stdlib.h> + #include <tools/color.hxx> #include <tools/debug.hxx> #include <tools/stream.hxx> @@ -27,19 +27,11 @@ #include <tools/resid.hxx> #include <tools/rc.h> -// ----------- -// - Inlines - -// ----------- - static inline long _FRound( double fVal ) { return( fVal > 0.0 ? (long) ( fVal + 0.5 ) : -(long) ( -fVal + 0.5 ) ); } -// --------- -// - Color - -// --------- - Color::Color( const ResId& rResId ) { rResId.SetRT( RSC_COLOR ); @@ -64,6 +56,7 @@ Color::Color( const ResId& rResId ) mnColor = RGB_COLORDATA( 0, 0, 0 ); } } + sal_uInt8 Color::GetColorError( const Color& rCompareColor ) const { const long nErrAbs = labs( (long) rCompareColor.GetRed() - GetRed() ) + @@ -73,8 +66,6 @@ sal_uInt8 Color::GetColorError( const Color& rCompareColor ) const return (sal_uInt8) _FRound( nErrAbs * 0.3333333333 ); } -// ----------------------------------------------------------------------- - void Color::IncreaseLuminance( sal_uInt8 cLumInc ) { SetRed( (sal_uInt8) SAL_BOUND( (long) COLORDATA_RED( mnColor ) + cLumInc, 0L, 255L ) ); @@ -82,8 +73,6 @@ void Color::IncreaseLuminance( sal_uInt8 cLumInc ) SetBlue( (sal_uInt8) SAL_BOUND( (long) COLORDATA_BLUE( mnColor ) + cLumInc, 0L, 255L ) ); } -// ----------------------------------------------------------------------- - void Color::DecreaseLuminance( sal_uInt8 cLumDec ) { SetRed( (sal_uInt8) SAL_BOUND( (long) COLORDATA_RED( mnColor ) - cLumDec, 0L, 255L ) ); @@ -91,8 +80,6 @@ void Color::DecreaseLuminance( sal_uInt8 cLumDec ) SetBlue( (sal_uInt8) SAL_BOUND( (long) COLORDATA_BLUE( mnColor ) - cLumDec, 0L, 255L ) ); } -// ----------------------------------------------------------------------- - void Color::DecreaseContrast( sal_uInt8 cContDec ) { if( cContDec ) @@ -106,8 +93,6 @@ void Color::DecreaseContrast( sal_uInt8 cContDec ) } } -// ----------------------------------------------------------------------- - void Color::Invert() { SetRed( ~COLORDATA_RED( mnColor ) ); @@ -115,23 +100,17 @@ void Color::Invert() SetBlue( ~COLORDATA_BLUE( mnColor ) ); } -// ----------------------------------------------------------------------- - sal_Bool Color::IsDark() const { return GetLuminance() <= 38; } -// ----------------------------------------------------------------------- - sal_Bool Color::IsBright() const { return GetLuminance() >= 245; } -// ----------------------------------------------------------------------- // color space conversion -// ----------------------------------------------------------------------- void Color::RGBtoHSB( sal_uInt16& nHue, sal_uInt16& nSat, sal_uInt16& nBri ) const { @@ -243,8 +222,6 @@ SvStream& Color::Read( SvStream& rIStm, sal_Bool bNewFormat ) return rIStm; } -// ----------------------------------------------------------------------- - SvStream& Color::Write( SvStream& rOStm, sal_Bool bNewFormat ) { if ( bNewFormat ) @@ -255,12 +232,8 @@ SvStream& Color::Write( SvStream& rOStm, sal_Bool bNewFormat ) return rOStm; } -// ----------------------------------------------------------------------- - #define COL_NAME_USER ((sal_uInt16)0x8000) -// ----------------------------------------------------------------------- - SvStream& operator>>( SvStream& rIStream, Color& rColor ) { DBG_ASSERTWARNING( rIStream.GetVersion(), "Color::>> - Solar-Version not set on rIStream" ); @@ -327,8 +300,6 @@ SvStream& operator>>( SvStream& rIStream, Color& rColor ) return rIStream; } -// ----------------------------------------------------------------------- - SvStream& operator<<( SvStream& rOStream, const Color& rColor ) { DBG_ASSERTWARNING( rOStream.GetVersion(), "Color::<< - Solar-Version not set on rOStream" ); |