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#pragma once
21
22#include <com/sun/star/rendering/XCanvas.hpp>
23#include <com/sun/star/rendering/XBitmapCanvas.hpp>
24
27
29#include "dx_ibitmap.hxx"
30#include "dx_gdiplususer.hxx"
31#include "dx_impltools.hxx"
32#include "dx_canvashelper.hxx"
33
34
35namespace dxcanvas
36{
42 {
43 public:
45
47 void disposing();
48
54 void setTarget( const IBitmapSharedPtr& rTarget );
55
65 const ::basegfx::B2ISize& rOutputOffset );
66
67
68 // CanvasHelper functionality is implementation-inherited. yuck.
69 // =============================================================
70 void clear();
71
72 css::uno::Reference< css::rendering::XCachedPrimitive >
73 drawTextLayout( const css::rendering::XCanvas* pCanvas,
74 const css::uno::Reference<
75 css::rendering::XTextLayout >& laidOutText,
76 const css::rendering::ViewState& viewState,
77 const css::rendering::RenderState& renderState );
78
79 // BitmapCanvasHelper functionality
80 // ================================
81
82 void copyRect( const css::rendering::XCanvas* pCanvas,
83 const css::uno::Reference<
84 css::rendering::XBitmapCanvas >& sourceCanvas,
85 const css::geometry::RealRectangle2D& sourceRect,
86 const css::rendering::ViewState& sourceViewState,
87 const css::rendering::RenderState& sourceRenderState,
88 const css::geometry::RealRectangle2D& destRect,
89 const css::rendering::ViewState& destViewState,
90 const css::rendering::RenderState& destRenderState );
91
92 css::geometry::IntegerSize2D getSize();
93
94 css::uno::Reference< css::rendering::XBitmap >
95 getScaledBitmap( const css::geometry::RealSize2D& newSize,
96 bool beFast );
97
98 css::uno::Sequence< sal_Int8 >
99 getData( css::rendering::IntegerBitmapLayout& bitmapLayout,
100 const css::geometry::IntegerRectangle2D& rect );
101
102 void setData( const css::uno::Sequence< sal_Int8 >& data,
103 const css::rendering::IntegerBitmapLayout& bitmapLayout,
104 const css::geometry::IntegerRectangle2D& rect );
105
106 void setPixel( const css::uno::Sequence< sal_Int8 >& color,
107 const css::rendering::IntegerBitmapLayout& bitmapLayout,
108 const css::geometry::IntegerPoint2D& pos );
109
110 css::uno::Sequence< sal_Int8 >
111 getPixel( css::rendering::IntegerBitmapLayout& bitmapLayout,
112 const css::geometry::IntegerPoint2D& pos );
113
114 css::uno::Reference< css::rendering::XBitmapPalette > getPalette();
115
116 css::rendering::IntegerBitmapLayout getMemoryLayout();
117
118 bool hasAlpha() const;
119
120 protected:
123 };
124}
125
126/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Helper class for basic canvas functionality.
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.
Helper class for basic canvas functionality.
FilterGroup & rTarget
std::shared_ptr< IBitmap > IBitmapSharedPtr
Definition: dx_ibitmap.hxx:58