summaryrefslogtreecommitdiff
path: root/basegfx/inc
diff options
context:
space:
mode:
authorhdu <duerr@sun.com>2009-10-21 18:16:37 +0200
committerhdu <duerr@sun.com>2009-10-21 18:16:37 +0200
commit61b3bb859f1f9150a68edd307c0367bb89ab69c5 (patch)
treecb48d613d494f2322ce3c8b3ef0236ad372edec4 /basegfx/inc
parent8ba680819eb86d89f62886e984c7ee558fe7473d (diff)
#i106127# perf: add B2DCubicBezier::getMaxDistancePositions ( ) to allow better bezier-subdivisions
Diffstat (limited to 'basegfx/inc')
-rw-r--r--basegfx/inc/basegfx/curve/b2dcubicbezier.hxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/basegfx/inc/basegfx/curve/b2dcubicbezier.hxx b/basegfx/inc/basegfx/curve/b2dcubicbezier.hxx
index 4dc2f45568f1..81be451499ea 100644
--- a/basegfx/inc/basegfx/curve/b2dcubicbezier.hxx
+++ b/basegfx/inc/basegfx/curve/b2dcubicbezier.hxx
@@ -203,6 +203,22 @@ namespace basegfx
sense to use reserve(4) at the vector as preparation.
*/
void getAllExtremumPositions(::std::vector< double >& rResults) const;
+
+ /** Get optimum-split position on this segment
+
+ This method calculates the positions of all points of the segment
+ that have the maximimum distance to the corresponding line from
+ startpoint-endpoint. This helps to approximate the bezier curve
+ with a minimum number of line segments
+
+ @param fResults
+ Result positions are in the range ]0.0 .. 1.0[
+ Cubic beziers have at most two of these positions
+
+ @return
+ Returns the number of split positions found
+ */
+ int getMaxDistancePositions( double fResults[2]) const;
};
} // end of namespace basegfx