25#include <com/sun/star/graphic/SvgTools.hpp>
26#include <com/sun/star/graphic/Primitive2DTools.hpp>
30#include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp>
36#if ENABLE_CAIRO_CANVAS
67 SAL_WARN_IF(!bSuccess,
"vcl",
"vcl::bitmap::loadFromName : could not load image " << rFileName <<
" via icon theme " << aIconTheme);
75 const uno::Reference<graphic::XSvgParser> xSvgParser = graphic::SvgTools::create(xContext);
78 std::vector<sal_Int8>
aBuffer(nSize + 1);
82 uno::Sequence<sal_Int8>
aData(
aBuffer.data(), nSize + 1);
85 const Primitive2DSequence aPrimitiveSequence = xSvgParser->getDecomposition(aInputStream, sPath);
87 if (!aPrimitiveSequence.hasElements())
90 uno::Sequence<beans::PropertyValue> aViewParameters;
92 geometry::RealRectangle2D aRealRect;
94 for (css::uno::Reference<css::graphic::XPrimitive2D>
const & xReference : aPrimitiveSequence)
98 aRealRect = xReference->
getRange(aViewParameters);
103 aRealRect.X1 = aRange.
getMinX();
104 aRealRect.Y1 = aRange.
getMinY();
105 aRealRect.X2 = aRange.
getMaxX();
106 aRealRect.Y2 = aRange.
getMaxY();
108 double nDPI = 96 * fScalingFactor;
110 const css::uno::Reference<css::graphic::XPrimitive2DRenderer> xPrimitive2DRenderer = css::graphic::Primitive2DTools::create(xContext);
111 const css::uno::Reference<css::rendering::XBitmap> xBitmap(
112 xPrimitive2DRenderer->rasterize(aPrimitiveSequence, aViewParameters, nDPI, nDPI, aRealRect, 256*256));
116 const css::uno::Reference<css::rendering::XIntegerReadOnlyBitmap> xIntBmp(xBitmap, uno::UNO_QUERY_THROW);
134 bool bReversColors,
bool bReverseAlpha)
136 assert(nStride >= (nWidth *
nBitCount / 8));
157 aBmp =
Bitmap(
Size(nWidth, nHeight), ePixelFormat);
160 assert(pWrite.
get());
163 std::optional<AlphaMask> pAlphaMask;
167 pAlphaMask.emplace(
Size(nWidth, nHeight) );
175 Scanline pScanline = pWrite->GetScanline(
y);
178 int bitIndex = (
y * nStride +
x) % 8;
180 pWrite->SetPixelOnData(pScanline,
x,
BitmapColor((*
p >> bitIndex) & 1));
189 Scanline pScanline = pWrite->GetScanline(
y);
195 else if ( bReversColors )
199 pWrite->SetPixelOnData(pScanline,
x,
col);
205 Scanline pMaskScanLine = xMaskAcc->GetScanline(
y);
230 auto nBitCount = rawBitmap.GetBitCount();
242 Bitmap aBmp(rawBitmap.maSize, ePixelFormat);
245 assert(pWrite.
get());
248 std::optional<AlphaMask> pAlphaMask;
252 pAlphaMask.emplace( rawBitmap.maSize );
256 auto nHeight = rawBitmap.maSize.getHeight();
257 auto nWidth = rawBitmap.maSize.getWidth();
261 sal_uInt8 const *
p = rawBitmap.mpData.get() + (
y * nStride);
262 Scanline pScanline = pWrite->GetScanline(
y);
266 pWrite->SetPixelOnData(pScanline,
x,
col);
271 p = rawBitmap.mpData.get() + (
y * nStride) + 3;
272 Scanline pMaskScanLine = xMaskAcc->GetScanline(
y);
290#if ENABLE_CAIRO_CANVAS
296 cairo_surface_t *pPixels = cairo_surface_create_similar_image(pSurface,
297 CAIRO_FORMAT_ARGB32, aSize.
Width(), aSize.
Height());
298 cairo_t *pCairo = cairo_create( pPixels );
299 if( !pPixels || !pCairo || cairo_status(pCairo) != CAIRO_STATUS_SUCCESS )
305 cairo_set_source_surface( pCairo, pSurface, 0, 0 );
306 cairo_set_operator( pCairo, CAIRO_OPERATOR_SOURCE );
307 cairo_paint( pCairo );
322 cairo_surface_flush(pPixels);
323 unsigned char *pSrc = cairo_image_surface_get_data( pPixels );
324 unsigned int nStride = cairo_image_surface_get_stride( pPixels );
325#if !ENABLE_WASM_STRIP_PREMULTIPLY
330 sal_uInt32 *pPix =
reinterpret_cast<sal_uInt32 *
>(pSrc + nStride *
y);
333#if defined OSL_BIGENDIAN
344 if( nAlpha != 0 && nAlpha != 255 )
347#if ENABLE_WASM_STRIP_PREMULTIPLY
352 nR = unpremultiply_table[nAlpha][nR];
353 nG = unpremultiply_table[nAlpha][nG];
354 nB = unpremultiply_table[nAlpha][nB];
357 pRGBWrite->SetPixel( y, x,
BitmapColor( nR, nG, nB ) );
358 pMaskWrite->SetPixelIndex( y, x, nAlpha );
366 ::BitmapEx *pBitmapEx = new ::BitmapEx( aRGB, aMask );
368 cairo_destroy( pCairo );
369 cairo_surface_destroy( pPixels );
375 const ::basegfx::B2DHomMatrix& rTransform,
396 if( pReadAccess.
get() ==
nullptr ||
397 (pAlphaReadAccess.
get() ==
nullptr && rBitmap.
IsAlpha()) )
401 "transformBitmap(): could not access source bitmap" );
421 const Size aDestBmpSize( ::basegfx::fround( rDestRect.
getWidth() ),
422 ::basegfx::fround( rDestRect.
getHeight() ) );
440 if( pWriteAccess.
get() !=
nullptr &&
441 pAlphaWriteAccess.
get() !=
nullptr &&
442 rTransform.isInvertible() )
457 Scanline pScan = pWriteAccess->GetScanline(
y );
458 Scanline pScanAlpha = pAlphaWriteAccess->GetScanline(
y );
463 aPoint *= aTransform;
465 const int nSrcX( ::basegfx::fround( aPoint.
getX() ) );
466 const int nSrcY( ::basegfx::fround( aPoint.
getY() ) );
467 if( nSrcX < 0 || nSrcX >= aBmpSize.
Width() ||
468 nSrcY < 0 || nSrcY >= aBmpSize.
Height() )
470 pAlphaWriteAccess->SetPixelOnData( pScanAlpha,
x,
BitmapColor(0) );
475 pAlphaWriteAccess->SetPixelOnData( pScanAlpha,
x,
BitmapColor(aAlphaMap[ cAlphaIdx ]) );
476 pWriteAccess->SetPixelOnData( pScan,
x, pReadAccess->
GetPixel( nSrcY, nSrcX ) );
482 Scanline pScan = pWriteAccess->GetScanline(
y );
483 Scanline pScanAlpha = pAlphaWriteAccess->GetScanline(
y );
487 aPoint *= aTransform;
489 const int nSrcX( ::basegfx::fround( aPoint.
getX() ) );
490 const int nSrcY( ::basegfx::fround( aPoint.
getY() ) );
491 if( nSrcX < 0 || nSrcX >= aBmpSize.
Width() ||
492 nSrcY < 0 || nSrcY >= aBmpSize.
Height() )
494 pAlphaWriteAccess->SetPixelOnData( pScanAlpha,
x,
BitmapColor(0) );
498 pAlphaWriteAccess->SetPixelOnData( pScanAlpha,
x,
BitmapColor(255) );
499 pWriteAccess->SetPixelOnData( pScan,
x, pReadAccess->
GetPixel( nSrcY,
510 "transformBitmap(): could not access bitmap" );
532 assert(pOld &&
"Got no access to old alpha mask (!)");
534 const double fFactor(1.0 / 255.0);
536 if(bFixedTransparence)
538 const double fOpNew(1.0 - fTransparence);
542 Scanline pScanline = pOld->GetScanline(
y );
545 const double fOpOld(pOld->GetIndexFromData(pScanline,
x) * fFactor);
556 assert(pNew &&
"Got no access to new alpha mask (!)");
558 assert(pOld->Width() == pNew->Width() && pOld->Height() == pNew->Height() &&
559 "Alpha masks have different sizes (!)");
563 Scanline pScanline = pOld->GetScanline(
y );
566 const double fOpOld(pOld->GetIndexFromData(pScanline,
x) * fFactor);
567 const double fOpNew(pNew->GetIndexFromData(pScanline,
x) * fFactor);
585 MapMode aMapMode( MapUnit::Map100thMM );
587 const Size aOutputSizePixel( pVDev->LogicToPixel( rSize, aMapMode ) );
589 if ( aOutputSizePixel.
Width() && aOutputSizePixel.
Height() )
594 pVDev->SetMapMode( aMapMode );
595 pVDev->SetOutputSizePixel( aSizePixel );
598 pVDev->DrawPolyPolygon( aClip );
601 pVDev->EnableMapMode(
false );
602 const Bitmap aVDevMask(pVDev->GetBitmap(
Point(), aSizePixel));
616 const tools::Long nWidth(std::min(pR->Width(), pW->Width()));
617 const tools::Long nHeight(std::min(pR->Height(), pW->Height()));
621 Scanline pScanlineR = pR->GetScanline( nY );
622 Scanline pScanlineW = pW->GetScanline( nY );
625 const sal_uInt8 nIndR(pR->GetIndexFromData(pScanlineR, nX));
626 const sal_uInt8 nIndW(pW->GetIndexFromData(pScanlineW, nX));
630 const sal_uInt8 nCombined((nIndR * nIndW) >> 8);
632 pW->SetPixelOnData(pScanlineW, nX,
BitmapColor(nCombined));
656 return css::uno::Sequence< sal_Int8 >(
static_cast<sal_Int8 const *
>(aMem.
GetData()), aMem.
Tell() );
659 return css::uno::Sequence< sal_Int8 >();
664 bool bIsAlpha =
false;
675 for( nX = 0; nX < nWidth; nX++ )
680 nAlpha = data[ nOff ] = rColor.
GetIndex();
687 SAL_INFO(
"canvas.cairo",
"fallback to GetColor for alpha - slow, format: " <<
static_cast<int>(pAlphaReadAcc->
GetScanlineFormat()) );
688 for( nX = 0; nX < nWidth; nX++ )
715 bool bIsAlpha =
false;
720 data =
static_cast<unsigned char*
>(malloc( nWidth*nHeight*4 ));
724 unsigned int nAlpha = 255;
726#if !ENABLE_WASM_STRIP_PREMULTIPLY
729 for( nY = 0; nY < nHeight; nY++ )
738 if(
readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) )
741 for( nX = 0; nX < nWidth; nX++ )
745 nAlpha = data[ nOff++ ];
747 nAlpha = data[ nOff++ ] = 255;
750 nAlpha = data[ nOff + 3 ];
752 nAlpha = data[ nOff + 3 ] = 255;
757#if ENABLE_WASM_STRIP_PREMULTIPLY
762 data[ nOff++ ] = premultiply_table[nAlpha][aColor.
GetRed()];
763 data[ nOff++ ] = premultiply_table[nAlpha][aColor.
GetGreen()];
764 data[ nOff++ ] = premultiply_table[nAlpha][aColor.
GetBlue()];
767#if ENABLE_WASM_STRIP_PREMULTIPLY
772 data[ nOff++ ] = premultiply_table[nAlpha][aColor.
GetBlue()];
773 data[ nOff++ ] = premultiply_table[nAlpha][aColor.
GetGreen()];
774 data[ nOff++ ] = premultiply_table[nAlpha][aColor.
GetRed()];
783 if(
readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) )
786 for( nX = 0; nX < nWidth; nX++ )
790 nAlpha = data[ nOff ];
792 nAlpha = data[ nOff ] = 255;
793#if ENABLE_WASM_STRIP_PREMULTIPLY
798 data[ nOff + 3 ] = premultiply_table[nAlpha][*pReadScan++];
799 data[ nOff + 2 ] = premultiply_table[nAlpha][*pReadScan++];
800 data[ nOff + 1 ] = premultiply_table[nAlpha][*pReadScan++];
805 nAlpha = data[ nOff + 3 ];
807 nAlpha = data[ nOff + 3 ] = 255;
808#if ENABLE_WASM_STRIP_PREMULTIPLY
813 data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
814 data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
815 data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
824 if(
readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) )
827 for( nX = 0; nX < nWidth; nX++ )
831 nAlpha = data[ nOff++ ];
833 nAlpha = data[ nOff++ ] = 255;
834#if ENABLE_WASM_STRIP_PREMULTIPLY
839 data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
840 data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
841 data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
845 nAlpha = data[ nOff + 3 ];
847 nAlpha = data[ nOff + 3 ] = 255;
848#if ENABLE_WASM_STRIP_PREMULTIPLY
853 data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 2 ]];
854 data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 1 ]];
855 data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 0 ]];
865 if(
readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) )
868 for( nX = 0; nX < nWidth; nX++ )
872 nAlpha = data[ nOff++ ];
874 nAlpha = data[ nOff++ ] = 255;
875#if ENABLE_WASM_STRIP_PREMULTIPLY
880 data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 2 ]];
881 data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 1 ]];
882 data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 0 ]];
887 nAlpha = data[ nOff + 3 ];
889 nAlpha = data[ nOff + 3 ] = 255;
890#if ENABLE_WASM_STRIP_PREMULTIPLY
895 data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
896 data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
897 data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
907 if(
readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) )
910 for( nX = 0; nX < nWidth; nX++ )
914 nAlpha = data[ nOff ++ ];
916 nAlpha = data[ nOff ++ ] = 255;
917#if ENABLE_WASM_STRIP_PREMULTIPLY
922 data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
923 data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
924 data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
929 nAlpha = data[ nOff + 3 ];
931 nAlpha = data[ nOff + 3 ] = 255;
932#if ENABLE_WASM_STRIP_PREMULTIPLY
937 data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 2 ]];
938 data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 1 ]];
939 data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 0 ]];
947 SAL_INFO(
"canvas.cairo",
"fallback to GetColor - slow, format: " <<
static_cast<int>(pBitmapReadAcc->
GetScanlineFormat()) );
950 if(
readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) )
953 for( nX = 0; nX < nWidth; nX++ )
955 aColor = pBitmapReadAcc->
GetColor( nY, nX );
961 nAlpha = data[ nOff++ ];
963 nAlpha = data[ nOff++ ] = 255;
964#if ENABLE_WASM_STRIP_PREMULTIPLY
969 data[ nOff++ ] = premultiply_table[nAlpha][aColor.
GetRed()];
970 data[ nOff++ ] = premultiply_table[nAlpha][aColor.
GetGreen()];
971 data[ nOff++ ] = premultiply_table[nAlpha][aColor.
GetBlue()];
975 nAlpha = data[ nOff + 3 ];
977 nAlpha = data[ nOff + 3 ] = 255;
978#if ENABLE_WASM_STRIP_PREMULTIPLY
983 data[ nOff++ ] = premultiply_table[nAlpha][aColor.
GetBlue()];
984 data[ nOff++ ] = premultiply_table[nAlpha][aColor.
GetGreen()];
985 data[ nOff++ ] = premultiply_table[nAlpha][aColor.
GetRed()];
997 bHasAlpha = bIsAlpha;
1011 assert( pReadAccess );
1017 uno::Sequence< sal_Int8 > aRes( 4*aBmpSize.
Width()*aBmpSize.
Height() );
1025 if( pAlphaReadAccess.
get() !=
nullptr )
1029 x<aBmpSize.
Width() &&
x<rect.X2;
1035 pRes[ nCurrPos++ ] = 255 - pAlphaReadAccess->
GetIndexFromData( pScanlineReadAlpha,
x );
1041 x<aBmpSize.
Width() &&
x<rect.X2;
1064 for(sal_uInt16
a(0);
a < 8;
a++)
1066 for(sal_uInt16 b(0); b < 8; b++)
1068 if(pArray[(
a * 8) + b])
1070 pContent->SetPixelIndex(
a, b, 1);
1074 pContent->SetPixelIndex(
a, b, 0);
1100 bool foundSecondColor =
false;;
1104 if(!foundSecondColor)
1109 foundSecondColor =
true;
1113 std::swap( o_rFront, o_rBack );
1129#if ENABLE_WASM_STRIP_PREMULTIPLY
1132 return (a == 0) ? 0 : (c * 255 +
a / 2) / a;
1137 return (c * a + 127) / 255;
1147 return (
a == 0) ? 0 : (c * 255 +
a / 2) /
a;
1157 return (c *
a + 127) / 255;
1161 int a, std::integer_sequence<int, Is...>)
1167 std::integer_sequence<int, Is...>)
1175 std::make_integer_sequence<int, 256>{});
1176 return unpremultiply_table;
1180 int a, std::integer_sequence<int, Is...>)
1186 std::integer_sequence<int, Is...>)
1194 std::make_integer_sequence<int, 256>{});
1195 return premultiply_table;
1216 Scanline aResultScan = pResultBitmapAccess->GetScanline(nY);
1217 Scanline aResultScanAlpha = pResultAlphaAccess->GetScanline(nY);
1227 pResultBitmapAccess->SetPixelOnData(aResultScan, nX, aResultColor);
1228 pResultAlphaAccess->SetPixelOnData(aResultScanAlpha, nX, aResultColorAlpha);
1235 rResult =
BitmapEx(aResultBitmap, aResultAlpha);
1253 aBmp.
Crop( aSrcRect );
1262 Size aDstSizeTwip(std::abs(rDstSizeTwip.
Width()), std::abs(rDstSizeTwip.
Height()));
1265 const double fBmpPixelX = aBmpSize.
Width();
1266 const double fBmpPixelY = aBmpSize.
Height();
1267 const double fMaxPixelX
1270 const double fMaxPixelY
1275 if (((fBmpPixelX > (fMaxPixelX + 4)) ||
1276 (fBmpPixelY > (fMaxPixelY + 4))) &&
1277 (fBmpPixelY > 0.0) && (fMaxPixelY > 0.0))
1281 const double fBmpWH = fBmpPixelX / fBmpPixelY;
1282 const double fMaxWH = fMaxPixelX / fMaxPixelY;
1284 if (fBmpWH < fMaxWH)
1289 else if (fBmpWH > 0.0)
1296 aBmp.
Scale(aNewBmpSize);
vcl::ScopedBitmapAccess< BitmapWriteAccess, AlphaMask, &AlphaMask::AcquireAlphaWriteAccess > AlphaScopedWriteAccess
struct _cairo_surface cairo_surface_t
const StyleSettings & GetStyleSettings() const
Bitmap const & GetBitmap() const
void ReleaseAccess(BitmapReadAccess *pAccess)
static const AllSettings & GetSettings()
Gets the application's settings.
sal_uInt8 GetIndex() const
const AlphaMask & GetAlphaMask() const
Bitmap GetBitmap(Color aTransparentReplaceColor) const
const Size & GetSizePixel() const
tools::Long Height() const
tools::Long Width() const
const BitmapPalette & GetPalette() const
ScanlineFormat GetScanlineFormat() const
const BitmapColor & GetPaletteColor(sal_uInt16 nColor) const
sal_uInt8 GetPixelIndex(tools::Long nY, tools::Long nX) const
BitmapColor GetPixel(tools::Long nY, tools::Long nX) const
BitmapColor GetColor(tools::Long nY, tools::Long nX) const
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 Crop(const tools::Rectangle &rRectPixel)
Crop the bitmap.
Size GetSizePixel() const
static void ReleaseAccess(BitmapInfoAccess *pAccess)
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
Scale the bitmap.
BitmapReadAccess * AcquireReadAccess()
vcl::PixelFormat getPixelFormat() const
sal_uInt8 GetLuminance() const
sal_uInt8 GetBlue() const
sal_uInt8 GetAlpha() const
sal_uInt8 GetGreen() const
static VCL_DLLPUBLIC ImageTree & get()
VCL_DLLPUBLIC bool loadImage(OUString const &name, OUString const &style, BitmapEx &bitmap, bool localized, const ImageLoadFlags eFlags=ImageLoadFlags::NONE)
void SetOrigin(const Point &rOrigin)
void SetScaleY(const Fraction &rScaleY)
void SetScaleX(const Fraction &rScaleX)
constexpr tools::Long Y() const
constexpr tools::Long X() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
OUString DetermineIconTheme() const
Determine which icon theme should be used.
std::size_t ReadBytes(void *pData, std::size_t nSize)
sal_uInt64 remainingSize()
B2DVector getRange() const
void expand(const Tuple2D< TYPE > &rTuple)
This template handles BitmapAccess the RAII way.
Intended to be used to feed into CreateFromData to create a BitmapEx.
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define ENSURE_OR_THROW(c, m)
tools::Long FRound(double fVal)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_INFO(area, stream)
std::unique_ptr< sal_Int32[]> pData
RttiCompleteObjectLocator col
constexpr OUStringLiteral aData
B2IRange fround(const B2DRange &rRange)
Reference< XComponentContext > getProcessComponentContext()
rtl::Reference< BasePrimitive2D > Primitive2DReference
css::uno::Sequence< css::uno::Reference< css::graphic::XPrimitive2D > > Primitive2DSequence
void CanvasCairoExtractBitmapData(BitmapEx const &aBmpEx, Bitmap &aBitmap, unsigned char *&data, bool &bHasAlpha, tools::Long &rnWidth, tools::Long &rnHeight)
bool isHistorical8x8(const BitmapEx &rBitmapEx, Color &o_rBack, Color &o_rFront)
BitmapEx loadFromName(const OUString &rFileName, const ImageLoadFlags eFlags)
lookup_table const & get_unpremultiply_table()
static constexpr lookup_table make_unpremultiply_table_(std::integer_sequence< int, Is... >)
Bitmap GetDownsampledBitmap(Size const &rDstSizeTwip, Point const &rSrcPt, Size const &rSrcSz, Bitmap const &rBmp, tools::Long nMaxBmpDPIX, tools::Long nMaxBmpDPIY)
Retrieve downsampled and cropped bitmap.
static constexpr std::array< sal_uInt8, 256 > make_premultiply_table_row_(int a, std::integer_sequence< int, Is... >)
BitmapEx CanvasTransformBitmap(const BitmapEx &rBitmap, const ::basegfx::B2DHomMatrix &rTransform, ::basegfx::B2DRectangle const &rDestRect, ::basegfx::B2DHomMatrix const &rLocalTransform)
void DrawAlphaBitmapAndAlphaGradient(BitmapEx &rBitmapEx, bool bFixedTransparence, float fTransparence, AlphaMask &rNewMask)
void loadFromSvg(SvStream &rStream, const OUString &sPath, BitmapEx &rBitmapEx, double fScalingFactor)
static constexpr std::array< sal_uInt8, 256 > make_unpremultiply_table_row_(int a, std::integer_sequence< int, Is... >)
void DrawAndClipBitmap(const Point &rPos, const Size &rSize, const BitmapEx &rBitmap, BitmapEx &aBmpEx, basegfx::B2DPolyPolygon const &rClipPath)
static constexpr sal_uInt8 premultiplyImpl(sal_uInt8 c, sal_uInt8 a)
sal_uInt8 unpremultiply(sal_uInt8 c, sal_uInt8 a)
BitmapEx createHistorical8x8FromArray(std::array< sal_uInt8, 64 > const &pArray, Color aColorPix, Color aColorBack)
static bool readAlpha(BitmapReadAccess const *pAlphaReadAcc, tools::Long nY, const tools::Long nWidth, unsigned char *data, tools::Long nOff)
sal_uInt8 premultiply(sal_uInt8 c, sal_uInt8 a)
css::uno::Sequence< sal_Int8 > GetMaskDIB(BitmapEx const &aBmpEx)
uno::Sequence< sal_Int8 > CanvasExtractBitmapData(BitmapEx const &rBitmapEx, const geometry::IntegerRectangle2D &rect)
lookup_table const & get_premultiply_table()
BitmapEx CreateFromData(sal_uInt8 const *pData, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int32 nStride, sal_Int8 nBitCount, bool bReversColors, bool bReverseAlpha)
Copy block of image data into the bitmap.
std::array< std::array< sal_uInt8, 256 >, 256 > lookup_table
bool convertBitmap32To24Plus8(BitmapEx const &rInput, BitmapEx &rResult)
static constexpr lookup_table make_premultiply_table_(std::integer_sequence< int, Is... >)
static constexpr sal_uInt8 unpremultiplyImpl(sal_uInt8 c, sal_uInt8 a)
PixelFormat
Pixel format of the bitmap in bits per pixel.
std::unique_ptr< char[]> aBuffer