LibreOffice Module canvas (master) 1
|
Helper class for basic canvasbitmap functionality. More...
#include <canvasbitmaphelper.hxx>
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_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::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 CanvasHelper & | operator= (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_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::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... | |
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.
vclcanvas::CanvasBitmapHelper::CanvasBitmapHelper | ( | ) |
Definition at line 37 of file canvasbitmaphelper.cxx.
void vclcanvas::CanvasBitmapHelper::clear | ( | ) |
Definition at line 74 of file canvasbitmaphelper.cxx.
References mpBackBuffer.
void vclcanvas::CanvasBitmapHelper::disposing | ( | ) |
Definition at line 57 of file canvasbitmaphelper.cxx.
References vclcanvas::CanvasHelper::disposing(), mpBackBuffer, and mpOutDevReference.
BitmapEx vclcanvas::CanvasBitmapHelper::getBitmap | ( | ) | const |
Definition at line 166 of file canvasbitmaphelper.cxx.
References mpBackBuffer.
uno::Sequence< sal_Int8 > vclcanvas::CanvasBitmapHelper::getData | ( | css::rendering::IntegerBitmapLayout & | bitmapLayout, |
const css::geometry::IntegerRectangle2D & | rect | ||
) |
Definition at line 101 of file canvasbitmaphelper.cxx.
References vcl::bitmap::CanvasExtractBitmapData(), getMemoryLayout(), Size::Height(), mpBackBuffer, SAL_INFO, and Size::Width().
rendering::IntegerBitmapLayout vclcanvas::CanvasBitmapHelper::getMemoryLayout | ( | ) | const |
Definition at line 154 of file canvasbitmaphelper.cxx.
References getSize(), canvas::tools::getStdColorSpaceWithoutAlpha(), canvas::tools::getStdMemoryLayout(), vclcanvas::CanvasHelper::hasAlpha(), and vclcanvas::CanvasHelper::mpOutDevProvider.
Referenced by getData(), and getPixel().
uno::Sequence< sal_Int8 > vclcanvas::CanvasBitmapHelper::getPixel | ( | css::rendering::IntegerBitmapLayout & | bitmapLayout, |
const css::geometry::IntegerPoint2D & | pos | ||
) |
Definition at line 122 of file canvasbitmaphelper.cxx.
References ENSURE_ARG_OR_THROW, Color::GetAlpha(), Color::GetBlue(), Color::GetGreen(), getMemoryLayout(), Color::GetRed(), Size::Height(), mpBackBuffer, pos, SAL_INFO, and Size::Width().
uno::Reference< rendering::XBitmap > vclcanvas::CanvasBitmapHelper::getScaledBitmap | ( | const css::geometry::RealSize2D & | newSize, |
bool | beFast | ||
) |
Definition at line 81 of file canvasbitmaphelper.cxx.
References ENSURE_OR_THROW, mpBackBuffer, vclcanvas::CanvasHelper::mpDevice, mpOutDevReference, SAL_INFO, BitmapEx::Scale(), and vcl::unotools::sizeFromRealSize2D().
geometry::IntegerSize2D vclcanvas::CanvasBitmapHelper::getSize | ( | ) | const |
Definition at line 66 of file canvasbitmaphelper.cxx.
References vcl::unotools::integerSize2DFromSize(), and mpBackBuffer.
Referenced by getMemoryLayout().
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!
rBitmap | Content of this bitmap is used as our new content (our internal size is adapted to the size of the bitmap given) |
rDevice | Reference device for this canvas bitmap |
rOutDevProvider | Reference output device. Used to create matching bitmap. |
Definition at line 41 of file canvasbitmaphelper.cxx.
References vclcanvas::CanvasHelper::init(), BitmapEx::IsAlpha(), mpBackBuffer, and mpOutDevReference.
|
private |
Definition at line 101 of file canvasbitmaphelper.hxx.
Referenced by clear(), disposing(), getBitmap(), getData(), getPixel(), getScaledBitmap(), getSize(), and init().
|
private |
Definition at line 102 of file canvasbitmaphelper.hxx.
Referenced by disposing(), getScaledBitmap(), and init().