summaryrefslogtreecommitdiffstats
path: root/src/helper/geom-pathstroke.h
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2015-07-11 18:20:59 +0000
committerLiam P. White <inkscapebrony@gmail.com>2015-07-11 18:20:59 +0000
commit0ea72b9451e2544b4966080e70c9e9689edd3109 (patch)
treef18829576fffd69edab0024bab7497cfaa18b0c9 /src/helper/geom-pathstroke.h
parentExtensions. Fix for Bug #1461346 (getposinlayer fails if height attribute is ... (diff)
downloadinkscape-0ea72b9451e2544b4966080e70c9e9689edd3109.tar.gz
inkscape-0ea72b9451e2544b4966080e70c9e9689edd3109.zip
Shit son, MROE FUCKING DOCS FUCKING EVERYWHERE IT'S A WONDER WE HAVE SPACE FOR A VECTOR GRAPHICS PROGRAM BETWEEN ALL THESE DOCS
(bzr r14242)
Diffstat (limited to 'src/helper/geom-pathstroke.h')
-rw-r--r--src/helper/geom-pathstroke.h50
1 files changed, 42 insertions, 8 deletions
diff --git a/src/helper/geom-pathstroke.h b/src/helper/geom-pathstroke.h
index 0cfb9f817..6697273cf 100644
--- a/src/helper/geom-pathstroke.h
+++ b/src/helper/geom-pathstroke.h
@@ -1,10 +1,11 @@
#ifndef INKSCAPE_HELPER_PATH_STROKE_H
#define INKSCAPE_HELPER_PATH_STROKE_H
-/* Author:
+/* Authors:
* Liam P. White
+ * Tavmjong Bah
*
- * Copyright (C) 2014-2015 Author
+ * Copyright (C) 2014-2015 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
@@ -26,21 +27,54 @@ enum LineCapType {
BUTT_FLAT,
BUTT_ROUND,
BUTT_SQUARE,
- BUTT_PEAK, // ?
+ BUTT_PEAK, // This is not a line ending supported by the SVG standard.
};
/**
+ * Strokes the path given by @a input.
+ * Joins may behave oddly if the width is negative.
+ *
+ * @param[in] input Input path.
+ * @param[in] width Stroke width.
+ * @param[in] miter Miter limit. Only used when @a join is one of JOIN_MITER, JOIN_MITER_CLIP, and JOIN_EXTRAPOLATE.
+ * @param[in] join Line join type used during offset. Member of LineJoinType enum.
+ * @param[in] cap Line cap type used during stroking. Member of LineCapType enum.
+ *
+ * @return Stroked path.
+ * If the input path is closed, the resultant vector will contain two paths.
+ * Otherwise, there should be only one in the output.
+ */
+Geom::PathVector outline(Geom::Path const& input, double width, double miter, LineJoinType join = JOIN_BEVEL, LineCapType cap = BUTT_FLAT);
+
+/**
* Offset the input path by @a width.
* Joins may behave oddly if the width is negative.
*
- * @param input
- * @param width Amount to offset.
- * @param miter Miter limit. Only used with JOIN_MITER, JOIN_MITER_CLIP, and JOIN_EXTRAPOLATE.
- * @param join
+ * @param[in] input Input path.
+ * @param[in] width Amount to offset.
+ * @param[in] miter Miter limit. Only used when @a join is one of JOIN_MITER, JOIN_MITER_CLIP, and JOIN_EXTRAPOLATE.
+ * @param[in] join Line join type used during offset. Member of LineJoinType enum.
+ *
+ * @return Offsetted output.
*/
Geom::Path half_outline(Geom::Path const& input, double width, double miter, LineJoinType join = JOIN_BEVEL);
-Geom::PathVector outline(Geom::Path const& input, double width, double miter, LineJoinType join = JOIN_BEVEL, LineCapType cap = BUTT_FLAT);
+/**
+ * Builds a join on the provided path.
+ * Joins may behave oddly if the width is negative.
+ *
+ * @param[inout] res The path to build the join on.
+ * The outgoing path (or a portion thereof) will be appended after the join is created.
+ * Previous segments may be modified as an optimization, beware!
+ *
+ * @param[in] outgoing The segment to append on the outgoing portion of the join.
+ * @param[in] in_tang The end tangent to consider on the input path.
+ * @param[in] out_tang The begin tangent to consider on the output path.
+ * @param[in] width
+ * @param[in] miter
+ * @param[in] join
+ */
+void outline_join(Geom::Path &res, Geom::Path const& outgoing, Geom::Point in_tang, Geom::Point out_tang, double width, double miter, LineJoinType join);
} // namespace Inkscape