LibreOffice Module canvas (master) 1
Public Member Functions | Protected Attributes | List of all members
dxcanvas::BitmapCanvasHelper Class Reference

Helper class for basic canvas functionality. More...

#include <dx_bitmapcanvashelper.hxx>

Inheritance diagram for dxcanvas::BitmapCanvasHelper:
[legend]
Collaboration diagram for dxcanvas::BitmapCanvasHelper:
[legend]

Public Member Functions

 BitmapCanvasHelper ()
 
void disposing ()
 Release all references. More...
 
void setTarget (const IBitmapSharedPtr &rTarget)
 Set the target for rendering operations. More...
 
void setTarget (const IBitmapSharedPtr &rTarget, const ::basegfx::B2ISize &rOutputOffset)
 Set the target for rendering operations. More...
 
void clear ()
 
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)
 
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::geometry::IntegerSize2D getSize ()
 
css::uno::Reference< css::rendering::XBitmap > getScaledBitmap (const css::geometry::RealSize2D &newSize, bool beFast)
 
css::uno::Sequence< sal_Int8getData (css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect)
 
void setData (const css::uno::Sequence< sal_Int8 > &data, const css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect)
 
void setPixel (const css::uno::Sequence< sal_Int8 > &color, const css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerPoint2D &pos)
 
css::uno::Sequence< sal_Int8getPixel (css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerPoint2D &pos)
 
css::uno::Reference< css::rendering::XBitmapPalette > getPalette ()
 
css::rendering::IntegerBitmapLayout getMemoryLayout ()
 
bool hasAlpha () const
 
- Public Member Functions inherited from dxcanvas::CanvasHelper
 CanvasHelper ()
 
 CanvasHelper (const CanvasHelper &)=delete
 make noncopyable More...
 
const CanvasHelperoperator= (const CanvasHelper &)=delete
 
void disposing ()
 Release all references. More...
 
void setDevice (css::rendering::XGraphicDevice &rDevice)
 Initialize canvas helper. More...
 
void setTarget (const GraphicsProviderSharedPtr &rTarget)
 Set the target for rendering operations. More...
 
void setTarget (const GraphicsProviderSharedPtr &rTarget, const ::basegfx::B2ISize &rOutputOffset)
 Set the target for rendering operations. More...
 
void clear ()
 
void drawPoint (const css::rendering::XCanvas *pCanvas, const css::geometry::RealPoint2D &aPoint, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
void drawLine (const css::rendering::XCanvas *pCanvas, const css::geometry::RealPoint2D &aStartPoint, const css::geometry::RealPoint2D &aEndPoint, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
void drawBezier (const css::rendering::XCanvas *pCanvas, const css::geometry::RealBezierSegment2D &aBezierSegment, const css::geometry::RealPoint2D &aEndPoint, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
css::uno::Reference< css::rendering::XCachedPrimitive > drawPolyPolygon (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
css::uno::Reference< css::rendering::XCachedPrimitive > strokePolyPolygon (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::rendering::StrokeAttributes &strokeAttributes)
 
css::uno::Reference< css::rendering::XCachedPrimitive > strokeTexturedPolyPolygon (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::uno::Sequence< css::rendering::Texture > &textures, const css::rendering::StrokeAttributes &strokeAttributes)
 
css::uno::Reference< css::rendering::XCachedPrimitive > strokeTextureMappedPolyPolygon (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::uno::Sequence< css::rendering::Texture > &textures, const css::uno::Reference< css::geometry::XMapping2D > &xMapping, const css::rendering::StrokeAttributes &strokeAttributes)
 
css::uno::Reference< css::rendering::XPolyPolygon2D > queryStrokeShapes (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::rendering::StrokeAttributes &strokeAttributes)
 
css::uno::Reference< css::rendering::XCachedPrimitive > fillPolyPolygon (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
css::uno::Reference< css::rendering::XCachedPrimitive > fillTexturedPolyPolygon (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::uno::Sequence< css::rendering::Texture > &textures)
 
css::uno::Reference< css::rendering::XCachedPrimitive > fillTextureMappedPolyPolygon (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::uno::Sequence< css::rendering::Texture > &textures, const css::uno::Reference< css::geometry::XMapping2D > &xMapping)
 
css::uno::Reference< css::rendering::XCanvasFont > createFont (const css::rendering::XCanvas *pCanvas, const css::rendering::FontRequest &fontRequest, const css::uno::Sequence< css::beans::PropertyValue > &extraFontProperties, const css::geometry::Matrix2D &fontMatrix)
 
css::uno::Sequence< css::rendering::FontInfo > queryAvailableFonts (const css::rendering::XCanvas *pCanvas, const css::rendering::FontInfo &aFilter, const css::uno::Sequence< css::beans::PropertyValue > &aFontProperties)
 
css::uno::Reference< css::rendering::XCachedPrimitive > drawText (const css::rendering::XCanvas *pCanvas, const css::rendering::StringContext &text, const css::uno::Reference< css::rendering::XCanvasFont > &xFont, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, sal_Int8 textDirection)
 
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::Reference< css::rendering::XCachedPrimitive > drawBitmap (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XBitmap > &xBitmap, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
css::uno::Reference< css::rendering::XCachedPrimitive > drawBitmapModulated (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XBitmap > &xBitmap, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
css::uno::Reference< css::rendering::XGraphicDevice > getDevice ()
 
void flush () const
 
void modifying ()
 Called from XCanvas base classes, to notify that content is about to change. More...
 

Protected Attributes

IBitmapSharedPtr mpTarget
 Render target. More...
 
- Protected Attributes inherited from dxcanvas::CanvasHelper
GDIPlusUserSharedPtr mpGdiPlusUser
 Refcounted global GDI+ state container. More...
 
css::rendering::XGraphicDevice * mpDevice
 Phyical output device. More...
 
GraphicsProviderSharedPtr mpGraphicsProvider
 Provides the Gdiplus::Graphics to render into. More...
 
::basegfx::B2ISize maOutputOffset
 Current (transformation-independent) output buffer offset. More...
 

Additional Inherited Members

- Protected Member Functions inherited from dxcanvas::CanvasHelper
bool needOutput () const
 
void setupGraphicsState (GraphicsSharedPtr const &rGraphics, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
Gdiplus::CompositingMode calcCompositingMode (sal_Int8 nMode)
 

Detailed Description

Helper class for basic canvas functionality.

Also offers optional backbuffer painting, when providing it with a second HDC to render into.

Definition at line 41 of file dx_bitmapcanvashelper.hxx.

Constructor & Destructor Documentation

◆ BitmapCanvasHelper()

dxcanvas::BitmapCanvasHelper::BitmapCanvasHelper ( )

Definition at line 49 of file dx_bitmapcanvashelper.cxx.

Member Function Documentation

◆ clear()

void dxcanvas::BitmapCanvasHelper::clear ( )

◆ copyRect()

void dxcanvas::BitmapCanvasHelper::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 
)

Definition at line 128 of file dx_bitmapcanvashelper.cxx.

◆ disposing()

void dxcanvas::BitmapCanvasHelper::disposing ( )

Release all references.

Definition at line 53 of file dx_bitmapcanvashelper.cxx.

References dxcanvas::CanvasHelper::disposing(), and mpTarget.

◆ drawTextLayout()

uno::Reference< rendering::XCachedPrimitive > dxcanvas::BitmapCanvasHelper::drawTextLayout ( const css::rendering::XCanvas *  pCanvas,
const css::uno::Reference< css::rendering::XTextLayout > &  laidOutText,
const css::rendering::ViewState viewState,
const css::rendering::RenderState &  renderState 
)

◆ getData()

css::uno::Sequence< sal_Int8 > dxcanvas::BitmapCanvasHelper::getData ( css::rendering::IntegerBitmapLayout &  bitmapLayout,
const css::geometry::IntegerRectangle2D &  rect 
)

◆ getMemoryLayout()

rendering::IntegerBitmapLayout dxcanvas::BitmapCanvasHelper::getMemoryLayout ( )

◆ getPalette()

uno::Reference< rendering::XBitmapPalette > dxcanvas::BitmapCanvasHelper::getPalette ( )

Definition at line 202 of file dx_bitmapcanvashelper.cxx.

◆ getPixel()

css::uno::Sequence< sal_Int8 > dxcanvas::BitmapCanvasHelper::getPixel ( css::rendering::IntegerBitmapLayout &  bitmapLayout,
const css::geometry::IntegerPoint2D &  pos 
)

◆ getScaledBitmap()

css::uno::Reference< css::rendering::XBitmap > dxcanvas::BitmapCanvasHelper::getScaledBitmap ( const css::geometry::RealSize2D &  newSize,
bool  beFast 
)

◆ getSize()

geometry::IntegerSize2D dxcanvas::BitmapCanvasHelper::getSize ( )

Definition at line 140 of file dx_bitmapcanvashelper.cxx.

References basegfx::unotools::integerSize2DFromB2ISize(), and mpTarget.

Referenced by getMemoryLayout().

◆ hasAlpha()

bool dxcanvas::BitmapCanvasHelper::hasAlpha ( ) const

Definition at line 215 of file dx_bitmapcanvashelper.cxx.

References mpTarget.

Referenced by clear().

◆ setData()

void dxcanvas::BitmapCanvasHelper::setData ( const css::uno::Sequence< sal_Int8 > &  data,
const css::rendering::IntegerBitmapLayout &  bitmapLayout,
const css::geometry::IntegerRectangle2D &  rect 
)

Definition at line 166 of file dx_bitmapcanvashelper.cxx.

References ENSURE_OR_THROW, mpTarget, and SAL_INFO.

◆ setPixel()

void dxcanvas::BitmapCanvasHelper::setPixel ( const css::uno::Sequence< sal_Int8 > &  color,
const css::rendering::IntegerBitmapLayout &  bitmapLayout,
const css::geometry::IntegerPoint2D &  pos 
)

Definition at line 178 of file dx_bitmapcanvashelper.cxx.

References ENSURE_OR_THROW, mpTarget, pos, and SAL_INFO.

◆ setTarget() [1/2]

void dxcanvas::BitmapCanvasHelper::setTarget ( const IBitmapSharedPtr rTarget)

Set the target for rendering operations.

Parameters
rTargetRender target

Definition at line 59 of file dx_bitmapcanvashelper.cxx.

References ENSURE_OR_THROW, mpTarget, rTarget, and dxcanvas::CanvasHelper::setTarget().

Referenced by dxcanvas::SpriteCanvasHelper::init().

◆ setTarget() [2/2]

void dxcanvas::BitmapCanvasHelper::setTarget ( const IBitmapSharedPtr rTarget,
const ::basegfx::B2ISize rOutputOffset 
)

Set the target for rendering operations.

Parameters
rTargetRender target
rOutputOffsetOutput offset in pixel

Definition at line 70 of file dx_bitmapcanvashelper.cxx.

References ENSURE_OR_THROW, mpTarget, rTarget, and dxcanvas::CanvasHelper::setTarget().

Member Data Documentation

◆ mpTarget

IBitmapSharedPtr dxcanvas::BitmapCanvasHelper::mpTarget
protected

The documentation for this class was generated from the following files: