diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2012-09-02 17:23:03 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2012-09-02 17:30:51 +0200 |
commit | 4b161067d46ddd48b4602ccdcc4d1b2545e2ac83 (patch) | |
tree | 15c301a51f935c216eb64946f447d1504cad9c6f /vcl/source/gdi/bitmapex.cxx | |
parent | 35e13d1f5403076c752879ecbe17b2f451b188d9 (diff) |
Stepwise rebuild bitmap rendering from scratch to avoid rendering bugs.
Bitmap rendering was rebuild from the original state and checked for
rendering bugs at every change. Currently the implementation supports
scaling by averagin for RGB channels an for alpha channel in some
cases. For scaling factor > 0.6, the original bilinear scaling is
used. Implementation is currently still in "outdev2" but is decoupled
and will be moved to its proper place into "bitmap" and "bitmapex".
Change-Id: I6feb744712956a92d6140d079dc3a85ee8511930
Diffstat (limited to 'vcl/source/gdi/bitmapex.cxx')
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 5851b743dcfa..06eec646a000 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -389,62 +389,6 @@ sal_Bool BitmapEx::Scale( const Size& rNewSize, sal_uLong nScaleFlag ) return bRet; } -sal_Bool BitmapEx::ScaleCropRotate( - const double& rScaleX, const double& rScaleY, const Rectangle& rRectPixel, - long nAngle10, const Color& rFillColor, sal_uLong nScaleFlag ) -{ - bool bReturn = false; - - if( !!aBitmap ) - { - // If fill color is transpatent - const bool bTransparentRotation = Color( COL_TRANSPARENT ) == rFillColor; - - // If angle is 0, 90, 180 or 270 degreees, then we don't need to create an alpha bitmap. - const bool bRightAngleRotation = (nAngle10 == 0 || nAngle10 == 900 || nAngle10 == 1800 || nAngle10 == 2700); - - if( !bRightAngleRotation && bTransparentRotation ) - { - if( eTransparent == TRANSPARENT_COLOR ) - { - bReturn = aBitmap.ScaleCropRotate( rScaleX, rScaleY, rRectPixel, nAngle10, aTransparentColor, nScaleFlag ); - } - else if( eTransparent == TRANSPARENT_NONE ) - { - bReturn = aBitmap.ScaleCropRotate( rScaleX, rScaleY, rRectPixel, nAngle10, COL_BLACK, nScaleFlag ); - if ( bReturn ) - { - aMask = Bitmap( aBitmapSize, 1 ); - aMask.Erase( COL_BLACK ); - aMask.ScaleCropRotate( rScaleX, rScaleY, rRectPixel, nAngle10, COL_WHITE, nScaleFlag ); - eTransparent = TRANSPARENT_BITMAP; - } - } else { - bReturn = aBitmap.ScaleCropRotate( rScaleX, rScaleY, rRectPixel, nAngle10, COL_BLACK, nScaleFlag ); - if( bReturn && !!aMask ) - { - aMask.ScaleCropRotate( rScaleX, rScaleY, rRectPixel, nAngle10, COL_WHITE, nScaleFlag ); - aMask.Convert( BMP_CONVERSION_8BIT_GREYS ); - } - } - } - else - { - bReturn = aBitmap.ScaleCropRotate( rScaleX, rScaleY, rRectPixel, nAngle10, rFillColor, nScaleFlag ); - if( eTransparent == TRANSPARENT_BITMAP && !!aMask ) - { - bReturn = aMask.ScaleCropRotate( rScaleX, rScaleY, rRectPixel, nAngle10, COL_WHITE, nScaleFlag ); - aMask.Convert( BMP_CONVERSION_8BIT_GREYS ); - } - } - } - - if ( bReturn ) - aBitmapSize = aBitmap.GetSizePixel(); - - return bReturn; -} - sal_Bool BitmapEx::Rotate( long nAngle10, const Color& rFillColor ) { sal_Bool bRet = sal_False; |