LibreOffice Module basegfx (master) 1
canvastools.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/uno/Reference.hxx>
23#include <com/sun/star/uno/Sequence.hxx>
25
26
28{
29 struct AffineMatrix2D;
30 struct AffineMatrix3D;
31 struct RealPoint2D;
32 struct RealSize2D;
33 struct RealRectangle2D;
34 struct RealRectangle3D;
35 struct IntegerSize2D;
36 struct IntegerRectangle2D;
37 struct RealBezierSegment2D;
38}
39
41{
42 class XGraphicDevice;
43 class XPolyPolygon2D;
44}
45
46namespace com::sun::star::awt
47{
48 struct Rectangle;
49}
50
51namespace basegfx
52{
53 class B2DHomMatrix;
54 class B3DHomMatrix;
55 class B2DVector;
56 class B2DPoint;
57 class B2DRange;
58 class B3DRange;
59 class B2IVector;
60 class B2IRange;
61 class B2DPolygon;
62 class B2DPolyPolygon;
63 class B2DSize;
64 class B2ISize;
65}
66
67namespace basegfx::unotools
68{
69 // Polygon conversions
70
71
72 BASEGFX_DLLPUBLIC css::uno::Reference< css::rendering::XPolyPolygon2D >
73 xPolyPolygonFromB2DPolygon( const css::uno::Reference< css::rendering::XGraphicDevice >& xGraphicDevice,
74 const ::basegfx::B2DPolygon& rPoly );
75
76 BASEGFX_DLLPUBLIC css::uno::Reference< css::rendering::XPolyPolygon2D >
77 xPolyPolygonFromB2DPolyPolygon( const css::uno::Reference< css::rendering::XGraphicDevice >& xGraphicDevice,
78 const ::basegfx::B2DPolyPolygon& rPolyPoly );
79
80
81 css::uno::Sequence<
82 css::uno::Sequence< css::geometry::RealBezierSegment2D > >
83 bezierSequenceSequenceFromB2DPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly );
84
85 css::uno::Sequence<
86 css::uno::Sequence< css::geometry::RealPoint2D > >
87 pointSequenceSequenceFromB2DPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly );
88
90 const css::uno::Sequence< css::geometry::RealPoint2D >& rPoints );
91
92 BASEGFX_DLLPUBLIC ::basegfx::B2DPolyPolygon polyPolygonFromPoint2DSequenceSequence(
93 const css::uno::Sequence< css::uno::Sequence< css::geometry::RealPoint2D > >& rPoints );
94
96 const css::uno::Sequence< css::geometry::RealBezierSegment2D >& rPoints );
97
98 BASEGFX_DLLPUBLIC ::basegfx::B2DPolyPolygon polyPolygonFromBezier2DSequenceSequence(
99 const css::uno::Sequence< css::uno::Sequence< css::geometry::RealBezierSegment2D > >& rPoints );
100
101 BASEGFX_DLLPUBLIC ::basegfx::B2DPolyPolygon b2DPolyPolygonFromXPolyPolygon2D(
102 const css::uno::Reference< css::rendering::XPolyPolygon2D >& rPoly );
103
104 // Matrix conversions
105
106
107 BASEGFX_DLLPUBLIC css::geometry::AffineMatrix2D&
108 affineMatrixFromHomMatrix( css::geometry::AffineMatrix2D& matrix,
109 const ::basegfx::B2DHomMatrix& transform);
110
111 css::geometry::AffineMatrix3D& affineMatrixFromHomMatrix3D(
112 css::geometry::AffineMatrix3D& matrix,
113 const ::basegfx::B3DHomMatrix& transform);
114
115 BASEGFX_DLLPUBLIC ::basegfx::B2DHomMatrix&
117 const css::geometry::AffineMatrix2D& matrix );
118
119 BASEGFX_DLLPUBLIC ::basegfx::B3DHomMatrix homMatrixFromAffineMatrix3D( const css::geometry::AffineMatrix3D& matrix );
120
121 // Geometry conversions
122
123
124 BASEGFX_DLLPUBLIC css::geometry::RealSize2D size2DFromB2DSize( const ::basegfx::B2DSize& );
125 BASEGFX_DLLPUBLIC css::geometry::RealPoint2D point2DFromB2DPoint( const ::basegfx::B2DPoint& );
126 BASEGFX_DLLPUBLIC css::geometry::RealRectangle2D rectangle2DFromB2DRectangle( const ::basegfx::B2DRange& );
127 BASEGFX_DLLPUBLIC css::geometry::RealRectangle3D rectangle3DFromB3DRectangle( const ::basegfx::B3DRange& );
128
129 BASEGFX_DLLPUBLIC ::basegfx::B2DPoint b2DPointFromRealPoint2D( const css::geometry::RealPoint2D& );
130 BASEGFX_DLLPUBLIC ::basegfx::B2DRange b2DRectangleFromRealRectangle2D( const css::geometry::RealRectangle2D& );
131 ::basegfx::B3DRange b3DRectangleFromRealRectangle3D( const css::geometry::RealRectangle3D& );
132
133 BASEGFX_DLLPUBLIC css::geometry::IntegerSize2D integerSize2DFromB2ISize(basegfx::B2ISize const& rSize);
134
135 BASEGFX_DLLPUBLIC ::basegfx::B2ISize b2ISizeFromIntegerSize2D( const css::geometry::IntegerSize2D& );
136 BASEGFX_DLLPUBLIC ::basegfx::B2IRange b2IRectangleFromIntegerRectangle2D( const css::geometry::IntegerRectangle2D& );
137
138 BASEGFX_DLLPUBLIC ::basegfx::B2IRange b2IRectangleFromAwtRectangle( const css::awt::Rectangle& );
139
140 // Geometry comparisons
141
142
153 BASEGFX_DLLPUBLIC ::basegfx::B2IRange b2ISurroundingRangeFromB2DRange( const ::basegfx::B2DRange& rRange );
154
164 BASEGFX_DLLPUBLIC ::basegfx::B2DRange b2DSurroundingIntegerRangeFromB2DRange( const ::basegfx::B2DRange& rRange );
165}
166
167/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define BASEGFX_DLLPUBLIC
Definition: basegfxdllapi.h:35
geometry::AffineMatrix3D & affineMatrixFromHomMatrix3D(geometry::AffineMatrix3D &output, const ::basegfx::B3DHomMatrix &input)
::basegfx::B2DRange b2DSurroundingIntegerRangeFromB2DRange(const ::basegfx::B2DRange &rRange)
Return smalltest B2DRange with integer values, which completely contains given floating point range.
::basegfx::B3DRange b3DRectangleFromRealRectangle3D(const geometry::RealRectangle3D &rRect)
::basegfx::B2DPolyPolygon polyPolygonFromPoint2DSequenceSequence(const uno::Sequence< uno::Sequence< geometry::RealPoint2D > > &points)
geometry::AffineMatrix2D & affineMatrixFromHomMatrix(geometry::AffineMatrix2D &output, const ::basegfx::B2DHomMatrix &input)
::basegfx::B2IRange b2IRectangleFromIntegerRectangle2D(const geometry::IntegerRectangle2D &rRectangle)
geometry::RealRectangle2D rectangle2DFromB2DRectangle(const ::basegfx::B2DRange &rRect)
::basegfx::B2DPolyPolygon polyPolygonFromBezier2DSequenceSequence(const uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > > &curves)
::basegfx::B2DPolygon polygonFromBezier2DSequence(const uno::Sequence< geometry::RealBezierSegment2D > &curves)
uno::Reference< rendering::XPolyPolygon2D > xPolyPolygonFromB2DPolyPolygon(const uno::Reference< rendering::XGraphicDevice > &xGraphicDevice, const ::basegfx::B2DPolyPolygon &rPolyPoly)
::basegfx::B2DPoint b2DPointFromRealPoint2D(const geometry::RealPoint2D &rPoint)
::basegfx::B2DHomMatrix & homMatrixFromAffineMatrix(::basegfx::B2DHomMatrix &output, const geometry::AffineMatrix2D &input)
geometry::RealPoint2D point2DFromB2DPoint(const ::basegfx::B2DPoint &rPoint)
geometry::IntegerSize2D integerSize2DFromB2ISize(const ::basegfx::B2ISize &rSize)
::basegfx::B2DPolyPolygon b2DPolyPolygonFromXPolyPolygon2D(const uno::Reference< rendering::XPolyPolygon2D > &xPoly)
::basegfx::B2IRange b2IRectangleFromAwtRectangle(const awt::Rectangle &rRect)
basegfx::B2ISize b2ISizeFromIntegerSize2D(const geometry::IntegerSize2D &rSize)
::basegfx::B2DPolygon polygonFromPoint2DSequence(const uno::Sequence< geometry::RealPoint2D > &points)
geometry::RealRectangle3D rectangle3DFromB3DRectangle(const ::basegfx::B3DRange &rRect)
::basegfx::B2IRange b2ISurroundingRangeFromB2DRange(const ::basegfx::B2DRange &rRange)
Return smalltest integer range, which completely contains given floating point range.
uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > > bezierSequenceSequenceFromB2DPolyPolygon(const ::basegfx::B2DPolyPolygon &rPolyPoly)
Definition: canvastools.cxx:94
geometry::RealSize2D size2DFromB2DSize(const ::basegfx::B2DSize &rSize)
::basegfx::B2DRange b2DRectangleFromRealRectangle2D(const geometry::RealRectangle2D &rRect)
::basegfx::B3DHomMatrix homMatrixFromAffineMatrix3D(const ::css::geometry::AffineMatrix3D &input)
uno::Reference< rendering::XPolyPolygon2D > xPolyPolygonFromB2DPolygon(const uno::Reference< rendering::XGraphicDevice > &xGraphicDevice, const ::basegfx::B2DPolygon &rPoly)
uno::Sequence< uno::Sequence< geometry::RealPoint2D > > pointSequenceSequenceFromB2DPolyPolygon(const ::basegfx::B2DPolyPolygon &rPolyPoly)