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

◆ safeCopy()

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

Definition at line 332 of file line_simplification.h.

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

References fl::InlinedVector< T, INLINED_SIZE >::assign(), fl::InlinedVector< T, INLINED_SIZE >::begin(), fl::Slice< T >::begin(), fl::Slice< T >::data(), fl::InlinedVector< T, INLINED_SIZE >::end(), fl::Slice< T >::end(), mCount, and fl::Slice< T >::size().

Referenced by simplify().

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