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

◆ clear()

void fl::Corkscrew::clear ( )

Definition at line 287 of file corkscrew.cpp.hpp.

287 {
288 // Clear input surface if it exists
289 if (mInputSurface) {
290 mInputSurface->clear();
291 // Don't reset the shared_ptr - the test expects the surface to remain valid
292 // The surface is cleared but the memory is not freed
293 }
294
295 // Clear pixel storage if we own it (vector variant)
296 if (!mPixelStorage.empty()) {
297 if (mPixelStorage.template is<fl::vector_psram<CRGB>>()) {
298 auto& vec = mPixelStorage.template get<fl::vector_psram<CRGB>>();
299 vec.clear();
300 // Note: fl::vector doesn't have shrink_to_fit(), but clear() frees the memory
301 }
302 // Note: Don't clear external spans as we don't own that memory
303 }
304
305 // Clear tile cache
306 mTileCache.clear();
307 // Note: fl::vector doesn't have shrink_to_fit(), but clear() frees the memory
308 mCacheInitialized = false;
309}
bool mCacheInitialized
Definition corkscrew.h:240
PixelStorage mPixelStorage
Definition corkscrew.h:232
fl::shared_ptr< fl::Grid< CRGB > > mInputSurface
Definition corkscrew.h:236
fl::vector< Tile2x2_u8_wrap > mTileCache
Definition corkscrew.h:239
pair_element< I, T1, T2 >::type & get(pair< T1, T2 > &p) FL_NOEXCEPT
Definition pair.h:115

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

+ Here is the call graph for this function: