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

◆ clear()

void fl::Corkscrew::clear ( )

Definition at line 287 of file corkscrew.cpp.

287 {
288 // Clear input surface if it exists
289 if (mInputSurface) {
290 mInputSurface->clear();
291 mInputSurface.reset(); // Free the shared_ptr memory
292 }
293
294 // Clear pixel storage if we own it (vector variant)
295 if (!mPixelStorage.empty()) {
296 if (mPixelStorage.template is<fl::vector<CRGB, fl::allocator_psram<CRGB>>>()) {
298 vec.clear();
299 // Note: fl::vector doesn't have shrink_to_fit(), but clear() frees the memory
300 }
301 // Note: Don't clear external spans as we don't own that memory
302 }
303
304 // Clear tile cache
305 mTileCache.clear();
306 // Note: fl::vector doesn't have shrink_to_fit(), but clear() frees the memory
307 mCacheInitialized = false;
308}
bool mCacheInitialized
Definition corkscrew.h:247
PixelStorage mPixelStorage
Definition corkscrew.h:239
fl::shared_ptr< fl::Grid< CRGB > > mInputSurface
Definition corkscrew.h:243
fl::vector< Tile2x2_u8_wrap > mTileCache
Definition corkscrew.h:246
pair_element< I, T1, T2 >::type & get(pair< T1, T2 > &p) noexcept
Definition pair.h:113
HeapVector< T, Allocator > vector
Definition vector.h:1214

References fl::get(), mCacheInitialized, mInputSurface, mPixelStorage, and mTileCache.

+ Here is the call graph for this function: