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())
95 else if( ( 4 == nBitCount ) || ( 8 == nBitCount ) )
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 )
123 aPal[ nActCol++ ] =
BitmapColor( static_cast<sal_uInt8>(nR), static_cast<sal_uInt8>(nG), static_cast<sal_uInt8>(nB) );
135 mxSalBmp->Create( rSizePixel, nBitCount, pRealPal ? *pRealPal : aPal );
142 void 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)
219 aPalette[
i] =
BitmapColor(static_cast<sal_uInt8>(
i), static_cast<sal_uInt8>(
i),
220 static_cast<sal_uInt8>(
i));
225 return aGreyPalette256;
228 OSL_FAIL(
"Bitmap::GetGreyPalette: invalid entry count (2/4/16/256 allowed)");
238 if( nEntryCount == 2 || nEntryCount == 4 || nEntryCount == 16 || nEntryCount == 256 )
241 if( rGreyPalette == *
this )
247 if (nEntryCount == 2)
262 if( nEntryCount != 256 )
264 for (sal_uInt16
i = 0;
i < 256; ++
i)
274 if (
this == &rBitmap)
288 mxSalBmp = std::move(rBitmap.mxSalBmp);
303 rBmp.
mxSalBmp->GetChecksum(aChecksum1);
306 if (aChecksum1 == 0 || aChecksum2 == 0)
308 return aChecksum1 == aChecksum2;
345 bool bRet = nBitCount == 1;
351 bRet = pIAcc->HasPalette() && pIAcc->GetPalette().IsGreyPaletteAny();
364 bRet = pIAcc->HasPalette() && pIAcc->GetPalette().IsGreyPalette8Bit();
384 std::shared_ptr<SalBitmap> xNewImpBmp(
ImplGetSVData()->mpDefInst->CreateSalBitmap());
401 std::shared_ptr<SalBitmap> xOldImpBmp =
mxSalBmp;
414 if ((aOldSizePix != aNewSizePix) && aOldSizePix.
Width() && aOldSizePix.
Height())
438 std::unique_ptr<BitmapInfoAccess> pInfoAccess(
new BitmapInfoAccess( *
this ));
445 return pInfoAccess.release();
450 std::unique_ptr<BitmapReadAccess> pReadAccess(
new BitmapReadAccess( *
this ));
457 return pReadAccess.release();
469 return pWriteAccess.release();
474 delete pBitmapAccess;
500 const tools::Long nNewHeight = aNewRect.GetHeight();
502 for(
tools::Long nY = 0, nY2 = nOldY; nY < nNewHeight; nY++, nY2++ )
504 Scanline pScanline = pWriteAcc->GetScanline(nY);
506 for(
tools::Long nX = 0, nX2 = nOldX; nX < nNewWidth; nX++, nX2++ )
507 pWriteAcc->SetPixelOnData( pScanline, nX, pReadAcc->
GetPixelFromData( pScanlineRead, nX2 ) );
540 const sal_uInt16 nSrcBitCount = pBmpSrc->
GetBitCount();
543 if( nSrcBitCount > nDstBitCount )
547 if (nSrcBitCount == 24)
549 else if (nSrcBitCount == 8)
554 else if (nSrcBitCount == 4)
565 if( pSrcAcc && pDstAcc )
568 const int nDstCount = 1 << nDstBitCount;
570 for (
int i = 0; (
i < nSrcCount ) && ( nNextIndex < nSrcCount ); ++
i)
576 for (
int j = 0; j < nDstCount; ++j)
578 if( rSrcCol == pDstAcc->
GetPaletteColor( static_cast<sal_uInt16>(j) ) )
586 pDstAcc->
SetPaletteColor( static_cast<sal_uInt16>(nNextIndex++), rSrcCol );
594 if( !aRectSrc.IsEmpty() )
606 const tools::Long nSrcEndX = aRectSrc.Left() + nWidth;
607 const tools::Long nSrcEndY = aRectSrc.Top() + nHeight;
613 std::unique_ptr<sal_uInt8[]> pMap(
new sal_uInt8[ nCount ]);
617 for( sal_uInt16
i = 0;
i < nCount;
i++ )
620 for(
tools::Long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
624 for(
tools::Long nSrcX = aRectSrc.Left(), nDstX = aRectDst.
Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
630 for(
tools::Long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
634 for(
tools::Long nSrcX = aRectSrc.Left(), nDstX = aRectDst.
Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
639 for(
tools::Long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
643 for(
tools::Long nSrcX = aRectSrc.Left(), nDstX = aRectDst.
Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
648 bRet = ( nWidth > 0 ) && ( nHeight > 0 );
661 if( !aRectSrc.
IsEmpty() && ( aRectSrc != aRectDst ) )
678 if( ( nDstX <= nSrcX ) && ( nDstY <= nSrcY ) )
680 for(
tools::Long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
684 for(
tools::Long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
688 else if( ( nDstX <= nSrcX ) && ( nDstY >= nSrcY ) )
690 for(
tools::Long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
694 for(
tools::Long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
698 else if( ( nDstX >= nSrcX ) && ( nDstY <= nSrcY ) )
700 for(
tools::Long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
704 for(
tools::Long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
710 for(
tools::Long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
714 for(
tools::Long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
750 if( !aRectSrc.IsEmpty() )
762 const tools::Long nSrcEndX = aRectSrc.Left() + nWidth;
763 const tools::Long nSrcEndY = aRectSrc.Top() + nHeight;
766 for(
tools::Long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++)
770 for(
tools::Long nSrcX = aRectSrc.Left(), nDstX = aRectDst.
Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
775 bRet = ( nWidth > 0 ) && ( nHeight > 0 );
788 if( !aRectSrc.
IsEmpty() && ( aRectSrc != aRectDst ) )
805 if( ( nDstX <= nSrcX ) && ( nDstY <= nSrcY ) )
807 for(
tools::Long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
811 for(
tools::Long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
815 else if( ( nDstX <= nSrcX ) && ( nDstY >= nSrcY ) )
817 for(
tools::Long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
821 for(
tools::Long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
825 else if( ( nDstX >= nSrcX ) && ( nDstY <= nSrcY ) )
827 for(
tools::Long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
831 for(
tools::Long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
837 for(
tools::Long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
841 for(
tools::Long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
866 const Size aNewSize( nWidth + nDX, nHeight + nDY );
888 for( nY = 0; nY < nHeight; nY++ )
892 if( pInitColor && nDX )
895 for( nX = nNewX; nX < nNewWidth; nX++ )
900 if( pInitColor && nDY )
901 for( nY = nNewY; nY < nNewHeight; nY++ )
904 for( nX = 0; nX < nNewWidth; nX++ )
930 std::shared_ptr<SalBitmap> xImpDispBmp(
ImplGetSVData()->mpDefInst->CreateSalBitmap());
931 if (xImpDispBmp->Create(*
mxSalBmp, pDispGraphics))
952 std::shared_ptr<SalBitmap> xImpBmp(
ImplGetSVData()->mpDefInst->CreateSalBitmap());
954 if (xImpBmp->Create(*
mxSalBmp) && xImpBmp->InterpretAs8Bit())
963 std::shared_ptr<SalBitmap> xImpBmp(
ImplGetSVData()->mpDefInst->CreateSalBitmap());
964 if (xImpBmp->Create(*
mxSalBmp) && xImpBmp->ConvertToGreyscale())
976 switch( eConversion )
994 else if( nBitCount > 4 )
1010 else if( nBitCount > 8 )
1030 if( nBitCount < 24 )
1039 if( nBitCount < 32 )
1047 OSL_FAIL(
"Bitmap::Convert(): Unsupported conversion" );
1056 SAL_WARN_IF( nGreys != 16 && nGreys != 256,
"vcl",
"Only 16 or 256 greyscales are supported!" );
1064 sal_uLong nShift = ( ( nGreys == 16 ) ? 4UL : 0UL );
1068 bPalDiffers = ( rPal != pReadAcc->
GetPalette() );
1110 *pWriteScan++ =
static_cast<sal_uInt8>( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
1130 *pWriteScan++ =
static_cast<sal_uInt8>( ( nB * 28UL + nG * 151UL + nR * 77UL ) >> nShift );
1190 if (pWriteAcc->HasPalette())
1198 for (sal_uInt16
i = 0;
i < nOldCount;
i++)
1199 aPalette[
i] = rOldPalette[
i];
1204 pWriteAcc->SetPalette(aPalette);
1208 Scanline pScanline = pWriteAcc->GetScanline(nY);
1212 pWriteAcc->SetPixelOnData(pScanline, nX, pReadAcc->
GetPixelFromData(pScanlineRead, nX));
1222 Scanline pScanline = pWriteAcc->GetScanline(nY);
1234 Scanline pScanline = pWriteAcc->GetScanline(nY);
1238 pWriteAcc->SetPixelOnData(pScanline, nX, pReadAcc->
GetPixelFromData(pScanlineRead, nX));
1263 SAL_WARN_IF(nBitCount >
GetBitCount(),
"vcl",
"New BitCount must be lower ( or equal when pExtColor is set )!");
1276 const sal_uInt16
nCount = 1 << nBitCount;
1280 Octree aOctree(*pReadAcc, pExtColor ? (nCount - 1) : nCount);
1285 std::vector<ImpErrorQuad> aErrQuad1(nWidth);
1286 std::vector<ImpErrorQuad> aErrQuad2(nWidth);
1311 pQLine2 = !nY ? aErrQuad1.data() : aErrQuad2.data();
1322 assert(pQLine2 || nHeight == 0);
1324 for (
tools::Long nY = 0; nY < nHeight; nY++, nYTmp++)
1332 for (nX = 1; nX < nWidth1; nX++)
1354 pQLine2 = bQ1 ? aErrQuad2.data() : aErrQuad1.data();
1356 if (nYTmp < nHeight)
1359 for (nX = 0; nX < nWidth; nX++)
1407 std::shared_ptr<SalBitmap> xImpBmp(
ImplGetSVData()->mpDefInst->CreateSalBitmap());
1408 if (xImpBmp->Create(*
mxSalBmp) && xImpBmp->Scale(rScaleX, rScaleY, nScaleFlag))
1431 if (nStartCount == 1)
1435 bool bRetval(
false);
1475 OSL_ENSURE(!bRetval || nStartCount ==
GetBitCount(),
"Bitmap::Scale has changed the ColorDepth, this should *not* happen (!)");
1487 static_cast<double>(rNewSize.
Height()) / aSize.
Height(),
1498 #if HAVE_FEATURE_SKIA
1581 if( ( aSize.
Width() > 3 ) && ( aSize.
Height() > 2 ) )
1586 if( pReadAcc && pWriteAcc )
1594 std::unique_ptr<tools::Long[]> p1(
new tools::Long[ nW ]);
1595 std::unique_ptr<tools::Long[]> p2(
new tools::Long[ nW ]);
1606 for(
tools::Long nY = 1, nYAcc = 0; nY <= nHeight; nY++, nYAcc++ )
1629 for ( nX = 3, nXAcc = 1; nX < nW2; nXAcc++ )
1666 short nChannelRPercent,
short nChannelGPercent,
short nChannelBPercent,
1667 double fGamma,
bool bInvert,
bool msoBrightness )
1672 if( !nLuminancePercent && !nContrastPercent &&
1673 !nChannelRPercent && !nChannelGPercent && !nChannelBPercent &&
1674 ( fGamma == 1.0 ) && !bInvert )
1687 std::unique_ptr<sal_uInt8[]> cMapR(
new sal_uInt8[ 256 ]);
1688 std::unique_ptr<sal_uInt8[]> cMapG(
new sal_uInt8[ 256 ]);
1689 std::unique_ptr<sal_uInt8[]> cMapB(
new sal_uInt8[ 256 ]);
1690 double fM, fROff, fGOff, fBOff, fOff;
1693 if( nContrastPercent >= 0 )
1694 fM = 128.0 / ( 128.0 - 1.27 *
MinMax( nContrastPercent, 0, 100 ) );
1696 fM = ( 128.0 + 1.27 *
MinMax( nContrastPercent, -100, 0 ) ) / 128.0;
1700 fOff =
MinMax( nLuminancePercent, -100, 100 ) * 2.55 + 128.0 - fM * 128.0;
1702 fOff =
MinMax( nLuminancePercent, -100, 100 ) * 2.55;
1705 fROff = nChannelRPercent * 2.55 + fOff;
1706 fGOff = nChannelGPercent * 2.55 + fOff;
1707 fBOff = nChannelBPercent * 2.55 + fOff;
1710 fGamma = ( fGamma <= 0.0 || fGamma > 10.0 ) ? 1.0 : ( 1.0 / fGamma );
1711 const bool bGamma = ( fGamma != 1.0 );
1727 cMapR[ nX ] =
static_cast<sal_uInt8>(
MinMax(
FRound( (nX+fROff/2-128) * fM + 128 + fROff/2 ), 0, 255 ));
1728 cMapG[ nX ] =
static_cast<sal_uInt8>(
MinMax(
FRound( (nX+fGOff/2-128) * fM + 128 + fGOff/2 ), 0, 255 ));
1729 cMapB[ nX ] =
static_cast<sal_uInt8>(
MinMax(
FRound( (nX+fBOff/2-128) * fM + 128 + fBOff/2 ), 0, 255 ));
1733 cMapR[ nX ] =
GAMMA( cMapR[ nX ], fGamma );
1734 cMapG[ nX ] =
GAMMA( cMapG[ nX ], fGamma );
1735 cMapB[ nX ] =
GAMMA( cMapB[ nX ], fGamma );
1740 cMapR[ nX ] = ~cMapR[ nX ];
1741 cMapG[ nX ] = ~cMapG[ nX ];
1742 cMapB[ nX ] = ~cMapB[ nX ];
1768 *pScan = cMapB[ *pScan ]; pScan++;
1769 *pScan = cMapG[ *pScan ]; pScan++;
1770 *pScan = cMapR[ *pScan ]; pScan++;
1782 *pScan = cMapR[ *pScan ]; pScan++;
1783 *pScan = cMapG[ *pScan ]; pScan++;
1784 *pScan = cMapB[ *pScan ]; pScan++;
sal_uInt8 GetIndexFromData(const sal_uInt8 *pData, tools::Long nX) const
static bool HasFastScale()
Returns true if bitmap scaling is considered to be fast.
sal_uInt64 BitmapChecksum
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.
bool IsGreyPalette8Bit() const
Returns true if the palette is 8-bit grey palette.
tools::Long Height() const
void SetBlue(sal_uInt8 nBlue)
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_LIGHTMAGENTA
void setWidth(tools::Long nWidth)
BitmapInfoAccess * AcquireInfoAccess()
void SetEntryCount(sal_uInt16 nCount)
#define GAMMA(_def_cVal, _def_InvGamma)
bool operator==(const Bitmap &rBitmap) const
constexpr::Color COL_RED(0x80, 0x00, 0x00)
ErrCode compressAsPNG(const Graphic &rGraphic, SvStream &rOutputStream)
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)
sal_uInt8 GetLuminance() const
static tools::Long * shiftColor(tools::Long *pColorArray, BitmapColor const &rColor)
Class to import and export graphic formats.
BitmapReadAccess * AcquireReadAccess()
sal_uInt16 GetBestPaletteIndex(const BitmapColor &rBitmapColor) const
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
This template handles BitmapAccess the RAII way.
Size GetSizePixel() const
bool Expand(sal_uLong nDX, sal_uLong nDY, const Color *pInitColor=nullptr)
Expand the bitmap by pixel padding.
void SetPalette(const BitmapPalette &rPalette)
void ImplAddColorError1(const ImpErrorQuad &rErrQuad)
constexpr::Color COL_MAGENTA(0x80, 0x00, 0x80)
HashMap_OWString_Interface aMap
bool Crop(const tools::Rectangle &rRectPixel)
Crop the bitmap.
void SetPixelOnData(sal_uInt8 *pData, tools::Long nX, const BitmapColor &rBitmapColor)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
bool HasGreyPalette8Bit() const
Scanline GetScanline(tools::Long nY) const
constexpr::Color COL_CYAN(0x00, 0x80, 0x80)
static bool Filter(BitmapEx &rBmpEx, BitmapFilter const &rFilter)
sal_uInt8 GetBlue() const
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_LIGHTRED
Bitmap & operator=(const Bitmap &rBitmap)
bool Dither()
Apply a Floyd dither algorithm to the bitmap.
SAL_DLLPRIVATE bool ImplConvertDown(sal_uInt16 nBitCount, Color const *pExtColor=nullptr)
ImplSVData * ImplGetSVData()
sal_uInt16 GetEntryCount() const
BitmapColor ImplGetColor()
const sal_uLong nVCLBLut[6]
Bitmap CreateDisplayBitmap(OutputDevice *pDisplay) const
ScanlineFormat GetScanlineFormat() const
tools::Long FRound(double fVal)
void ImplAddColorError5(const ImpErrorQuad &rErrQuad)
BitmapChecksum GetChecksum() const
SAL_DLLPRIVATE bool ImplConvertUp(sal_uInt16 nBitCount, Color const *pExtColor=nullptr)
tools::Long Width() const
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_GRAY
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
tools::Long Width() const
void SetRed(sal_uInt8 nRed)
bool GetSystemData(BitmapSystemData &rData) const
get system dependent bitmap data
static BitmapColor getColor(BitmapReadAccess *pReadAcc, tools::Long nZ)
static void ReleaseAccess(BitmapInfoAccess *pAccess)
bool ImplVectorize(const Bitmap &rColorBmp, GDIMetaFile &rMtf, sal_uInt8 cReduce, const Link< tools::Long, void > *pProgress)
bool CopyPixel_AlphaOptimized(const tools::Rectangle &rRectDst, const tools::Rectangle &rRectSrc, const Bitmap *pBmpSrc)
sal_uInt16 GetPaletteEntryCount() const
Bitmap GetBitmap(Color aTransparentReplaceColor) const
void ImplAddColorError3(const ImpErrorQuad &rErrQuad)
const sal_uLong nVCLGLut[6]
sal_uInt8 GetGreen() const
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_LIGHTCYAN
virtual std::shared_ptr< SalBitmap > CreateSalBitmap()=0
VCL_DLLPUBLIC bool isVCLSkiaEnabled()
SAL_DLLPRIVATE bool ImplMakeGreyscales(sal_uInt16 nGreyscales)
#define SAL_WARN_IF(condition, area, stream)
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
Scale the bitmap.
constexpr::Color COL_GREEN(0x00, 0x80, 0x00)
bool Convert(BmpConversion eConversion)
Convert bitmap format.
void CopyScanline(tools::Long nY, const BitmapReadAccess &rReadAcc)
void Vectorize(GDIMetaFile &rMtf, sal_uInt8 cReduce, const Link< tools::Long, void > *pProgress)
Convert the bitmap to a meta file.
bool HasGreyPaletteAny() const
void SetGreen(sal_uInt8 nGreen)
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
const BitmapPalette & GetPalette() const
#define SAL_INFO(area, stream)
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BROWN
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_LIGHTGREEN
SalGraphics const * GetGraphics() const
Get the graphic context that the output device uses to draw on.
BitmapWriteAccess * AcquireWriteAccess()
tools::Long Height() const
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_YELLOW
BitmapColor GetPixelFromData(const sal_uInt8 *pData, tools::Long nX) const
std::vector< BitmapColor > maBitmapColor
void AdaptBitCount(Bitmap &rNew) const
SAL_DLLPRIVATE void ImplMakeUnique()
void ImplAddColorError7(const ImpErrorQuad &rErrQuad)
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_LIGHTBLUE
void setHeight(tools::Long nHeight)
static GraphicFilter & GetGraphicFilter()
const sal_uLong nVCLRLut[6]
#define SAL_WARN(area, stream)
const BitmapColor & GetPaletteColor(sal_uInt16 nColor) const
constexpr::Color COL_BLUE(0x00, 0x00, 0x80)
sal_uInt16 GetBitCount() const
SAL_DLLPRIVATE void ReassignWithSize(const Bitmap &rBitmap)
ReassignWithSize and recalculate bitmap.
bool CopyPixel(const tools::Rectangle &rRectDst, const tools::Rectangle &rRectSrc, const Bitmap *pBmpSrc=nullptr)
Copy a rectangular area from another bitmap.
BitmapColor GetBestMatchingColor(const BitmapColor &rBitmapColor)
sal_uInt16 GetBestPaletteIndex(const BitmapColor &rColor)
void SetPaletteColor(sal_uInt16 nColor, const BitmapColor &rBitmapColor)
std::shared_ptr< SalBitmap > mxSalBmp
static const BitmapPalette & GetGreyPalette(int nEntries)
bool IsGreyPaletteAny() const
Returns true if the palette is a grey palette (may not be 8-bit).
const BitmapPalette & GetPalette()
SAL_DLLPRIVATE void ImplSetSalBitmap(const std::shared_ptr< SalBitmap > &xImpBmp)