From cca66b9ec4e494c1d919bff0f71a820d8afab1fa Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:24:48 +0200 Subject: Adding upstream version 1.2.2. Signed-off-by: Daniel Baumann --- src/3rdparty/2geom/include/toys/path-cairo.h | 57 ++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/3rdparty/2geom/include/toys/path-cairo.h (limited to 'src/3rdparty/2geom/include/toys/path-cairo.h') diff --git a/src/3rdparty/2geom/include/toys/path-cairo.h b/src/3rdparty/2geom/include/toys/path-cairo.h new file mode 100644 index 0000000..4c0403f --- /dev/null +++ b/src/3rdparty/2geom/include/toys/path-cairo.h @@ -0,0 +1,57 @@ +#ifndef PATH_CAIRO +#define PATH_CAIRO + + +#include +#include <2geom/line.h> +#include <2geom/sbasis.h> +#include <2geom/sbasis-2d.h> +#include <2geom/d2.h> +#include <2geom/piecewise.h> +#include <2geom/path.h> +#include <2geom/convex-hull.h> +#include +#include + +typedef struct _cairo cairo_t; + +void cairo_curve(cairo_t *cr, Geom::Curve const &c); +void cairo_rectangle(cairo_t *cr, Geom::Rect const &r); +void cairo_convex_hull(cairo_t *cr, Geom::ConvexHull const &r); +void cairo_path(cairo_t *cr, Geom::Path const &p); +void cairo_path(cairo_t *cr, Geom::PathVector const &p); +void cairo_path_stitches(cairo_t *cr, Geom::Path const &p); +void cairo_path_stitches(cairo_t *cr, Geom::PathVector const &p); + +void cairo_d2_sb(cairo_t *cr, Geom::D2 const &p); +void cairo_d2_sb_handles(cairo_t *cr, Geom::D2 const &p); +void cairo_d2_sb2d(cairo_t* cr, Geom::D2 const &sb2, Geom::Point dir, double width); +void cairo_sb2d(cairo_t* cr, Geom::SBasis2d const &sb2, Geom::Point dir, double width); + +void cairo_d2_pw_sb(cairo_t *cr, Geom::D2 > const &p); +void cairo_pw_d2_sb(cairo_t *cr, Geom::Piecewise > const &p); + + +void draw_line(cairo_t *cr, const Geom::Line& l, const Geom::Rect& r); +void draw_line(cairo_t *cr, Geom::Point n, double d, Geom::Rect r); +void draw_line(cairo_t *cr, Geom::Point a, Geom::Point b, Geom::Rect r); + +void draw_line_seg(cairo_t *cr, Geom::Point a, Geom::Point b); +void draw_line_seg_with_arrow(cairo_t *cr, Geom::Point a, Geom::Point b, double dangle = 15*M_PI/180, double radius = 20); +void draw_spot(cairo_t *cr, Geom::Point h); +void draw_handle(cairo_t *cr, Geom::Point h); +void draw_cross(cairo_t *cr, Geom::Point h); +void draw_circ(cairo_t *cr, Geom::Point h); +void draw_ray(cairo_t *cr, Geom::Point h, Geom::Point dir); +void draw_ray(cairo_t *cr, const Geom::Ray& ray, const Geom::Rect& r); +void draw_line_segment(cairo_t *cr, const Geom::LineSegment& ls, const Geom::Rect& r); + +void cairo_move_to(cairo_t *cr, Geom::Point p1); +void cairo_line_to(cairo_t *cr, Geom::Point p1); +void cairo_curve_to(cairo_t *cr, Geom::Point p1, Geom::Point p2, Geom::Point p3); + +// H in [0,360) +// S, V, R, G, B in [0,1] +void convertHSVtoRGB(const double H, const double S, const double V, + double& R, double& G, double& B); +#endif -- cgit v1.2.3