Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
sbasis-to-bezier.h
Go to the documentation of this file.
1/*
5 * Authors:
6 * ? <?@?.?>
7 *
8 * Copyright ?-? authors
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it either under the terms of the GNU Lesser General Public
12 * License version 2.1 as published by the Free Software Foundation
13 * (the "LGPL") or, at your option, under the terms of the Mozilla
14 * Public License Version 1.1 (the "MPL"). If you do not alter this
15 * notice, a recipient may use your version of this file under either
16 * the MPL or the LGPL.
17 *
18 * You should have received a copy of the LGPL along with this library
19 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * You should have received a copy of the MPL along with this library
22 * in the file COPYING-MPL-1.1
23 *
24 * The contents of this file are subject to the Mozilla Public License
25 * Version 1.1 (the "License"); you may not use this file except in
26 * compliance with the License. You may obtain a copy of the License at
27 * http://www.mozilla.org/MPL/
28 *
29 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
30 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
31 * the specific language governing rights and limitations.
32 *
33 */
34
35#ifndef LIB2GEOM_SEEN_SBASIS_TO_BEZIER_H
36#define LIB2GEOM_SEEN_SBASIS_TO_BEZIER_H
37
38#include <2geom/d2.h>
39#include <2geom/pathvector.h>
40
41#include <vector>
42
43namespace Geom {
44
45class PathBuilder;
46
47void sbasis_to_bezier (Bezier &bz, SBasis const &sb, size_t sz = 0);
48void sbasis_to_bezier (D2<Bezier> &bz, D2<SBasis> const &sb, size_t sz = 0);
49void sbasis_to_bezier (std::vector<Point> & bz, D2<SBasis> const& sb, size_t sz = 0);
50void sbasis_to_cubic_bezier (std::vector<Point> & bz, D2<SBasis> const& sb);
51void bezier_to_sbasis (SBasis & sb, Bezier const& bz);
52void bezier_to_sbasis (D2<SBasis> & sb, std::vector<Point> const& bz);
53void build_from_sbasis(PathBuilder &pb, D2<SBasis> const &B, double tol, bool only_cubicbeziers);
54
55#if 0
56// this produces a degree k bezier from a degree k sbasis
57Bezier
58sbasis_to_bezier(SBasis const &B, unsigned q = 0);
59
60// inverse
62
63
64std::vector<Geom::Point>
65sbasis_to_bezier(D2<SBasis> const &B, unsigned q = 0);
66#endif
67
68
69PathVector path_from_piecewise(Piecewise<D2<SBasis> > const &B, double tol, bool only_cubicbeziers = false);
70
71Path path_from_sbasis(D2<SBasis> const &B, double tol, bool only_cubicbeziers = false);
72inline Path cubicbezierpath_from_sbasis(D2<SBasis> const &B, double tol)
73 { return path_from_sbasis(B, tol, true); }
74
75} // end namespace Geom
76
77#endif
78/*
79 Local Variables:
80 mode:c++
81 c-file-style:"stroustrup"
82 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
83 indent-tabs-mode:nil
84 fill-column:99
85 End:
86*/
87// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
Polynomial in Bernstein-Bezier basis.
Definition bezier.h:126
Adaptor that creates 2D functions from 1D ones.
Definition d2.h:55
Sequence of subpaths.
Definition pathvector.h:122
Sequence of contiguous curves, aka spline.
Definition path.h:353
Function defined as discrete pieces.
Definition piecewise.h:71
Polynomial in symmetric power basis.
Definition sbasis.h:70
Lifts one dimensional objects into 2D.
Various utility functions.
Definition affine.h:22
Path path_from_sbasis(D2< SBasis > const &B, double tol, bool only_cubicbeziers=false)
Make a path from a d2 sbasis.
void sbasis_to_cubic_bezier(std::vector< Point > &bz, D2< SBasis > const &sb)
Changes the basis of p to be Bernstein.
void build_from_sbasis(PathBuilder &pb, D2< SBasis > const &B, double tol, bool only_cubicbeziers)
Make a path from a d2 sbasis.
PathVector path_from_piecewise(Piecewise< D2< SBasis > > const &B, double tol, bool only_cubicbeziers=false)
Make a path from a d2 sbasis.
Path cubicbezierpath_from_sbasis(D2< SBasis > const &B, double tol)
void sbasis_to_bezier(Bezier &bz, SBasis const &sb, size_t sz=0)
Changes the basis of p to be bernstein.
SBasis bezier_to_sbasis(Coord const *handles, unsigned order)
PathVector - a sequence of subpaths.