diff options
Diffstat (limited to 'vcl/source/helper/canvastools.cxx')
-rw-r--r-- | vcl/source/helper/canvastools.cxx | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx index aa667a3f6492..d57c9f4ec767 100644 --- a/vcl/source/helper/canvastools.cxx +++ b/vcl/source/helper/canvastools.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -81,7 +81,7 @@ namespace vcl { namespace unotools { - // #i79917# removed helpers bezierSequenceFromPolygon and + // #i79917# removed helpers bezierSequenceFromPolygon and // pointSequenceFromPolygon here // Also all helpers using tools Polygon and PolyPolygon will get mapped to the // B2DPolygon helpers for these cases, see comments with the same TaskID below. @@ -89,8 +89,8 @@ namespace vcl //--------------------------------------------------------------------------------------- - uno::Reference< rendering::XPolyPolygon2D > xPolyPolygonFromPolygon( const uno::Reference< rendering::XGraphicDevice >& xGraphicDevice, - const ::Polygon& inputPolygon ) + uno::Reference< rendering::XPolyPolygon2D > xPolyPolygonFromPolygon( const uno::Reference< rendering::XGraphicDevice >& xGraphicDevice, + const ::Polygon& inputPolygon ) { RTL_LOGFILE_CONTEXT( aLog, "::vcl::unotools::xPolyPolygonFromPolygon()" ); @@ -102,7 +102,7 @@ namespace vcl //--------------------------------------------------------------------------------------- uno::Reference< rendering::XPolyPolygon2D > xPolyPolygonFromPolyPolygon( const uno::Reference< rendering::XGraphicDevice >& xGraphicDevice, - const ::PolyPolygon& inputPolyPolygon ) + const ::PolyPolygon& inputPolyPolygon ) { RTL_LOGFILE_CONTEXT( aLog, "::vcl::unotools::xPolyPolygonFromPolyPolygon()" ); @@ -165,8 +165,8 @@ namespace vcl //--------------------------------------------------------------------------------------- - uno::Reference< rendering::XBitmap > xBitmapFromBitmap( const uno::Reference< rendering::XGraphicDevice >& /*xGraphicDevice*/, - const ::Bitmap& inputBitmap ) + uno::Reference< rendering::XBitmap > xBitmapFromBitmap( const uno::Reference< rendering::XGraphicDevice >& /*xGraphicDevice*/, + const ::Bitmap& inputBitmap ) { RTL_LOGFILE_CONTEXT( aLog, "::vcl::unotools::xBitmapFromBitmap()" ); @@ -175,8 +175,8 @@ namespace vcl //--------------------------------------------------------------------------------------- - uno::Reference< rendering::XBitmap > xBitmapFromBitmapEx( const uno::Reference< rendering::XGraphicDevice >& /*xGraphicDevice*/, - const ::BitmapEx& inputBitmap ) + uno::Reference< rendering::XBitmap > xBitmapFromBitmapEx( const uno::Reference< rendering::XGraphicDevice >& /*xGraphicDevice*/, + const ::BitmapEx& inputBitmap ) { RTL_LOGFILE_CONTEXT( aLog, "::vcl::unotools::xBitmapFromBitmapEx()" ); @@ -204,10 +204,10 @@ namespace vcl namespace { - inline bool operator==( const rendering::IntegerBitmapLayout& rLHS, + inline bool operator==( const rendering::IntegerBitmapLayout& rLHS, const rendering::IntegerBitmapLayout& rRHS ) { - return + return rLHS.ScanLineBytes == rRHS.ScanLineBytes && rLHS.ScanLineStride == rRHS.ScanLineStride && rLHS.PlaneStride == rRHS.PlaneStride && @@ -343,16 +343,16 @@ namespace vcl OSL_ENSURE(aLayout.ColorSpace.is(), "Cannot convert image without color space!"); if( !aLayout.ColorSpace.is() ) - return ::BitmapEx(); + return ::BitmapEx(); nDepth = aLayout.ColorSpace->getBitsPerPixel(); if( xInputBitmap->hasAlpha() ) { // determine alpha channel depth - const uno::Sequence<sal_Int8> aTags( + const uno::Sequence<sal_Int8> aTags( aLayout.ColorSpace->getComponentTags() ); - const uno::Sequence<sal_Int32> aDepths( + const uno::Sequence<sal_Int32> aDepths( aLayout.ColorSpace->getComponentBitCounts() ); const sal_Int8* pStart(aTags.getConstArray()); const sal_Size nLen(aTags.getLength()); @@ -385,7 +385,7 @@ namespace vcl else nDepth = 8; - const USHORT nPaletteEntries( + const USHORT nPaletteEntries( sal::static_int_cast<USHORT>( std::min(sal_Int32(255), nEntryCount))); @@ -397,7 +397,7 @@ namespace vcl uno::Sequence<double> aPaletteEntry; for( USHORT j=0; j<nPaletteEntries; ++j ) { - if( !xPalette->getIndex(aPaletteEntry,j) && + if( !xPalette->getIndex(aPaletteEntry,j) && nAlphaDepth == 0 ) { nAlphaDepth = 1; @@ -413,26 +413,26 @@ namespace vcl } } - const ::Size aPixelSize( + const ::Size aPixelSize( sizeFromIntegerSize2D(xInputBitmap->getSize())); // normalize bitcount - nDepth = + nDepth = ( nDepth <= 1 ) ? 1 : ( nDepth <= 4 ) ? 4 : - ( nDepth <= 8 ) ? 8 : 24; + ( nDepth <= 8 ) ? 8 : 24; ::Bitmap aBitmap( aPixelSize, sal::static_int_cast<USHORT>(nDepth), aLayout.Palette.is() ? &aPalette : NULL ); ::Bitmap aAlpha; if( nAlphaDepth ) - aAlpha = ::Bitmap( aPixelSize, + aAlpha = ::Bitmap( aPixelSize, sal::static_int_cast<USHORT>(nAlphaDepth), &::Bitmap::GetGreyPalette( sal::static_int_cast<USHORT>(1L << nAlphaDepth)) ); - { // limit scoped access + { // limit scoped access ScopedBitmapWriteAccess pWriteAccess( aBitmap.AcquireWriteAccess(), aBitmap ); ScopedBitmapWriteAccess pAlphaWriteAccess( nAlphaDepth ? aAlpha.AcquireWriteAccess() : NULL, @@ -447,7 +447,7 @@ namespace vcl if( !readBmp(nWidth,nHeight,aLayout,xInputBitmap, pWriteAccess,pAlphaWriteAccess) ) continue; - } // limit scoped access + } // limit scoped access if( nAlphaDepth ) return ::BitmapEx( aBitmap, @@ -639,8 +639,8 @@ namespace vcl { return uno::Sequence< beans::PropertyValue >(); } - virtual uno::Sequence< double > SAL_CALL convertColorSpace( const uno::Sequence< double >& deviceColor, - const uno::Reference< rendering::XColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException, + virtual uno::Sequence< double > SAL_CALL convertColorSpace( const uno::Sequence< double >& deviceColor, + const uno::Reference< rendering::XColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException, uno::RuntimeException) { // TODO(P3): if we know anything about target @@ -653,7 +653,7 @@ namespace vcl { const double* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -670,7 +670,7 @@ namespace vcl { const double* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -687,7 +687,7 @@ namespace vcl { const double* pIn( deviceColor.getConstArray() ); const sal_Size nLen( deviceColor.getLength() ); - ENSURE_ARG_OR_THROW2(nLen%4==0, + ENSURE_ARG_OR_THROW2(nLen%4==0, "number of channels no multiple of 4", static_cast<rendering::XColorSpace*>(this), 0); @@ -786,7 +786,7 @@ namespace vcl return aRet; } - Color stdColorSpaceSequenceToColor( const uno::Sequence< double >& rColor ) + Color stdColorSpaceSequenceToColor( const uno::Sequence< double >& rColor ) { ENSURE_ARG_OR_THROW( rColor.getLength() == 4, "color must have 4 channels" ); @@ -802,7 +802,7 @@ namespace vcl return aColor; } - uno::Sequence< double > VCL_DLLPUBLIC colorToDoubleSequence( + uno::Sequence< double > VCL_DLLPUBLIC colorToDoubleSequence( const Color& rColor, const uno::Reference< rendering::XColorSpace >& xColorSpace ) { @@ -816,7 +816,7 @@ namespace vcl return xColorSpace->convertFromARGB(aSeq); } - Color VCL_DLLPUBLIC doubleSequenceToColor( + Color VCL_DLLPUBLIC doubleSequenceToColor( const uno::Sequence< double > rColor, const uno::Reference< rendering::XColorSpace >& xColorSpace ) { |