28#include <com/sun/star/rendering/CompositeOperation.hpp>
29#include <com/sun/star/rendering/PathCapType.hpp>
30#include <com/sun/star/rendering/PathJoinType.hpp>
31#include <com/sun/star/rendering/RepaintResult.hpp>
32#include <com/sun/star/rendering/TexturingMode.hpp>
33#include <rtl/math.hxx>
62 "BitmapCanvasHelper::setTarget(): Invalid target" );
64 "BitmapCanvasHelper::setTarget(): target set, old target would be overwritten" );
71 const ::basegfx::B2ISize& rOutputOffset )
74 "BitmapCanvasHelper::setTarget(): invalid target" );
76 "BitmapCanvasHelper::setTarget(): target set, old target would be overwritten" );
88 Gdiplus::Color aClearColor =
hasAlpha() ?
89 Gdiplus::Color( 0,255,255,255 ) : Gdiplus::Color(Gdiplus::ARGB(Gdiplus::Color::White));
92 Gdiplus::Ok == pGraphics->SetCompositingMode(
93 Gdiplus::CompositingModeSourceCopy ),
94 "BitmapCanvasHelper::clear(): GDI+ SetCompositingMode call failed" );
96 Gdiplus::Ok == pGraphics->Clear( aClearColor ),
97 "BitmapCanvasHelper::clear(): GDI+ Clear call failed" );
102 const uno::Reference< rendering::XTextLayout >& xLayoutetText,
103 const rendering::ViewState& viewState,
104 const rendering::RenderState& renderState )
107 "BitmapCanvasHelper::drawTextLayout: layout is NULL");
112 dynamic_cast< TextLayout*
>( xLayoutetText.get() );
115 "BitmapCanvasHelper::drawTextLayout(): TextLayout not compatible with this canvas" );
125 return uno::Reference< rendering::XCachedPrimitive >(
nullptr);
129 const uno::Reference< rendering::XBitmapCanvas >& ,
130 const geometry::RealRectangle2D& ,
131 const rendering::ViewState& ,
132 const rendering::RenderState& ,
133 const geometry::RealRectangle2D& ,
134 const rendering::ViewState& ,
135 const rendering::RenderState& )
143 return geometry::IntegerSize2D(1, 1);
151 return uno::Reference< rendering::XBitmap >();
155 const geometry::IntegerRectangle2D& rect )
157 SAL_INFO(
"canvas.directx",
"::dxcanvas::BitmapCanvasHelper::getData()" );
160 "::dxcanvas::BitmapCanvasHelper::getData(): disposed" );
163 return mpTarget->getData(bitmapLayout,rect);
167 const rendering::IntegerBitmapLayout& bitmapLayout,
168 const geometry::IntegerRectangle2D& rect )
170 SAL_INFO(
"canvas.directx",
"::dxcanvas::BitmapCanvasHelper::setData()" );
173 "::dxcanvas::BitmapCanvasHelper::setData(): disposed" );
175 mpTarget->setData(data,bitmapLayout,rect);
179 const rendering::IntegerBitmapLayout& bitmapLayout,
180 const geometry::IntegerPoint2D& pos )
182 SAL_INFO(
"canvas.directx",
"::dxcanvas::BitmapCanvasHelper::setPixel()" );
185 "::dxcanvas::BitmapCanvasHelper::setPixel(): disposed" );
191 const geometry::IntegerPoint2D& pos )
193 SAL_INFO(
"canvas.directx",
"::dxcanvas::BitmapCanvasHelper::getPixel()" );
196 "::dxcanvas::BitmapCanvasHelper::getPixel(): disposed" );
199 return mpTarget->getPixel(bitmapLayout,pos);
205 return uno::Reference< rendering::XBitmapPalette >();
211 return rendering::IntegerBitmapLayout();
css::geometry::IntegerSize2D getSize()
css::rendering::IntegerBitmapLayout getMemoryLayout()
IBitmapSharedPtr mpTarget
Render target.
void setPixel(const css::uno::Sequence< sal_Int8 > &color, const css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerPoint2D &pos)
css::uno::Reference< css::rendering::XCachedPrimitive > drawTextLayout(const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XTextLayout > &laidOutText, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
css::uno::Sequence< sal_Int8 > getData(css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect)
css::uno::Sequence< sal_Int8 > getPixel(css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerPoint2D &pos)
css::uno::Reference< css::rendering::XBitmap > getScaledBitmap(const css::geometry::RealSize2D &newSize, bool beFast)
void disposing()
Release all references.
void copyRect(const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XBitmapCanvas > &sourceCanvas, const css::geometry::RealRectangle2D &sourceRect, const css::rendering::ViewState &sourceViewState, const css::rendering::RenderState &sourceRenderState, const css::geometry::RealRectangle2D &destRect, const css::rendering::ViewState &destViewState, const css::rendering::RenderState &destRenderState)
css::uno::Reference< css::rendering::XBitmapPalette > getPalette()
void setData(const css::uno::Sequence< sal_Int8 > &data, const css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect)
void setTarget(const IBitmapSharedPtr &rTarget)
Set the target for rendering operations.
css::rendering::XGraphicDevice * mpDevice
Phyical output device.
::basegfx::B2ISize maOutputOffset
Current (transformation-independent) output buffer offset.
void setTarget(const GraphicsProviderSharedPtr &rTarget)
Set the target for rendering operations.
void disposing()
Release all references.
bool draw(const GraphicsSharedPtr &rGraphics, const css::rendering::ViewState &rViewState, const css::rendering::RenderState &rRenderState, const ::basegfx::B2ISize &rOutputOffset, const css::uno::Reference< css::rendering::XGraphicDevice > &xGraphicDevice, bool bAlphaSurface) const
#define ENSURE_OR_THROW(c, m)
#define SAL_INFO(area, stream)
std::shared_ptr< Gdiplus::Graphics > GraphicsSharedPtr
std::shared_ptr< IBitmap > IBitmapSharedPtr