LibreOffice Module canvas (master)  1
dx_bitmapcanvashelper.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_CANVAS_SOURCE_DIRECTX_DX_BITMAPCANVASHELPER_HXX
21 #define INCLUDED_CANVAS_SOURCE_DIRECTX_DX_BITMAPCANVASHELPER_HXX
22 
23 #include <com/sun/star/rendering/XCanvas.hpp>
24 #include <com/sun/star/rendering/XBitmapCanvas.hpp>
25 
28 
29 #include "dx_graphicsprovider.hxx"
30 #include "dx_ibitmap.hxx"
31 #include "dx_gdiplususer.hxx"
32 #include "dx_impltools.hxx"
33 #include "dx_canvashelper.hxx"
34 
35 
36 namespace dxcanvas
37 {
43  {
44  public:
46 
48  void disposing();
49 
55  void setTarget( const IBitmapSharedPtr& rTarget );
56 
65  void setTarget( const IBitmapSharedPtr& rTarget,
66  const ::basegfx::B2ISize& rOutputOffset );
67 
68 
69  // CanvasHelper functionality is implementation-inherited. yuck.
70  // =============================================================
71  void clear();
72 
73  css::uno::Reference< css::rendering::XCachedPrimitive >
74  drawTextLayout( const css::rendering::XCanvas* pCanvas,
75  const css::uno::Reference<
76  css::rendering::XTextLayout >& laidOutText,
77  const css::rendering::ViewState& viewState,
78  const css::rendering::RenderState& renderState );
79 
80  // BitmapCanvasHelper functionality
81  // ================================
82 
83  void copyRect( const css::rendering::XCanvas* pCanvas,
84  const css::uno::Reference<
85  css::rendering::XBitmapCanvas >& sourceCanvas,
86  const css::geometry::RealRectangle2D& sourceRect,
87  const css::rendering::ViewState& sourceViewState,
88  const css::rendering::RenderState& sourceRenderState,
89  const css::geometry::RealRectangle2D& destRect,
90  const css::rendering::ViewState& destViewState,
91  const css::rendering::RenderState& destRenderState );
92 
93  css::geometry::IntegerSize2D getSize();
94 
95  css::uno::Reference< css::rendering::XBitmap >
96  getScaledBitmap( const css::geometry::RealSize2D& newSize,
97  bool beFast );
98 
99  css::uno::Sequence< sal_Int8 >
100  getData( css::rendering::IntegerBitmapLayout& bitmapLayout,
101  const css::geometry::IntegerRectangle2D& rect );
102 
103  void setData( const css::uno::Sequence< sal_Int8 >& data,
104  const css::rendering::IntegerBitmapLayout& bitmapLayout,
105  const css::geometry::IntegerRectangle2D& rect );
106 
107  void setPixel( const css::uno::Sequence< sal_Int8 >& color,
108  const css::rendering::IntegerBitmapLayout& bitmapLayout,
109  const css::geometry::IntegerPoint2D& pos );
110 
111  css::uno::Sequence< sal_Int8 >
112  getPixel( css::rendering::IntegerBitmapLayout& bitmapLayout,
113  const css::geometry::IntegerPoint2D& pos );
114 
115  css::uno::Reference< css::rendering::XBitmapPalette > getPalette();
116 
117  css::rendering::IntegerBitmapLayout getMemoryLayout();
118 
119  bool hasAlpha() const;
120 
121  protected:
124  };
125 }
126 
127 #endif // INCLUDED_CANVAS_SOURCE_DIRECTX_DX_BITMAPCANVASHELPER_HXX
128 
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Helper class for basic canvas functionality.
css::uno::Reference< css::rendering::XBitmapPalette > getPalette()
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)
std::shared_ptr< IBitmap > IBitmapSharedPtr
Definition: dx_ibitmap.hxx:59
css::uno::Sequence< sal_Int8 > getData(css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect)
void setTarget(const IBitmapSharedPtr &rTarget)
Set the target for rendering operations.
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::Reference< css::rendering::XBitmap > getScaledBitmap(const css::geometry::RealSize2D &newSize, bool beFast)
Helper class for basic canvas functionality.
css::rendering::IntegerBitmapLayout getMemoryLayout()
void disposing()
Release all references.
css::uno::Sequence< sal_Int8 > getPixel(css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerPoint2D &pos)
css::geometry::IntegerSize2D getSize()
IBitmapSharedPtr mpTarget
Render target.
void setData(const css::uno::Sequence< sal_Int8 > &data, const css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect)