20#include <config_features.h>
23#include <osl/diagnose.h>
64 : mxSalBmp(rBitmap.mxSalBmp)
65 , maPrefMapMode(rBitmap.maPrefMapMode)
66 , maPrefSize(rBitmap.maPrefSize)
71 : mxSalBmp(pSalBitmap)
73 , maPrefSize(mxSalBmp->GetSize())
118 sal_uInt16 nActCol = 16;
120 for( sal_uInt16 nB = 0; nB < 256; nB += 51 )
121 for( sal_uInt16 nG = 0; nG < 256; nG += 51 )
122 for( sal_uInt16 nR = 0; nR < 256; nR += 51 )
135 mxSalBmp->Create(rSizePixel, ePixelFormat, pRealPal ? *pRealPal : aPal);
142void savePNG(
const OUString& sWhere,
const Bitmap& rBmp)
144 SvFileStream aStream(sWhere, StreamMode::WRITE | StreamMode::TRUNC);
156 static const OUString sDumpPath(OUString::createFromAscii(std::getenv(
"VCL_DUMP_BMP_PATH")));
159 static volatile bool save(
false);
160 if (!sDumpPath.isEmpty() && save)
163 savePNG(sDumpPath, *
this);
182 return aGreyPalette2;
195 return aGreyPalette4;
205 for (sal_uInt16
i = 0;
i < 16; ++
i, cGrey += cGreyInc)
211 return aGreyPalette16;
218 for (sal_uInt16
i = 0;
i < 256; ++
i)
225 return aGreyPalette256;
228 OSL_FAIL(
"Bitmap::GetGreyPalette: invalid entry count (2/4/16/256 allowed)");
234 if (
this == &rBitmap)
246 maPrefSize = std::move(rBitmap.maPrefSize);
247 maPrefMapMode = std::move(rBitmap.maPrefMapMode);
248 mxSalBmp = std::move(rBitmap.mxSalBmp);
265 if (aChecksum1 == 0 || aChecksum2 == 0)
267 return aChecksum1 == aChecksum2;
341 std::shared_ptr<SalBitmap> xNewImpBmp(
ImplGetSVData()->mpDefInst->CreateSalBitmap());
358 std::shared_ptr<SalBitmap> xOldImpBmp =
mxSalBmp;
360 (void)
mxSalBmp->Create(*xOldImpBmp);
371 if ((aOldSizePix != aNewSizePix) && aOldSizePix.
Width() && aOldSizePix.
Height())
394 std::unique_ptr<BitmapInfoAccess> pInfoAccess(
new BitmapInfoAccess( *
this ));
401 return pInfoAccess.release();
406 std::unique_ptr<BitmapReadAccess> pReadAccess(
new BitmapReadAccess( *
this ));
413 return pReadAccess.release();
425 return pWriteAccess.release();
430 delete pBitmapAccess;
458 for(
tools::Long nY = 0, nY2 = nOldY; nY < nNewHeight; nY++, nY2++ )
460 Scanline pScanline = pWriteAcc->GetScanline(nY);
462 for(
tools::Long nX = 0, nX2 = nOldX; nX < nNewWidth; nX++, nX2++ )
463 pWriteAcc->SetPixelOnData( pScanline, nX, pReadAcc->
GetPixelFromData( pScanlineRead, nX2 ) );
499 if( nSrcBitCount > nDstBitCount )
503 if (nSrcBitCount == 24)
505 else if (nSrcBitCount == 8)
510 else if (nSrcBitCount == 4)
520 if( pSrcAcc && pDstAcc )
523 const int nDstCount = 1 << nDstBitCount;
525 for (
int i = 0; (
i < nSrcCount ) && ( nNextIndex < nDstCount ); ++
i)
531 for (
int j = 0; j < nDstCount; ++j)
533 if( rSrcCol == pDstAcc->GetPaletteColor(
static_cast<sal_uInt16
>(j) ) )
541 pDstAcc->SetPaletteColor(
static_cast<sal_uInt16
>(nNextIndex++), rSrcCol );
565 if( pReadAcc->
HasPalette() && pWriteAcc->HasPalette() )
575 for(
tools::Long nSrcY = aRectSrc.
Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
577 Scanline pScanline = pWriteAcc->GetScanline(nDstY);
579 for(
tools::Long nSrcX = aRectSrc.
Left(), nDstX = aRectDst.
Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
585 for(
tools::Long nSrcY = aRectSrc.
Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
587 Scanline pScanline = pWriteAcc->GetScanline(nDstY);
589 for(
tools::Long nSrcX = aRectSrc.
Left(), nDstX = aRectDst.
Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
594 for(
tools::Long nSrcY = aRectSrc.
Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
596 Scanline pScanline = pWriteAcc->GetScanline(nDstY);
598 for(
tools::Long nSrcX = aRectSrc.
Left(), nDstX = aRectDst.
Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
599 pWriteAcc->SetPixelOnData( pScanline, nDstX, pReadAcc->
GetPixelFromData( pScanlineRead, nSrcX ) );
603 bRet = ( nWidth > 0 ) && ( nHeight > 0 );
616 if( !aRectSrc.
IsEmpty() && ( aRectSrc != aRectDst ) )
633 if( ( nDstX <= nSrcX ) && ( nDstY <= nSrcY ) )
635 for(
tools::Long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
637 Scanline pScanline = pWriteAcc->GetScanline(nYN);
638 Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
639 for(
tools::Long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
640 pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
643 else if( ( nDstX <= nSrcX ) && ( nDstY >= nSrcY ) )
645 for(
tools::Long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
647 Scanline pScanline = pWriteAcc->GetScanline(nYN);
648 Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
649 for(
tools::Long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
650 pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
653 else if( ( nDstX >= nSrcX ) && ( nDstY <= nSrcY ) )
655 for(
tools::Long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
657 Scanline pScanline = pWriteAcc->GetScanline(nYN);
658 Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
659 for(
tools::Long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
660 pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
665 for(
tools::Long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
667 Scanline pScanline = pWriteAcc->GetScanline(nYN);
668 Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
669 for(
tools::Long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
670 pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
721 for(
tools::Long nSrcY = aRectSrc.
Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++)
723 Scanline pScanline = pWriteAcc->GetScanline(nDstY);
725 for(
tools::Long nSrcX = aRectSrc.
Left(), nDstX = aRectDst.
Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
726 pWriteAcc->SetPixelOnData( pScanline, nDstX, pReadAcc->
GetPixelFromData( pScanlineRead, nSrcX ) );
730 bRet = ( nWidth > 0 ) && ( nHeight > 0 );
743 if( !aRectSrc.
IsEmpty() && ( aRectSrc != aRectDst ) )
760 if( ( nDstX <= nSrcX ) && ( nDstY <= nSrcY ) )
762 for(
tools::Long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
764 Scanline pScanline = pWriteAcc->GetScanline(nYN);
765 Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
766 for(
tools::Long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
767 pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
770 else if( ( nDstX <= nSrcX ) && ( nDstY >= nSrcY ) )
772 for(
tools::Long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
774 Scanline pScanline = pWriteAcc->GetScanline(nYN);
775 Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
776 for(
tools::Long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
777 pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
780 else if( ( nDstX >= nSrcX ) && ( nDstY <= nSrcY ) )
782 for(
tools::Long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
784 Scanline pScanline = pWriteAcc->GetScanline(nYN);
785 Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
786 for(
tools::Long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
787 pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
792 for(
tools::Long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
794 Scanline pScanline = pWriteAcc->GetScanline(nYN);
795 Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
796 for(
tools::Long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
797 pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
821 const Size aNewSize( nWidth + nDX, nHeight + nDY );
836 const tools::Long nNewHeight = pWriteAcc->Height();
841 aColor = pWriteAcc->GetBestMatchingColor( *pInitColor );
843 for( nY = 0; nY < nHeight; nY++ )
845 pWriteAcc->CopyScanline( nY, *pReadAcc );
847 if( pInitColor && nDX )
849 Scanline pScanline = pWriteAcc->GetScanline(nY);
850 for( nX = nNewX; nX < nNewWidth; nX++ )
851 pWriteAcc->SetPixelOnData( pScanline, nX, aColor );
855 if( pInitColor && nDY )
856 for( nY = nNewY; nY < nNewHeight; nY++ )
858 Scanline pScanline = pWriteAcc->GetScanline(nY);
859 for( nX = 0; nX < nNewWidth; nX++ )
860 pWriteAcc->SetPixelOnData( pScanline, nX, aColor );
885 std::shared_ptr<SalBitmap> xImpDispBmp(
ImplGetSVData()->mpDefInst->CreateSalBitmap());
886 if (xImpDispBmp->Create(*
mxSalBmp, pDispGraphics))
909 std::shared_ptr<SalBitmap> xImpBmp(
ImplGetSVData()->mpDefInst->CreateSalBitmap());
911 if (xImpBmp->Create(*
mxSalBmp) && xImpBmp->InterpretAs8Bit())
920 std::shared_ptr<SalBitmap> xImpBmp(
ImplGetSVData()->mpDefInst->CreateSalBitmap());
921 if (xImpBmp->Create(*
mxSalBmp) && xImpBmp->ConvertToGreyscale())
933 switch( eConversion )
989 OSL_FAIL(
"Bitmap::Convert(): Unsupported conversion" );
1008 bPalDiffers = ( rPal != pReadAcc->
GetPalette() );
1025 Scanline pScanline = pWriteAcc->GetScanline(nY);
1030 pWriteAcc->SetPixelOnData( pScanline, nX,
1043 Scanline pWriteScan = pWriteAcc->GetScanline( nY );
1051 *pWriteScan++ =
static_cast<sal_uInt8>( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
1063 Scanline pWriteScan = pWriteAcc->GetScanline( nY );
1071 *pWriteScan++ =
static_cast<sal_uInt8>( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
1079 Scanline pScanline = pWriteAcc->GetScanline(nY);
1131 if (pWriteAcc->HasPalette())
1139 for (sal_uInt16
i = 0;
i < nOldCount;
i++)
1140 aPalette[
i] = rOldPalette[
i];
1145 pWriteAcc->SetPalette(aPalette);
1149 Scanline pScanline = pWriteAcc->GetScanline(nY);
1153 pWriteAcc->SetPixelOnData(pScanline, nX, pReadAcc->
GetPixelFromData(pScanlineRead, nX));
1163 Scanline pScanline = pWriteAcc->GetScanline(nY);
1175 Scanline pScanline = pWriteAcc->GetScanline(nY);
1179 pWriteAcc->SetPixelOnData(pScanline, nX, pReadAcc->
GetPixelFromData(pScanlineRead, nX));
1218 const sal_uInt16
nCount = 1 << nNewBitCount;
1227 std::vector<ImpErrorQuad> aErrQuad1(nWidth);
1228 std::vector<ImpErrorQuad> aErrQuad2(nWidth);
1249 pWriteAcc->SetPalette(aPalette);
1253 pQLine2 = !nY ? aErrQuad1.data() : aErrQuad2.data();
1264 assert(pQLine2 || nHeight == 0);
1266 for (
tools::Long nY = 0; nY < nHeight; nY++, nYTmp++)
1270 Scanline pScanline = pWriteAcc->GetScanline(nY);
1271 pWriteAcc->SetPixelOnData(pScanline, 0,
BitmapColor(cIndex));
1274 for (nX = 1; nX < nWidth1; nX++)
1278 aErrQuad = (
ImpErrorQuad(aColor) -= pWriteAcc->GetPaletteColor(cIndex));
1283 pWriteAcc->SetPixelOnData(pScanline, nX,
BitmapColor(cIndex));
1290 pWriteAcc->SetPixelOnData(pScanline, nX,
BitmapColor(cIndex));
1296 pQLine2 = bQ1 ? aErrQuad2.data() : aErrQuad1.data();
1298 if (nYTmp < nHeight)
1301 for (nX = 0; nX < nWidth; nX++)
1349 std::shared_ptr<SalBitmap> xImpBmp(
ImplGetSVData()->mpDefInst->CreateSalBitmap());
1350 if (xImpBmp->Create(*
mxSalBmp) && xImpBmp->Scale(rScaleX, rScaleY, nScaleFlag))
1377 bool bRetval(
false);
1414 OSL_ENSURE(!bRetval || eStartPixelFormat ==
getPixelFormat(),
"Bitmap::Scale has changed the ColorDepth, this should *not* happen (!)");
1426 static_cast<double>(rNewSize.
Height()) / aSize.
Height(),
1437#if HAVE_FEATURE_SKIA
1481 SAL_WARN(
"vcl",
"Can't adapt the pixelformat as it is invalid.");
1489 *pColorArray++ =
static_cast<sal_Int32
>(rColor.
GetBlue()) << 12;
1490 *pColorArray++ =
static_cast<sal_Int32
>(rColor.
GetGreen()) << 12;
1491 *pColorArray++ =
static_cast<sal_Int32
>(rColor.
GetRed()) << 12;
1508 if( ( aSize.
Width() > 3 ) && ( aSize.
Height() > 2 ) )
1513 if( pReadAcc && pWriteAcc )
1520 std::unique_ptr<sal_Int32[]> p1(
new sal_Int32[ nW ]);
1521 std::unique_ptr<sal_Int32[]> p2(
new sal_Int32[ nW ]);
1522 sal_Int32* p1T = p1.get();
1523 sal_Int32* p2T = p2.get();
1524 sal_Int32* pTmp = p2T;
1531 for(
tools::Long nY = 1, nYAcc = 0; nY <= nHeight; nY++, nYAcc++ )
1550 Scanline pScanline = pWriteAcc->GetScanline(nYAcc);
1554 for ( nX = 3, nXAcc = 1; nX < nW2; nXAcc++ )
1591 short nChannelRPercent,
short nChannelGPercent,
short nChannelBPercent,
1592 double fGamma,
bool bInvert,
bool msoBrightness )
1597 if( !nLuminancePercent && !nContrastPercent &&
1598 !nChannelRPercent && !nChannelGPercent && !nChannelBPercent &&
1599 ( fGamma == 1.0 ) && !bInvert )
1612 std::unique_ptr<sal_uInt8[]> cMapR(
new sal_uInt8[ 256 ]);
1613 std::unique_ptr<sal_uInt8[]> cMapG(
new sal_uInt8[ 256 ]);
1614 std::unique_ptr<sal_uInt8[]> cMapB(
new sal_uInt8[ 256 ]);
1615 double fM, fROff, fGOff, fBOff, fOff;
1618 if( nContrastPercent >= 0 )
1619 fM = 128.0 / ( 128.0 - 1.27 *
MinMax( nContrastPercent, 0, 100 ) );
1621 fM = ( 128.0 + 1.27 *
MinMax( nContrastPercent, -100, 0 ) ) / 128.0;
1625 fOff =
MinMax( nLuminancePercent, -100, 100 ) * 2.55 + 128.0 - fM * 128.0;
1627 fOff =
MinMax( nLuminancePercent, -100, 100 ) * 2.55;
1630 fROff = nChannelRPercent * 2.55 + fOff;
1631 fGOff = nChannelGPercent * 2.55 + fOff;
1632 fBOff = nChannelBPercent * 2.55 + fOff;
1635 fGamma = ( fGamma <= 0.0 || fGamma > 10.0 ) ? 1.0 : ( 1.0 / fGamma );
1636 const bool bGamma = ( fGamma != 1.0 );
1652 cMapR[ nX ] =
static_cast<sal_uInt8>(
MinMax(
FRound( (nX+fROff/2-128) * fM + 128 + fROff/2 ), 0, 255 ));
1653 cMapG[ nX ] =
static_cast<sal_uInt8>(
MinMax(
FRound( (nX+fGOff/2-128) * fM + 128 + fGOff/2 ), 0, 255 ));
1654 cMapB[ nX ] =
static_cast<sal_uInt8>(
MinMax(
FRound( (nX+fBOff/2-128) * fM + 128 + fBOff/2 ), 0, 255 ));
1658 cMapR[ nX ] =
GAMMA( cMapR[ nX ], fGamma );
1659 cMapG[ nX ] =
GAMMA( cMapG[ nX ], fGamma );
1660 cMapB[ nX ] =
GAMMA( cMapB[ nX ], fGamma );
1665 cMapR[ nX ] = ~cMapR[ nX ];
1666 cMapG[ nX ] = ~cMapG[ nX ];
1667 cMapB[ nX ] = ~cMapB[ nX ];
1672 if( pAcc->HasPalette() )
1676 for( sal_uInt16
i = 0,
nCount = pAcc->GetPaletteEntryCount();
i <
nCount;
i++ )
1682 pAcc->SetPaletteColor(
i, aNewCol );
1689 Scanline pScan = pAcc->GetScanline( nY );
1693 *pScan = cMapB[ *pScan ]; pScan++;
1694 *pScan = cMapG[ *pScan ]; pScan++;
1695 *pScan = cMapR[ *pScan ]; pScan++;
1703 Scanline pScan = pAcc->GetScanline( nY );
1707 *pScan = cMapR[ *pScan ]; pScan++;
1708 *pScan = cMapG[ *pScan ]; pScan++;
1709 *pScan = cMapB[ *pScan ]; pScan++;
1717 Scanline pScanline = pAcc->GetScanline(nY);
1720 aCol = pAcc->GetPixelFromData( pScanline, nX );
1724 pAcc->SetPixelOnData( pScanline, nX, aCol );
static BitmapColor getColor(const BitmapReadAccess *pReadAcc, tools::Long nZ)
static sal_Int32 * shiftColor(sal_Int32 *pColorArray, BitmapColor const &rColor)
sal_uInt64 BitmapChecksum
Bitmap GetBitmap(Color aTransparentReplaceColor) const
static bool Filter(BitmapEx &rBmpEx, BitmapFilter const &rFilter)
tools::Long Height() const
tools::Long Width() const
const BitmapPalette & GetPalette() const
ScanlineFormat GetScanlineFormat() const
sal_uInt16 GetPaletteEntryCount() const
const BitmapColor & GetPaletteColor(sal_uInt16 nColor) const
sal_uInt16 GetEntryCount() const
bool IsGreyPaletteAny() const
Returns true if the palette is a grey palette (may not be 8-bit).
void SetEntryCount(sal_uInt16 nCount)
bool IsGreyPalette8Bit() const
Returns true if the palette is 8-bit grey palette.
BitmapColor GetPixelFromData(const sal_uInt8 *pData, tools::Long nX) const
sal_uInt8 GetIndexFromData(const sal_uInt8 *pData, tools::Long nX) const
Scanline GetScanline(tools::Long nY) const
bool Dither()
Apply a Floyd dither algorithm to the bitmap.
Bitmap CreateDisplayBitmap(OutputDevice *pDisplay) const
Bitmap & operator=(const Bitmap &rBitmap)
bool Crop(const tools::Rectangle &rRectPixel)
Crop the bitmap.
BitmapWriteAccess * AcquireWriteAccess()
bool HasGreyPalette8Bit() const
SAL_DLLPRIVATE void ImplSetSalBitmap(const std::shared_ptr< SalBitmap > &xImpBmp)
bool Convert(BmpConversion eConversion)
Convert bitmap format.
static const BitmapPalette & GetGreyPalette(int nEntries)
SAL_DLLPRIVATE void ImplMakeUnique()
BitmapChecksum GetChecksum() const
SAL_DLLPRIVATE void ReassignWithSize(const Bitmap &rBitmap)
ReassignWithSize and recalculate bitmap.
Size GetSizePixel() const
static void ReleaseAccess(BitmapInfoAccess *pAccess)
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
Scale the bitmap.
bool CopyPixel_AlphaOptimized(const tools::Rectangle &rRectDst, const tools::Rectangle &rRectSrc, const Bitmap *pBmpSrc)
void Vectorize(GDIMetaFile &rMtf, sal_uInt8 cReduce, const Link< tools::Long, void > *pProgress)
Convert the bitmap to a meta file.
BitmapReadAccess * AcquireReadAccess()
bool HasGreyPaletteAny() const
bool operator==(const Bitmap &rBitmap) const
SAL_DLLPRIVATE bool ImplConvertUp(vcl::PixelFormat ePixelFormat, Color const *pExtColor=nullptr)
bool Adjust(short nLuminancePercent, short nContrastPercent=0, short nChannelRPercent=0, short nChannelGPercent=0, short nChannelBPercent=0, double fGamma=1.0, bool bInvert=false, bool msoBrightness=false)
Change various global color characteristics.
SAL_DLLPRIVATE bool ImplMakeGreyscales()
bool CopyPixel(const tools::Rectangle &rRectDst, const tools::Rectangle &rRectSrc, const Bitmap *pBmpSrc=nullptr)
Copy a rectangular area from another bitmap.
SAL_DLLPRIVATE bool ImplConvertDown8BPP(Color const *pExtColor=nullptr)
void AdaptBitCount(Bitmap &rNew) const
bool GetSystemData(BitmapSystemData &rData) const
get system dependent bitmap data
bool Expand(sal_Int32 nDX, sal_Int32 nDY, const Color *pInitColor=nullptr)
Expand the bitmap by pixel padding.
vcl::PixelFormat getPixelFormat() const
static bool HasFastScale()
Returns true if bitmap scaling is considered to be fast.
std::shared_ptr< SalBitmap > mxSalBmp
BitmapInfoAccess * AcquireInfoAccess()
sal_uInt8 GetLuminance() const
sal_uInt8 GetBlue() const
void SetGreen(sal_uInt8 nGreen)
void SetRed(sal_uInt8 nRed)
sal_uInt8 GetGreen() const
void SetBlue(sal_uInt8 nBlue)
Class to import and export graphic formats.
static GraphicFilter & GetGraphicFilter()
ErrCode compressAsPNG(const Graphic &rGraphic, SvStream &rOutputStream)
void ImplAddColorError7(const ImpErrorQuad &rErrQuad)
BitmapColor ImplGetColor() const
void ImplAddColorError5(const ImpErrorQuad &rErrQuad)
void ImplAddColorError3(const ImpErrorQuad &rErrQuad)
void ImplAddColorError1(const ImpErrorQuad &rErrQuad)
sal_uInt16 GetBestPaletteIndex(const BitmapColor &rColor)
const BitmapPalette & GetPalette()
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
SalGraphics const * GetGraphics() const
Get the graphic context that the output device uses to draw on.
virtual std::shared_ptr< SalBitmap > CreateSalBitmap()=0
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
constexpr ::Color COL_LIGHTRED(0xFF, 0x00, 0x00)
constexpr ::Color COL_GRAY(0x80, 0x80, 0x80)
constexpr ::Color COL_GREEN(0x00, 0x80, 0x00)
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_LIGHTCYAN(0x00, 0xFF, 0xFF)
constexpr ::Color COL_MAGENTA(0x80, 0x00, 0x80)
constexpr ::Color COL_LIGHTMAGENTA(0xFF, 0x00, 0xFF)
constexpr ::Color COL_BROWN(0x80, 0x80, 0x00)
constexpr ::Color COL_YELLOW(0xFF, 0xFF, 0x00)
constexpr ::Color COL_RED(0x80, 0x00, 0x00)
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
constexpr ::Color COL_LIGHTBLUE(0x00, 0x00, 0xFF)
constexpr ::Color COL_CYAN(0x00, 0x80, 0x80)
constexpr ::Color COL_LIGHTGREEN(0x00, 0xFF, 0x00)
constexpr ::Color COL_BLUE(0x00, 0x00, 0x80)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
const sal_uLong nVCLBLut[6]
const sal_uLong nVCLGLut[6]
const sal_uLong nVCLRLut[6]
tools::Long FRound(double fVal)
std::enable_if< std::is_signed< T >::value||std::is_floating_point< T >::value, long >::type MinMax(T nVal, tools::Long nMin, tools::Long nMax)
#define GAMMA(_def_cVal, _def_InvGamma)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
const ContentProperties & rData
bool ImplVectorize(const Bitmap &rColorBmp, GDIMetaFile &rMtf, sal_uInt8 cReduce, const Link< tools::Long, void > *pProgress)
VCL_DLLPUBLIC bool isVCLSkiaEnabled()
constexpr bool isPalettePixelFormat(PixelFormat ePixelFormat)
Is it a pixel format that forces creation of a palette.
PixelFormat
Pixel format of the bitmap in bits per pixel.
constexpr sal_uInt16 pixelFormatBitCount(PixelFormat ePixelFormat)
HashMap_OWString_Interface aMap
ImplSVData * ImplGetSVData()