FastLED 3.9.15
Loading...
Searching...
No Matches

◆ safeCopy()

template<typename NumberT = float>
template<typename VectorType>
void fl::LineSimplifierExact< NumberT >::safeCopy ( const fl::span< const Point > & polyLine,
VectorType * out )
inlineprivate

Definition at line 333 of file line_simplification.h.

333 {
334 auto *first_out = out->data();
335 // auto* last_out = first_out + mCount;
336 auto *other_first_out = polyLine.data();
337 // auto* other_last_out = other_first_out + polyLine.size();
338 const bool is_same = first_out == other_first_out;
339 if (is_same) {
340 return;
341 }
342 auto *last_out = first_out + mCount;
343 auto *other_last_out = other_first_out + polyLine.size();
344
345 const bool is_overlapping =
348
349 if (!is_overlapping) {
350 out->assign(polyLine.data(), polyLine.data() + polyLine.size());
351 return;
352 }
353
354 // allocate a temporary buffer
356 temp.assign(polyLine.begin(), polyLine.end());
357 out->assign(temp.begin(), temp.end());
358 return;
359 }

References fl::vector< T >::assign(), fl::span< T, Extent >::begin(), fl::vector< T >::begin(), fl::span< T, Extent >::data(), fl::span< T, Extent >::end(), fl::vector< T >::end(), mCount, and fl::span< T, Extent >::size().

Referenced by simplify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: