| 269 | } |
| 270 | |
| 271 | Expected<CurveFunc> curveFromPoints( const CurvePoints& cp, float* outCurveLen ) |
| 272 | { |
| 273 | MR_TIMER; |
| 274 | auto maybeLens = findPartialLens( cp, outCurveLen ); |
| 275 | if ( !maybeLens ) |
| 276 | return unexpected( std::move( maybeLens.error() ) ); |
| 277 | |
| 278 | CurveFunc res; |
| 279 | res.totalLength = maybeLens->back(); |
| 280 | res.func = [&cp, lens = std::move( *maybeLens )] ( float p ) |
| 281 | { |
| 282 | return getCurvePoint( cp, lens, p ); |
| 283 | }; |
| 284 | return res; |
| 285 | } |
| 286 | |
| 287 | Expected<CurveFunc> curveFromPoints( CurvePoints&& cp, float * outCurveLen ) |
| 288 | { |
no test coverage detected