From: cilix42 Date: Sun, 18 May 2008 18:31:07 +0000 (+0000) Subject: Convenience access functions for first and last value of a Geom::Piecewise<> X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=12195ae69e60137e28c7c61a620c1617565269a0;p=inkscape.git Convenience access functions for first and last value of a Geom::Piecewise<> --- diff --git a/src/2geom/piecewise.h b/src/2geom/piecewise.h index d548ea0e9..3b115cb95 100644 --- a/src/2geom/piecewise.h +++ b/src/2geom/piecewise.h @@ -73,6 +73,12 @@ class Piecewise { unsigned n = segN(t); return segs[n](segT(t, n)); } + inline output_type firstValue() const { + return valueAt(cuts.front()); + } + inline output_type lastValue() const { + return valueAt(cuts.back()); + } std::vector valueAndDerivatives(double t, unsigned cnt) const { unsigned n = segN(t); std::vector ret, val = segs[n].valueAndDerivatives(segT(t, n), cnt);