main/sd/source/ui/slidesorter/view/SlsButtonBar.cxx
/** The source mask is essentially multiplied with the given alpha value.
		The result is written to the result mask.
	*/
The source mask is essentially multiplied with the given alpha value.
The result is written to the result mask.
The source mask is essentially multiplied with the given alpha value . The result is written to the result mask .
void AdaptTransparency (AlphaMask& rMask, const AlphaMask& rSourceMask, const double nAlpha)
	{
		BitmapWriteAccess* pBitmap = rMask.AcquireWriteAccess();
		const BitmapReadAccess* pSourceBitmap = const_cast<AlphaMask&>(rSourceMask).AcquireReadAccess();
		if (pBitmap!=NULL && pSourceBitmap!=NULL)
		{
			const sal_Int32 nWidth (pBitmap->Width());
			const sal_Int32 nHeight (pBitmap->Height());
			for (sal_Int32 nY = 0; nY<nHeight; ++nY)
				for (sal_Int32 nX = 0; nX<nWidth; ++nX)
				{
					const sal_uInt8 nValue (255 - pSourceBitmap->GetPixel(nY, nX).GetBlueOrIndex());
					const sal_Int32 nNewValue (::basegfx::clamp<sal_Int32>(
							static_cast<sal_Int32>(nValue * (1-nAlpha)),
							0,
							255));
					pBitmap->SetPixelIndex(nY, nX, static_cast<sal_uInt8>(255-nNewValue));
				}
		}
	}
void AdaptTransparency ( AlphaMask & rMask , const AlphaMask & rSourceMask , const double nAlpha ) { BitmapWriteAccess * pBitmap = rMask . AcquireWriteAccess ( ) ; const BitmapReadAccess * pSourceBitmap = const_cast < AlphaMask & > ( rSourceMask ) . AcquireReadAccess ( ) ; if ( pBitmap != NULL && pSourceBitmap != NULL ) { const sal_Int32 nWidth ( pBitmap -> Width ( ) ) ; const sal_Int32 nHeight ( pBitmap -> Height ( ) ) ; for ( sal_Int32 nY = 0 ; nY < nHeight ; ++ nY ) for ( sal_Int32 nX = 0 ; nX < nWidth ; ++ nX ) { const sal_uInt8 nValue ( 255 - pSourceBitmap -> GetPixel ( nY , nX ) . GetBlueOrIndex ( ) ) ; const sal_Int32 nNewValue ( :: basegfx :: clamp < sal_Int32 > ( static_cast < sal_Int32 > ( nValue * ( 1 - nAlpha ) ) , 0 , 255 ) ) ; pBitmap -> SetPixelIndex ( nY , nX , static_cast < sal_uInt8 > ( 255 - nNewValue ) ) ; } } }
The source mask is essentially multiplied with the given alpha value.
The source mask is essentially multiplied with the given alpha value .