LibreOffice Module canvas (master) 1
Public Member Functions | Private Attributes | List of all members
vclcanvas::CanvasBitmapHelper Class Reference

Helper class for basic canvasbitmap functionality. More...

#include <canvasbitmaphelper.hxx>

Inheritance diagram for vclcanvas::CanvasBitmapHelper:
[legend]
Collaboration diagram for vclcanvas::CanvasBitmapHelper:
[legend]

Public Member Functions

 CanvasBitmapHelper ()
 
void init (const BitmapEx &rBitmap, css::rendering::XGraphicDevice &rDevice, const OutDevProviderSharedPtr &rOutDevProvider)
 Set a new bitmap on this helper. More...
 
void disposing ()
 
void clear ()
 
css::geometry::IntegerSize2D getSize () const
 
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)
 
css::uno::Sequence< sal_Int8getPixel (css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerPoint2D &pos)
 
css::rendering::IntegerBitmapLayout getMemoryLayout () const
 
BitmapEx getBitmap () const
 
- Public Member Functions inherited from vclcanvas::CanvasHelper
 CanvasHelper ()
 Create canvas helper. More...
 
 CanvasHelper (const CanvasHelper &)=delete
 make noncopyable More...
 
const CanvasHelperoperator= (const CanvasHelper &)=delete
 
void disposing ()
 Release all references. More...
 
void init (css::rendering::XGraphicDevice &rDevice, const OutDevProviderSharedPtr &rOutDev, bool bProtect, bool bHaveAlpha)
 Initialize canvas helper. More...
 
void setOutDev (const OutDevProviderSharedPtr &rOutDev, bool bProtect)
 Set primary output device. More...
 
void setBackgroundOutDev (const OutDevProviderSharedPtr &rOutDev)
 Set secondary output device. More...
 
void clear ()
 
void drawLine (const css::rendering::XCanvas *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, const css::rendering::FontInfo &aFilter, const css::uno::Sequence< css::beans::PropertyValue > &aFontProperties)
 
css::uno::Reference< css::rendering::XCachedPrimitive > drawText (const css::rendering::XCanvas *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 ()
 
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)
 
css::uno::Sequence< sal_Int8getPixel (css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerPoint2D &pos)
 
css::rendering::IntegerBitmapLayout getMemoryLayout ()
 
bool repaint (const GraphicObjectSharedPtr &rGrf, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const ::Point &rPt, const ::Size &rSz, const GraphicAttr &rAttr) const
 Repaint a cached bitmap. More...
 
void flush () const
 Flush drawing queue. More...
 
int setupOutDevState (const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, ColorType eColorType) const
 
bool hasAlpha () const
 

Private Attributes

BitmapBackBufferSharedPtr mpBackBuffer
 
OutDevProviderSharedPtr mpOutDevReference
 

Additional Inherited Members

- Public Types inherited from vclcanvas::CanvasHelper
enum  ColorType {
  LINE_COLOR ,
  FILL_COLOR ,
  TEXT_COLOR ,
  IGNORE_COLOR
}
 
- Protected Attributes inherited from vclcanvas::CanvasHelper
css::rendering::XGraphicDevice * mpDevice
 Phyical output device. More...
 
OutDevProviderSharedPtr mpProtectedOutDevProvider
 Rendering to this outdev preserves its state. More...
 
OutDevProviderSharedPtr mpOutDevProvider
 Rendering to this outdev does not preserve its state. More...
 
OutDevProviderSharedPtr mp2ndOutDevProvider
 Rendering to this outdev does not preserve its state. More...
 
bool mbHaveAlpha
 When true, content is able to represent alpha. More...
 

Detailed Description

Helper class for basic canvasbitmap functionality.

Extends CanvasHelper with some CanvasBitmap specialities, such as alpha support.

Note that a plain CanvasHelper, although it does support the XBitmap interface, has no provision for alpha channel on VCL (at least no efficient one. If the alpha VDev one day gets part of SAL, we might change that).

Definition at line 40 of file canvasbitmaphelper.hxx.

Constructor & Destructor Documentation

◆ CanvasBitmapHelper()

vclcanvas::CanvasBitmapHelper::CanvasBitmapHelper ( )

Definition at line 37 of file canvasbitmaphelper.cxx.

Member Function Documentation

◆ clear()

void vclcanvas::CanvasBitmapHelper::clear ( )

Definition at line 74 of file canvasbitmaphelper.cxx.

References mpBackBuffer.

◆ disposing()

void vclcanvas::CanvasBitmapHelper::disposing ( )

◆ getBitmap()

BitmapEx vclcanvas::CanvasBitmapHelper::getBitmap ( ) const

Definition at line 166 of file canvasbitmaphelper.cxx.

References mpBackBuffer.

◆ getData()

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

◆ getMemoryLayout()

rendering::IntegerBitmapLayout vclcanvas::CanvasBitmapHelper::getMemoryLayout ( ) const

◆ getPixel()

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

◆ getScaledBitmap()

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

◆ getSize()

geometry::IntegerSize2D vclcanvas::CanvasBitmapHelper::getSize ( ) const

Definition at line 66 of file canvasbitmaphelper.cxx.

References vcl::unotools::integerSize2DFromSize(), and mpBackBuffer.

Referenced by getMemoryLayout().

◆ init()

void vclcanvas::CanvasBitmapHelper::init ( const BitmapEx rBitmap,
css::rendering::XGraphicDevice &  rDevice,
const OutDevProviderSharedPtr rOutDevProvider 
)

Set a new bitmap on this helper.

This method late-initializes the bitmap canvas helper, providing it with the necessary device and output objects. The internally stored bitmap representation is updated from the given bitmap, including any size changes. Note that the CanvasHelper does not take ownership of the SpriteCanvas object, nor does it perform any reference counting. Thus, to prevent reference counted objects from deletion, the user of this class is responsible for holding ref-counted references to those objects!

Parameters
rBitmapContent of this bitmap is used as our new content (our internal size is adapted to the size of the bitmap given)
rDeviceReference device for this canvas bitmap
rOutDevProviderReference output device. Used to create matching bitmap.

Definition at line 41 of file canvasbitmaphelper.cxx.

References vclcanvas::CanvasHelper::init(), BitmapEx::IsAlpha(), mpBackBuffer, and mpOutDevReference.

Member Data Documentation

◆ mpBackBuffer

BitmapBackBufferSharedPtr vclcanvas::CanvasBitmapHelper::mpBackBuffer
private

◆ mpOutDevReference

OutDevProviderSharedPtr vclcanvas::CanvasBitmapHelper::mpOutDevReference
private

Definition at line 102 of file canvasbitmaphelper.hxx.

Referenced by disposing(), getScaledBitmap(), and init().


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