Logo Search packages:      
Sourcecode: inkscape version File versions

bezier-utils.cpp File Reference


Detailed Description

Bezier interpolation for inkscape drawing code.

Definition in file bezier-utils.cpp.

#include <math.h>
#include <stdlib.h>
#include "bezier-utils.h"
#include <libnr/nr-point-fns.h>
#include <glib.h>
#include "isnan.h"

Go to the source code of this file.

Defines

#define __SP_BEZIER_UTILS_C__
#define B0(u)   ( ( 1.0 - u ) * ( 1.0 - u ) * ( 1.0 - u ) )
#define B1(u)   ( 3 * u * ( 1.0 - u ) * ( 1.0 - u ) )
#define B2(u)   ( 3 * u * u * ( 1.0 - u ) )
#define B3(u)   ( u * u * u )
#define BEZIER_ASSERT(b)   do { } while(0)
#define DOUBLE_ASSERT(x)   do { } while(0)
#define noBEZIER_DEBUG
#define SP_HUGE   1e5

Typedefs

typedef NR::Point BezierCurve []

Functions

static NR::Point bezier_pt (unsigned degree, NR::Point const V[], gdouble t)
static void chord_length_parameterize (NR::Point const d[], gdouble u[], unsigned len)
static double compute_hook (NR::Point const &a, NR::Point const &b, double const u, BezierCurve const bezCurve, double const tolerance)
static double compute_max_error_ratio (NR::Point const d[], double const u[], unsigned len, BezierCurve const bezCurve, double tolerance, unsigned *splitPoint)
static unsigned copy_without_nans_or_adjacent_duplicates (NR::Point const src[], unsigned src_len, NR::Point dest[])
static void estimate_bi (NR::Point b[4], unsigned ei, NR::Point const data[], double const u[], unsigned len)
static void estimate_lengths (NR::Point bezier[], NR::Point const data[], gdouble const u[], unsigned len, NR::Point const &tHat1, NR::Point const &tHat2)
static void generate_bezier (NR::Point b[], NR::Point const d[], gdouble const u[], unsigned len, NR::Point const &tHat1, NR::Point const &tHat2, double tolerance_sq)
static double lensq (NR::Point const p)
static gdouble NewtonRaphsonRootFind (BezierCurve const Q, NR::Point const &P, gdouble u)
static void reparameterize (NR::Point const d[], unsigned len, double u[], BezierCurve const bezCurve)
gint sp_bezier_fit_cubic (NR::Point *bezier, NR::Point const *data, gint len, gdouble error)
gint sp_bezier_fit_cubic_full (NR::Point bezier[], int split_points[], NR::Point const data[], gint const len, NR::Point const &tHat1, NR::Point const &tHat2, double const error, unsigned const max_beziers)
gint sp_bezier_fit_cubic_r (NR::Point bezier[], NR::Point const data[], gint const len, gdouble const error, unsigned const max_beziers)
static NR::Point sp_darray_center_tangent (NR::Point const d[], unsigned center, unsigned length)
NR::Point sp_darray_left_tangent (NR::Point const d[], unsigned const len, double const tolerance_sq)
NR::Point sp_darray_left_tangent (NR::Point const d[], unsigned const len)
NR::Point sp_darray_right_tangent (NR::Point const d[], unsigned const len, double const tolerance_sq)
static NR::Point sp_darray_right_tangent (NR::Point const d[], unsigned const len)
static NR::Point const unconstrained_tangent (0, 0)


Generated by  Doxygen 1.6.0   Back to index