diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/igif/gifread.cxx | 8 | ||||
-rw-r--r-- | vcl/source/filter/jpeg/JpegWriter.cxx | 4 | ||||
-rw-r--r-- | vcl/source/filter/wmf/winwmf.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap.cxx | 22 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap2.cxx | 46 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap3.cxx | 68 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap4.cxx | 15 | ||||
-rw-r--r-- | vcl/source/gdi/bmpacc2.cxx | 10 | ||||
-rw-r--r-- | vcl/source/gdi/octree.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/outdev2.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/pngread.cxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/pngwrite.cxx | 16 | ||||
-rw-r--r-- | vcl/source/helper/canvasbitmap.cxx | 27 | ||||
-rw-r--r-- | vcl/source/helper/canvastools.cxx | 8 |
14 files changed, 113 insertions, 129 deletions
diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index fa165d68c9df..f4f52949c268 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -509,15 +509,15 @@ void GIFReader::FillImages( HPBYTE pBytes, sal_uLong nCount ) if( bGCTransparent ) { if( cTmp == nGCTransparentIndex ) - pAcc1->SetPixel( nYAcc, nImageX++, cTransIndex1 ); + pAcc1->SetPixelIndex( nYAcc, nImageX++, cTransIndex1 ); else { - pAcc8->SetPixel( nYAcc, nImageX, cTmp ); - pAcc1->SetPixel( nYAcc, nImageX++, cNonTransIndex1 ); + pAcc8->SetPixelIndex( nYAcc, nImageX, cTmp ); + pAcc1->SetPixelIndex( nYAcc, nImageX++, cNonTransIndex1 ); } } else - pAcc8->SetPixel( nYAcc, nImageX++, cTmp ); + pAcc8->SetPixelIndex( nYAcc, nImageX++, cTmp ); } else { diff --git a/vcl/source/filter/jpeg/JpegWriter.cxx b/vcl/source/filter/jpeg/JpegWriter.cxx index 44d77ea3caf9..0b87ad64ce6d 100644 --- a/vcl/source/filter/jpeg/JpegWriter.cxx +++ b/vcl/source/filter/jpeg/JpegWriter.cxx @@ -174,7 +174,7 @@ void* JPEGWriter::GetScanline( long nY ) { for( long nX = 0L; nX < nWidth; nX++ ) { - aColor = mpReadAccess->GetPaletteColor( (sal_uInt8) mpReadAccess->GetPixel( nY, nX ) ); + aColor = mpReadAccess->GetPaletteColor( mpReadAccess->GetPixelIndex( nY, nX ) ); *pTmp++ = aColor.GetRed(); if ( !mbGreys ) { @@ -235,7 +235,7 @@ sal_Bool JPEGWriter::Write( const Graphic& rGraphic ) BitmapColor aColor; for( long nX = 0L; bIsGrey && ( nX < nWidth ); nX++ ) { - aColor = mpReadAccess->HasPalette() ? mpReadAccess->GetPaletteColor( (sal_uInt8) mpReadAccess->GetPixel( nY, nX ) ) + aColor = mpReadAccess->HasPalette() ? mpReadAccess->GetPaletteColor( mpReadAccess->GetPixelIndex( nY, nX ) ) : mpReadAccess->GetPixel( nY, nX ); bIsGrey = ( aColor.GetRed() == aColor.GetGreen() ) && ( aColor.GetRed() == aColor.GetBlue() ); } diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx index e1dfed1ea678..f16f1d89e36e 100644 --- a/vcl/source/filter/wmf/winwmf.cxx +++ b/vcl/source/filter/wmf/winwmf.cxx @@ -596,7 +596,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) { if ( x < nWidth ) { - pAcc->SetPixel( y, x, (nEightPixels>>i)&1 ); + pAcc->SetPixelIndex( y, x, (nEightPixels>>i)&1 ); } x++; } diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index c78131be8c3b..223dc6454f18 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -940,7 +940,7 @@ sal_Bool Bitmap::CopyPixel( const Rectangle& rRectDst, for( long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ ) for( long nSrcX = aRectSrc.Left(), nDstX = aRectDst.Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ ) - pWriteAcc->SetPixel( nDstY, nDstX, pMap[ pReadAcc->GetPixel( nSrcY, nSrcX ).GetIndex() ] ); + pWriteAcc->SetPixelIndex( nDstY, nDstX, pMap[ pReadAcc->GetPixelIndex( nSrcY, nSrcX ) ] ); delete[] pMap; } @@ -948,7 +948,7 @@ sal_Bool Bitmap::CopyPixel( const Rectangle& rRectDst, { for( long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ ) for( long nSrcX = aRectSrc.Left(), nDstX = aRectDst.Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ ) - pWriteAcc->SetPixel( nDstY, nDstX, pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nSrcY, nSrcX ) ) ); + pWriteAcc->SetPixel( nDstY, nDstX, pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nSrcY, nSrcX ) ) ); } else for( long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ ) @@ -1212,7 +1212,7 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const { for( long nX = 0L; nX < nWidth; nX++ ) { - aCol = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nX ) ); + aCol = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nX ) ); nR = aCol.GetRed(); nG = aCol.GetGreen(); nB = aCol.GetBlue(); @@ -1339,14 +1339,14 @@ sal_Bool Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor ) const sal_uInt16 nActColors = pAcc->GetPaletteEntryCount(); const sal_uInt16 nMaxColors = 1 << pAcc->GetBitCount(); - // For a start, choose the next color + // default to the nearest color aReplace = pAcc->GetBestMatchingColor( rReplaceColor ); - // If it's a pallette picture and the color that should be set - // is not in the pallette, we try finding a free entry (expensive) - if( pAcc->GetPaletteColor( (sal_uInt8) aReplace ) != BitmapColor( rReplaceColor ) ) + // for paletted images without a matching palette entry + // look for an unused palette entry (NOTE: expensive!) + if( pAcc->GetPaletteColor( aReplace.GetIndex() ) != BitmapColor( rReplaceColor ) ) { - // See first if we can put the ReplaceColor at a free entry at the end of the pallette + // if the palette has empty entries use the last one if( nActColors < nMaxColors ) { pAcc->SetPaletteEntryCount( nActColors + 1 ); @@ -1362,7 +1362,7 @@ sal_Bool Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor ) for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ ) - pFlags[ (sal_uInt8) pAcc->GetPixel( nY, nX ) ] = sal_True; + pFlags[ pAcc->GetPixelIndex( nY, nX ) ] = sal_True; for( sal_uInt16 i = 0UL; i < nMaxColors; i++ ) { @@ -1414,7 +1414,7 @@ sal_Bool Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor ) for( long nX = 0L; nX < nWidth; nX++ ) { aCol = pAcc->GetColor( nY, nX ); - pNewAcc->SetPixel( nY, nX, aCol.Merge( rMergeColor, 255 - (sal_uInt8) pAlphaAcc->GetPixel( nY, nX ) ) ); + pNewAcc->SetPixel( nY, nX, aCol.Merge( rMergeColor, 255 - pAlphaAcc->GetPixelIndex( nY, nX ) ) ); } } @@ -1783,7 +1783,7 @@ sal_Bool Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor ) for( long nX = 0L; nX < nWidth; ++nX ) pAcc->SetPixel( nY, nX, pAcc->GetPixel( nY, nX ).Merge( rBackgroundColor, - 255 - pAlphaAcc->GetPixel( nY, nX ) ) ); + 255 - pAlphaAcc->GetPixelIndex( nY, nX ) ) ); bRet = sal_True; } diff --git a/vcl/source/gdi/bitmap2.cxx b/vcl/source/gdi/bitmap2.cxx index f71e7570cf86..92078d2bdc6c 100644 --- a/vcl/source/gdi/bitmap2.cxx +++ b/vcl/source/gdi/bitmap2.cxx @@ -520,7 +520,7 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma cTmp = *pTmp++; } - rAcc.SetPixel( nY, nX, sal::static_int_cast<sal_uInt8>(( cTmp >> --nShift ) & 1) ); + rAcc.SetPixelIndex( nY, nX, (cTmp >> --nShift) & 1); } } } @@ -544,7 +544,7 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma cTmp = *pTmp++; } - rAcc.SetPixel( nY, nX, sal::static_int_cast<sal_uInt8>(( cTmp >> ( --nShift << 2UL ) ) & 0x0f) ); + rAcc.SetPixelIndex( nY, nX, (cTmp >> ( --nShift << 2UL ) ) & 0x0f); } } } @@ -559,7 +559,7 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma rIStm.Read( pTmp = pBuf, nAlignedWidth ); for( long nX = 0L; nX < nWidth; nX++ ) - rAcc.SetPixel( nY, nX, *pTmp++ ); + rAcc.SetPixelIndex( nY, nX, *pTmp++ ); } } break; @@ -965,7 +965,7 @@ sal_Bool Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc, cTmp = 0; } - cTmp |= ( (sal_uInt8) rAcc.GetPixel( nY, nX ) << --nShift ); + cTmp |= rAcc.GetPixelIndex( nY, nX ) << --nShift; } *pTmp = cTmp; @@ -990,7 +990,7 @@ sal_Bool Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc, cTmp = 0; } - cTmp |= ( (sal_uInt8) rAcc.GetPixel( nY, nX ) << ( --nShift << 2L ) ); + cTmp |= rAcc.GetPixelIndex( nY, nX ) << ( --nShift << 2L ); } *pTmp = cTmp; rOStm.Write( pBuf, nAlignedWidth ); @@ -1005,7 +1005,7 @@ sal_Bool Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc, pTmp = pBuf; for( long nX = 0L; nX < nWidth; nX++ ) - *pTmp++ = rAcc.GetPixel( nY, nX ); + *pTmp++ = rAcc.GetPixelIndex( nY, nX ); rOStm.Write( pBuf, nAlignedWidth ); } @@ -1075,16 +1075,16 @@ void Bitmap::ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader, cTmp = *pRLE++; if( nX < nWidth ) - rAcc.SetPixel( nY, nX++, cTmp >> 4 ); + rAcc.SetPixelIndex( nY, nX++, cTmp >> 4 ); if( nX < nWidth ) - rAcc.SetPixel( nY, nX++, cTmp & 0x0f ); + rAcc.SetPixelIndex( nY, nX++, cTmp & 0x0f ); } if( nRunByte & 1 ) { if( nX < nWidth ) - rAcc.SetPixel( nY, nX++, *pRLE >> 4 ); + rAcc.SetPixelIndex( nY, nX++, *pRLE >> 4 ); pRLE++; } @@ -1097,7 +1097,7 @@ void Bitmap::ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader, for( sal_uLong i = 0UL; i < nRunByte; i++ ) { if( nX < nWidth ) - rAcc.SetPixel( nY, nX++, *pRLE ); + rAcc.SetPixelIndex( nY, nX++, *pRLE ); pRLE++; } @@ -1130,19 +1130,19 @@ void Bitmap::ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader, for( sal_uLong i = 0UL; i < nRunByte; i++ ) { if( nX < nWidth ) - rAcc.SetPixel( nY, nX++, cTmp >> 4 ); + rAcc.SetPixelIndex( nY, nX++, cTmp >> 4 ); if( nX < nWidth ) - rAcc.SetPixel( nY, nX++, cTmp & 0x0f ); + rAcc.SetPixelIndex( nY, nX++, cTmp & 0x0f ); } if( ( nCountByte & 1 ) && ( nX < nWidth ) ) - rAcc.SetPixel( nY, nX++, cTmp >> 4 ); + rAcc.SetPixelIndex( nY, nX++, cTmp >> 4 ); } else { for( sal_uLong i = 0UL; ( i < nCountByte ) && ( nX < nWidth ); i++ ) - rAcc.SetPixel( nY, nX++, cTmp ); + rAcc.SetPixelIndex( nY, nX++, cTmp ); } } } @@ -1171,9 +1171,10 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool while( nX < nWidth ) { nCount = 1L; - cPix = rAcc.GetPixel( nY, nX++ ); + cPix = rAcc.GetPixelIndex( nY, nX++ ); - while( ( nX < nWidth ) && ( nCount < 255L ) && ( cPix == rAcc.GetPixel( nY, nX ) ) ) + while( ( nX < nWidth ) && ( nCount < 255L ) + && ( cPix == rAcc.GetPixelIndex( nY, nX ) ) ) { nX++; nCount++; @@ -1191,7 +1192,8 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool nSaveIndex = nX - 1UL; bFound = sal_False; - while( ( nX < nWidth ) && ( nCount < 256L ) && ( cPix = rAcc.GetPixel( nY, nX ) ) != cLast ) + while( ( nX < nWidth ) && ( nCount < 256L ) + && ( cPix = rAcc.GetPixelIndex( nY, nX ) ) != cLast ) { nX++; nCount++; cLast = cPix; @@ -1210,10 +1212,10 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool { for ( sal_uLong i = 0; i < nCount; i++, pTmp++ ) { - *pTmp = (sal_uInt8) rAcc.GetPixel( nY, nSaveIndex++ ) << 4; + *pTmp = rAcc.GetPixelIndex( nY, nSaveIndex++ ) << 4; if ( ++i < nCount ) - *pTmp |= rAcc.GetPixel( nY, nSaveIndex++ ); + *pTmp |= rAcc.GetPixelIndex( nY, nSaveIndex++ ); } nCount = ( nCount + 1 ) >> 1; @@ -1221,7 +1223,7 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool else { for( sal_uLong i = 0UL; i < nCount; i++ ) - *pTmp++ = rAcc.GetPixel( nY, nSaveIndex++ ); + *pTmp++ = rAcc.GetPixelIndex( nY, nSaveIndex++ ); } if ( nCount & 1 ) @@ -1235,12 +1237,12 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool else { *pTmp++ = 1; - *pTmp++ = (sal_uInt8) rAcc.GetPixel( nY, nSaveIndex ) << ( bRLE4 ? 4 : 0 ); + *pTmp++ = rAcc.GetPixelIndex( nY, nSaveIndex ) << (bRLE4 ? 4 : 0); if ( nCount == 3 ) { *pTmp++ = 1; - *pTmp++ = (sal_uInt8) rAcc.GetPixel( nY, ++nSaveIndex ) << ( bRLE4 ? 4 : 0 ); + *pTmp++ = rAcc.GetPixelIndex( nY, ++nSaveIndex ) << ( bRLE4 ? 4 : 0 ); nBufCount += 4; } else diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index b92d9fe7987b..2b9ed69ec961 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -344,7 +344,8 @@ sal_Bool Bitmap::ImplMakeMono( sal_uInt8 cThreshold ) { for( long nX = 0L; nX < nWidth; nX++ ) { - if( pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >= + const sal_uInt8 cIndex = pReadAcc->GetPixelIndex( nY, nX ); + if( pReadAcc->GetPaletteColor( cIndex ).GetLuminance() >= cThreshold ) { pWriteAcc->SetPixel( nY, nX, aWhite ); @@ -418,7 +419,8 @@ sal_Bool Bitmap::ImplMakeMonoDither() { for( long nX = 0L, nModY = nY % 16; nX < nWidth; nX++ ) { - if( pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nX ) ).GetLuminance() > + const sal_uInt8 cIndex = pReadAcc->GetPixelIndex( nY, nX ); + if( pReadAcc->GetPaletteColor( cIndex ).GetLuminance() > pDitherMatrix[ nModY ][ nX % 16 ] ) { pWriteAcc->SetPixel( nY, nX, aWhite ); @@ -498,9 +500,9 @@ sal_Bool Bitmap::ImplMakeGreyscales( sal_uInt16 nGreys ) { for( long nX = 0L; nX < nWidth; nX++ ) { - pWriteAcc->SetPixel( nY, nX, - (sal_uInt8) ( pReadAcc->GetPaletteColor( - pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >> nShift ) ); + const sal_uInt8 cIndex = pReadAcc->GetPixelIndex( nY, nX ); + pWriteAcc->SetPixelIndex( nY, nX, + (pReadAcc->GetPaletteColor( cIndex ).GetLuminance() >> nShift) ); } } } @@ -548,7 +550,7 @@ sal_Bool Bitmap::ImplMakeGreyscales( sal_uInt16 nGreys ) { for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ ) - pWriteAcc->SetPixel( nY, nX, sal::static_int_cast<sal_uInt8>(( pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >> nShift) ); + pWriteAcc->SetPixelIndex( nY, nX, (pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >> nShift ); } aNewBmp.ReleaseAccess( pWriteAcc ); @@ -621,7 +623,7 @@ sal_Bool Bitmap::ImplConvertUp( sal_uInt16 nBitCount, Color* pExtColor ) { for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ ) - pWriteAcc->SetPixel( nY, nX, pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nX ) ) ); + pWriteAcc->SetPixel( nY, nX, pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nX ) ) ); } else { @@ -705,7 +707,7 @@ sal_Bool Bitmap::ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor ) for( nX = 0L, pQLine2 = !nY ? pErrQuad1 : pErrQuad2; nX < nWidth; nX++ ) { if( pReadAcc->HasPalette() ) - pQLine2[ nX ] = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nYTmp, nX ) ); + pQLine2[ nX ] = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nYTmp, nX ) ); else pQLine2[ nX ] = pReadAcc->GetPixel( nYTmp, nX ); } @@ -713,9 +715,9 @@ sal_Bool Bitmap::ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor ) for( nY = 0L; nY < nHeight; nY++, nYTmp++ ) { - // First RowPixel + // first pixel in the line cIndex = (sal_uInt8) aColorMap.GetBestPaletteIndex( pQLine1[ 0 ].ImplGetColor() ); - pWriteAcc->SetPixel( nY, 0, cIndex ); + pWriteAcc->SetPixelIndex( nY, 0, cIndex ); for( nX = 1L; nX < nWidth1; nX++ ) { @@ -725,14 +727,14 @@ sal_Bool Bitmap::ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor ) pQLine2[ nX-- ].ImplAddColorError1( aErrQuad ); pQLine2[ nX-- ].ImplAddColorError5( aErrQuad ); pQLine2[ nX++ ].ImplAddColorError3( aErrQuad ); - pWriteAcc->SetPixel( nY, nX, cIndex ); + pWriteAcc->SetPixelIndex( nY, nX, cIndex ); } // Last RowPixel if( nX < nWidth ) { cIndex = (sal_uInt8) aColorMap.GetBestPaletteIndex( pQLine1[ nWidth1 ].ImplGetColor() ); - pWriteAcc->SetPixel( nY, nX, cIndex ); + pWriteAcc->SetPixelIndex( nY, nX, cIndex ); } // Refill/copy row buffer @@ -744,7 +746,7 @@ sal_Bool Bitmap::ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor ) for( nX = 0L; nX < nWidth; nX++ ) { if( pReadAcc->HasPalette() ) - pQLine2[ nX ] = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nYTmp, nX ) ); + pQLine2[ nX ] = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nYTmp, nX ) ); else pQLine2[ nX ] = pReadAcc->GetPixel( nYTmp, nX ); } @@ -1027,7 +1029,7 @@ sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rSca { if( 1 == nWidth ) { - aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, 0 ) ); + aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, 0 ) ); for( nX = 0L; nX < nNewWidth; nX++ ) pWriteAcc->SetPixel( nY, nX, aCol0 ); @@ -1038,8 +1040,8 @@ sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rSca { nTemp = pLutInt[ nX ]; - aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nTemp++ ) ); - aCol1 = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nTemp ) ); + aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nTemp++ ) ); + aCol1 = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nTemp ) ); nTemp = pLutFrac[ nX ]; @@ -1131,7 +1133,7 @@ sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rSca { if( 1 == nHeight ) { - aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( 0, nX ) ); + aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( 0, nX ) ); for( nY = 0L; nY < nNewHeight; nY++ ) pWriteAcc->SetPixel( nY, nX, aCol0 ); @@ -1142,8 +1144,8 @@ sal_Bool Bitmap::ImplScaleInterpolate( const double& rScaleX, const double& rSca { nTemp = pLutInt[ nY ]; - aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nTemp++, nX ) ); - aCol1 = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nTemp, nX ) ); + aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nTemp++, nX ) ); + aCol1 = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nTemp, nX ) ); nTemp = pLutFrac[ nY ]; @@ -1252,7 +1254,7 @@ sal_Bool Bitmap::ImplDitherMatrix() { for( sal_uLong nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ ) { - const BitmapColor aCol( pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nX ) ) ); + const BitmapColor aCol( pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nX ) ) ); const sal_uLong nD = nVCLDitherLut[ nModY + ( nX & 0x0FUL ) ]; const sal_uLong nR = ( nVCLLut[ aCol.GetRed() ] + nD ) >> 16UL; const sal_uLong nG = ( nVCLLut[ aCol.GetGreen() ] + nD ) >> 16UL; @@ -1338,7 +1340,7 @@ sal_Bool Bitmap::ImplDitherFloyd() { for( nZ = 0; nZ < nWidth; nZ++ ) { - aColor = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( 0, nZ ) ); + aColor = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( 0, nZ ) ); *pTmp++ = (long) aColor.GetBlue() << 12; *pTmp++ = (long) aColor.GetGreen() << 12; @@ -1369,7 +1371,7 @@ sal_Bool Bitmap::ImplDitherFloyd() { for( nZ = 0; nZ < nWidth; nZ++ ) { - aColor = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nZ ) ); + aColor = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nZ ) ); *pTmp++ = (long) aColor.GetBlue() << 12; *pTmp++ = (long) aColor.GetGreen() << 12; @@ -1395,7 +1397,7 @@ sal_Bool Bitmap::ImplDitherFloyd() CALC_TABLES7; nX -= 5; CALC_TABLES5; - pWriteAcc->SetPixel( nYAcc, 0, BitmapColor( (sal_uInt8) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) ); + pWriteAcc->SetPixelIndex( nYAcc, 0, static_cast<sal_uInt8>(nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ]) ); // Get middle Pixels using a loop long nXAcc; @@ -1406,7 +1408,7 @@ sal_Bool Bitmap::ImplDitherFloyd() nX -= 8; CALC_TABLES3; CALC_TABLES5; - pWriteAcc->SetPixel( nYAcc, nXAcc, BitmapColor( (sal_uInt8) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) ); + pWriteAcc->SetPixelIndex( nYAcc, nXAcc, static_cast<sal_uInt8>(nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ]) ); } // Treat last Pixel separately @@ -1414,7 +1416,7 @@ sal_Bool Bitmap::ImplDitherFloyd() nX -= 5; CALC_TABLES3; CALC_TABLES5; - pWriteAcc->SetPixel( nYAcc, nWidth1, BitmapColor( (sal_uInt8) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) ); + pWriteAcc->SetPixelIndex( nYAcc, nWidth1, static_cast<sal_uInt8>(nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ]) ); } delete[] p1; @@ -1583,13 +1585,13 @@ sal_Bool Bitmap::ImplReduceSimple( sal_uInt16 nColorCount ) { for( long nY = 0L; nY < nHeight; nY++ ) for( long nX =0L; nX < nWidth; nX++ ) - pWAcc->SetPixel( nY, nX, (sal_uInt8) aOct.GetBestPaletteIndex( pRAcc->GetPaletteColor( pRAcc->GetPixel( nY, nX ) ) ) ); + pWAcc->SetPixelIndex( nY, nX, static_cast<sal_uInt8>(aOct.GetBestPaletteIndex( pRAcc->GetPaletteColor( pRAcc->GetPixelIndex( nY, nX ) ))) ); } else { for( long nY = 0L; nY < nHeight; nY++ ) for( long nX =0L; nX < nWidth; nX++ ) - pWAcc->SetPixel( nY, nX, (sal_uInt8) aOct.GetBestPaletteIndex( pRAcc->GetPixel( nY, nX ) ) ); + pWAcc->SetPixelIndex( nY, nX, static_cast<sal_uInt8>(aOct.GetBestPaletteIndex( pRAcc->GetPixel( nY, nX ) )) ); } aNewBmp.ReleaseAccess( pWAcc ); @@ -1680,7 +1682,7 @@ sal_Bool Bitmap::ImplReducePopular( sal_uInt16 nColCount ) { for( nX = 0L; nX < nWidth; nX++ ) { - const BitmapColor& rCol = pRAcc->GetPaletteColor( pRAcc->GetPixel( nY, nX ) ); + const BitmapColor& rCol = pRAcc->GetPaletteColor( pRAcc->GetPixelIndex( nY, nX ) ); pCountTable[ ( ( ( (sal_uInt32) rCol.GetRed() ) >> nRightShiftBits ) << nLeftShiftBits2 ) | ( ( ( (sal_uInt32) rCol.GetGreen() ) >> nRightShiftBits ) << nLeftShiftBits1 ) | ( ( (sal_uInt32) rCol.GetBlue() ) >> nRightShiftBits ) ].mnCount++; @@ -1732,7 +1734,7 @@ sal_Bool Bitmap::ImplReducePopular( sal_uInt16 nColCount ) { for( nX = 0L; nX < nWidth; nX++ ) { - const BitmapColor& rCol = pRAcc->GetPaletteColor( pRAcc->GetPixel( nY, nX ) ); + const BitmapColor& rCol = pRAcc->GetPaletteColor( pRAcc->GetPixelIndex( nY, nX ) ); aDstCol.SetIndex( pIndexMap[ ( ( ( (sal_uInt32) rCol.GetRed() ) >> nRightShiftBits ) << nLeftShiftBits2 ) | ( ( ( (sal_uInt32) rCol.GetGreen() ) >> nRightShiftBits ) << nLeftShiftBits1 ) | ( ( (sal_uInt32) rCol.GetBlue() ) >> nRightShiftBits ) ] ); @@ -1816,7 +1818,7 @@ sal_Bool Bitmap::ImplReduceMedian( sal_uInt16 nColCount ) { for( long nX = 0L; nX < nWidth; nX++ ) { - const BitmapColor& rCol = pRAcc->GetPaletteColor( pRAcc->GetPixel( nY, nX ) ); + const BitmapColor& rCol = pRAcc->GetPaletteColor( pRAcc->GetPixelIndex( nY, nX ) ); pColBuf[ RGB15( rCol.GetRed() >> 3, rCol.GetGreen() >> 3, rCol.GetBlue() >> 3 ) ]++; } } @@ -1843,7 +1845,7 @@ sal_Bool Bitmap::ImplReduceMedian( sal_uInt16 nColCount ) pWAcc->SetPalette( aPal ); for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ ) - pWAcc->SetPixel( nY, nX, (sal_uInt8) aMap.GetBestPaletteIndex( pRAcc->GetColor( nY, nX ) ) ); + pWAcc->SetPixelIndex( nY, nX, static_cast<sal_uInt8>( aMap.GetBestPaletteIndex( pRAcc->GetColor( nY, nX ) )) ); rtl_freeMemory( pColBuf ); aNewBmp.ReleaseAccess( pWAcc ); @@ -2272,9 +2274,7 @@ bool Bitmap::ImplConvolutionPass(Bitmap& aNewBitmap, const int nNewSize, BitmapR aIndex = aBaseIndex + j; aSum += aWeight = pWeights[ aIndex ]; - aColor = pReadAcc->GetPixel( y, pPixels[ aIndex ] ); - if( pReadAcc->HasPalette() ) - aColor = pReadAcc->GetPaletteColor( aColor ); + aColor = pReadAcc->GetColor( y, pPixels[ aIndex ] ); aValueRed += aWeight * aColor.GetRed(); aValueGreen += aWeight * aColor.GetGreen(); diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx index 45c99c822149..b0afd67b2ed0 100644 --- a/vcl/source/gdi/bitmap4.cxx +++ b/vcl/source/gdi/bitmap4.cxx @@ -839,7 +839,7 @@ sal_Bool Bitmap::ImplMosaic( const BmpFilterParam* pFilterParam, const Link* /*p { for( nX = nX1; nX <= nX2; nX++ ) { - const BitmapColor& rCol = pReadAcc->GetPaletteColor( (sal_uInt8) pReadAcc->GetPixel( nY, nX ) ); + const BitmapColor& rCol = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nX ) ); nSumR += rCol.GetRed(); nSumG += rCol.GetGreen(); nSumB += rCol.GetBlue(); @@ -1145,17 +1145,8 @@ bool Bitmap::ImplSeparableUnsharpenFilter(const double radius) { { for( int y = 0; y < nHeight; y++ ) { - aColorBlur = pReadAccBlur->GetPixel( y , x ); - if( pReadAccBlur->HasPalette() ) - { - pReadAccBlur->GetPaletteColor( aColorBlur ); - } - - aColor = pReadAcc->GetPixel( y , x ); - if( pReadAcc->HasPalette() ) - { - aColor = pReadAcc->GetPaletteColor( aColor ); - } + aColorBlur = pReadAccBlur->GetColor( y , x ); + aColor = pReadAcc->GetColor( y , x ); BitmapColor aResultColor( (sal_uInt8) MinMax( aColor.GetRed() + (aColor.GetRed() - aColorBlur.GetRed()) * aAmount, 0, 255 ), diff --git a/vcl/source/gdi/bmpacc2.cxx b/vcl/source/gdi/bmpacc2.cxx index 22a6ce233817..bf1d54037b6b 100644 --- a/vcl/source/gdi/bmpacc2.cxx +++ b/vcl/source/gdi/bmpacc2.cxx @@ -22,7 +22,7 @@ IMPL_FORMAT_GETPIXEL_NOMASK( _1BIT_MSB_PAL ) { - return( pScanline[ nX >> 3 ] & ( 1 << ( 7 - ( nX & 7 ) ) ) ? 1 : 0 ); + return BitmapColor( pScanline[ nX >> 3 ] & ( 1 << ( 7 - ( nX & 7 ) ) ) ? 1 : 0 ); } IMPL_FORMAT_SETPIXEL_NOMASK( _1BIT_MSB_PAL ) @@ -35,7 +35,7 @@ IMPL_FORMAT_SETPIXEL_NOMASK( _1BIT_MSB_PAL ) IMPL_FORMAT_GETPIXEL_NOMASK( _1BIT_LSB_PAL ) { - return( pScanline[ nX >> 3 ] & ( 1 << ( nX & 7 ) ) ? 1 : 0 ); + return BitmapColor( pScanline[ nX >> 3 ] & ( 1 << ( nX & 7 ) ) ? 1 : 0 ); } IMPL_FORMAT_SETPIXEL_NOMASK( _1BIT_LSB_PAL ) @@ -48,7 +48,7 @@ IMPL_FORMAT_SETPIXEL_NOMASK( _1BIT_LSB_PAL ) IMPL_FORMAT_GETPIXEL_NOMASK( _4BIT_MSN_PAL ) { - return( ( pScanline[ nX >> 1 ] >> ( nX & 1 ? 0 : 4 ) ) & 0x0f ); + return BitmapColor( ( pScanline[ nX >> 1 ] >> ( nX & 1 ? 0 : 4 ) ) & 0x0f ); } IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_MSN_PAL ) @@ -61,7 +61,7 @@ IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_MSN_PAL ) IMPL_FORMAT_GETPIXEL_NOMASK( _4BIT_LSN_PAL ) { - return( ( pScanline[ nX >> 1 ] >> ( nX & 1 ? 4 : 0 ) ) & 0x0f ); + return BitmapColor( ( pScanline[ nX >> 1 ] >> ( nX & 1 ? 4 : 0 ) ) & 0x0f ); } IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_LSN_PAL ) @@ -74,7 +74,7 @@ IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_LSN_PAL ) IMPL_FORMAT_GETPIXEL_NOMASK( _8BIT_PAL ) { - return pScanline[ nX ]; + return BitmapColor( pScanline[ nX ] ); } IMPL_FORMAT_SETPIXEL_NOMASK( _8BIT_PAL ) diff --git a/vcl/source/gdi/octree.cxx b/vcl/source/gdi/octree.cxx index 0774003d41ad..93fb8c5de182 100644 --- a/vcl/source/gdi/octree.cxx +++ b/vcl/source/gdi/octree.cxx @@ -100,7 +100,7 @@ void Octree::ImplCreateOctree() { for( long nX = 0; nX < nWidth; nX++ ) { - pColor = &(BitmapColor&) pAcc->GetPaletteColor( pAcc->GetPixel( nY, nX ) ); + pColor = &(BitmapColor&) pAcc->GetPaletteColor( pAcc->GetPixelIndex( nY, nX ) ); nLevel = 0L; ImplAdd( &pTree ); diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx index 11bdd1188a31..e17842609cf7 100644 --- a/vcl/source/gdi/outdev2.cxx +++ b/vcl/source/gdi/outdev2.cxx @@ -1437,8 +1437,8 @@ inline BitmapColor lcl_AlphaBlend( int nX, int nY, aDstCol = pB->GetColor( nY, nX ); // vcl stores transparency, not alpha - invert it - const sal_uInt8 nSrcAlpha = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex(); - const sal_uInt8 nDstAlpha = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex(); + const sal_uInt8 nSrcAlpha = 255 - pA->GetPixelIndex( nMapY, nMapX ); + const sal_uInt8 nDstAlpha = 255 - pAlphaW->GetPixelIndex( nY, nX ); // Perform porter-duff compositing 'over' operation // @@ -1592,7 +1592,7 @@ Bitmap OutputDevice::ImplBlend( Bitmap aBmp, const sal_uLong nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ]; aDstCol = pB->GetColor( nY, nX ); - aDstCol.Merge( pP->GetColor( nMapY, nMapX ), (sal_uInt8) pA->GetPixel( nMapY, nMapX ) ); + aDstCol.Merge( pP->GetColor( nMapY, nMapX ), pA->GetPixelIndex( nMapY, nMapX ) ); aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] + nVCLGLut[ ( nVCLLut[ aDstCol.GetGreen() ] + nD ) >> 16UL ] + nVCLBLut[ ( nVCLLut[ aDstCol.GetBlue() ] + nD ) >> 16UL ] ) ); diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx index f1ae86514a3a..4eeb6f57d891 100644 --- a/vcl/source/gdi/pngread.cxx +++ b/vcl/source/gdi/pngread.cxx @@ -1409,7 +1409,7 @@ void PNGReaderImpl::ImplSetPixel( sal_uInt32 nY, sal_uInt32 nX, sal_uInt8 nPalIn return; nX >>= mnPreviewShift; - mpAcc->SetPixel( nY, nX, nPalIndex ); + mpAcc->SetPixelIndex( nY, nX, nPalIndex ); } void PNGReaderImpl::ImplSetTranspPixel( sal_uInt32 nY, sal_uInt32 nX, const BitmapColor& rBitmapColor, sal_Bool bTrans ) @@ -1435,8 +1435,8 @@ void PNGReaderImpl::ImplSetAlphaPixel( sal_uInt32 nY, sal_uInt32 nX, return; nX >>= mnPreviewShift; - mpAcc->SetPixel( nY, nX, nPalIndex ); - mpMaskAcc->SetPixel( nY, nX, ~nAlpha ); + mpAcc->SetPixelIndex( nY, nX, nPalIndex ); + mpMaskAcc->SetPixelIndex( nY, nX, ~nAlpha ); } void PNGReaderImpl::ImplSetAlphaPixel( sal_uInt32 nY, sal_uInt32 nX, @@ -1448,7 +1448,7 @@ void PNGReaderImpl::ImplSetAlphaPixel( sal_uInt32 nY, sal_uInt32 nX, nX >>= mnPreviewShift; mpAcc->SetPixel( nY, nX, rBitmapColor ); - mpMaskAcc->SetPixel( nY, nX, ~nAlpha ); + mpMaskAcc->SetPixelIndex( nY, nX, ~nAlpha ); } sal_uInt32 PNGReaderImpl::ImplReadsal_uInt32() diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx index fcd4211c9675..f7c60860c67f 100644 --- a/vcl/source/gdi/pngwrite.cxx +++ b/vcl/source/gdi/pngwrite.cxx @@ -327,7 +327,7 @@ void PNGWriterImpl::ImplWritePalette() void PNGWriterImpl::ImplWriteTransparent () { - const sal_uLong nTransIndex = mpAccess->GetBestMatchingColor( BMP_COL_TRANS ); + const sal_uLong nTransIndex = mpAccess->GetBestPaletteIndex( BMP_COL_TRANS ); ImplOpenChunk( PNGCHUNK_tRNS ); @@ -473,11 +473,11 @@ sal_uLong PNGWriterImpl::ImplGetFilter ( sal_uLong nY, sal_uLong nXStart, sal_uL { sal_uLong nShift = ( nXIndex & 7 ) ^ 7; if ( nShift == 7) - *pDest = (sal_uInt8)(mpAccess->GetPixel( nY, nX ) << nShift); + *pDest = mpAccess->GetPixelIndex( nY, nX ) << nShift; else if ( nShift == 0 ) - *pDest++ |= (sal_uInt8) mpAccess->GetPixel( nY, nX ) << nShift; + *pDest++ |= mpAccess->GetPixelIndex( nY, nX ) << nShift; else - *pDest |= (sal_uInt8) mpAccess->GetPixel( nY, nX ) << nShift; + *pDest |= mpAccess->GetPixelIndex( nY, nX ) << nShift; } if ( ( nXIndex & 7 ) != 0 ) pDest++; // byte is not completely used, so the } // bufferpointer is to correct @@ -489,9 +489,9 @@ sal_uLong PNGWriterImpl::ImplGetFilter ( sal_uLong nY, sal_uLong nXStart, sal_uL for ( nX = nXStart, nXIndex = 0; nX < mnWidth; nX+= nXAdd, nXIndex++ ) { if( nXIndex & 1 ) - *pDest++ |= (sal_uInt8) mpAccess->GetPixel( nY, nX ); + *pDest++ |= mpAccess->GetPixelIndex( nY, nX ); else - *pDest = (sal_uInt8) mpAccess->GetPixel( nY, nX ) << 4; + *pDest = mpAccess->GetPixelIndex( nY, nX ) << 4; } if ( nXIndex & 1 ) pDest++; } @@ -500,7 +500,7 @@ sal_uLong PNGWriterImpl::ImplGetFilter ( sal_uLong nY, sal_uLong nXStart, sal_uL case( 8 ): { for ( sal_uLong nX = nXStart; nX < mnWidth; nX+=nXAdd ) - *pDest++ = mpAccess->GetPixel( nY, nX ); + *pDest++ = mpAccess->GetPixelIndex( nY, nX ); } break; @@ -521,7 +521,7 @@ sal_uLong PNGWriterImpl::ImplGetFilter ( sal_uLong nY, sal_uLong nXStart, sal_uL *pDest++ = rColor.GetRed(); *pDest++ = rColor.GetGreen(); *pDest++ = rColor.GetBlue(); - *pDest++ = 255 - mpMaskAccess->GetPixel( nY, nX ); + *pDest++ = 255 - mpMaskAccess->GetPixelIndex( nY, nX ); } } else diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx index 6951b95b857d..c80554c1ebae 100644 --- a/vcl/source/helper/canvasbitmap.cxx +++ b/vcl/source/helper/canvasbitmap.cxx @@ -534,8 +534,8 @@ uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getData( rendering::IntegerB // input less than a byte - copy via GetPixel() for( long x=aRequestedArea.Left(); x<aRequestedArea.Right(); ++x ) { - *pOutScan++ = m_pBmpAcc->GetPixel(y,x); - *pOutScan++ = m_pAlphaAcc->GetPixel(y,x); + *pOutScan++ = m_pBmpAcc->GetPixelIndex(y,x); + *pOutScan++ = m_pAlphaAcc->GetPixelIndex(y,x); } } else @@ -549,7 +549,7 @@ uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getData( rendering::IntegerB { for( long i=0; i<nNonAlphaBytes; ++i ) *pOutScan++ = *pScan++; - *pOutScan++ = m_pAlphaAcc->GetPixel(y,x); + *pOutScan++ = m_pAlphaAcc->GetPixelIndex( y, x ); } } @@ -611,8 +611,8 @@ uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getPixel( rendering::Integer if( m_nBitsPerInputPixel < 8 ) { // input less than a byte - copy via GetPixel() - *pOutBuf++ = m_pBmpAcc->GetPixel(pos.Y,pos.X); - *pOutBuf = m_pAlphaAcc->GetPixel(pos.Y,pos.X); + *pOutBuf++ = m_pBmpAcc->GetPixelIndex(pos.Y,pos.X); + *pOutBuf = m_pAlphaAcc->GetPixelIndex(pos.Y,pos.X); } else { @@ -622,7 +622,7 @@ uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getPixel( rendering::Integer // input integer multiple of byte - copy directly memcpy(pOutBuf, pScan+nScanlineLeftOffset, nNonAlphaBytes ); pOutBuf += nNonAlphaBytes; - *pOutBuf++ = m_pAlphaAcc->GetPixel(pos.Y,pos.X); + *pOutBuf++ = m_pAlphaAcc->GetPixelIndex(pos.Y,pos.X); } } @@ -1169,10 +1169,7 @@ uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToRGB { const BitmapColor aCol = m_bPalette ? - m_pBmpAcc->GetPaletteColor( - sal::static_int_cast<sal_uInt16>( - m_pBmpAcc->GetPixelFromData( - pIn, i ))) : + m_pBmpAcc->GetPaletteColor( m_pBmpAcc->GetPixelFromData( pIn, i ).GetIndex()) : m_pBmpAcc->GetPixelFromData(pIn, i); // TODO(F3): Convert result to sRGB color space @@ -1226,10 +1223,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToAR { const BitmapColor aCol = m_bPalette ? - m_pBmpAcc->GetPaletteColor( - sal::static_int_cast<sal_uInt16>( - m_pBmpAcc->GetPixelFromData( - pIn, i ))) : + m_pBmpAcc->GetPaletteColor( m_pBmpAcc->GetPixelFromData( pIn, i ).GetIndex() ) : m_pBmpAcc->GetPixelFromData(pIn, i); // TODO(F3): Convert result to sRGB color space @@ -1285,10 +1279,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToPA { const BitmapColor aCol = m_bPalette ? - m_pBmpAcc->GetPaletteColor( - sal::static_int_cast<sal_uInt16>( - m_pBmpAcc->GetPixelFromData( - pIn, i ))) : + m_pBmpAcc->GetPaletteColor( m_pBmpAcc->GetPixelFromData( pIn, i ).GetIndex() ) : m_pBmpAcc->GetPixelFromData(pIn, i); // TODO(F3): Convert result to sRGB color space diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx index 4218cb1a692e..ae48e4b41a54 100644 --- a/vcl/source/helper/canvastools.cxx +++ b/vcl/source/helper/canvastools.cxx @@ -153,8 +153,8 @@ namespace vcl for( sal_Int32 x=0; x<nWidth; ++x ) { const rendering::ARGBColor& rColor=aARGBColors[x]; - rWriteAcc->SetPixel( aRect.Y1, x, - (sal_uInt8)rWriteAcc->GetBestPaletteIndex( + rWriteAcc->SetPixelIndex( aRect.Y1, x, + (sal_uInt8) rWriteAcc->GetBestPaletteIndex( BitmapColor( toByteColor(rColor.Red), toByteColor(rColor.Green), toByteColor(rColor.Blue))) ); @@ -185,8 +185,8 @@ namespace vcl for( sal_Int32 x=0; x<nWidth; ++x ) { const rendering::RGBColor& rColor=aRGBColors[x]; - rWriteAcc->SetPixel( aRect.Y1, x, - (sal_uInt8)rWriteAcc->GetBestPaletteIndex( + rWriteAcc->SetPixelIndex( aRect.Y1, x, + (sal_uInt8) rWriteAcc->GetBestPaletteIndex( BitmapColor( toByteColor(rColor.Red), toByteColor(rColor.Green), toByteColor(rColor.Blue))) ); |