FastLED 3.10.6
Loading...
Searching...
No Matches

◆ blob()

fl::shared_ptr< const fl::u8 > fl::Fled::blob ( const char * sectionName,
fl::size * outLen ) const

Definition at line 188 of file fled.cpp.hpp.

189 {
190 if (outLen) *outLen = 0;
191 if (!mImpl) {
192 return fl::shared_ptr<const fl::u8>();
193 }
194 if (!fl::fled::sectionNameIsPayload(sectionName)) {
195 return fl::shared_ptr<const fl::u8>();
196 }
197 const fl::size n = mImpl->payloadLen();
198 if (n == 0) {
199 return fl::shared_ptr<const fl::u8>();
200 }
201 const fl::u8 *raw = mImpl->bytes() + mImpl->payloadOffset();
202 if (outLen) *outLen = n;
203 // Aliasing ctor: pins mImpl alive while the returned ptr is held.
204 // NOTE: for loadFromStatic, the bytes themselves still live in the
205 // caller's static span - see Fled::loadFromStatic contract.
206 return fl::shared_ptr<const fl::u8>(mImpl, raw);
207}
fl::shared_ptr< fled::FledImpl > mImpl
Definition fled.h:156
bool sectionNameIsPayload(const char *name) FL_NO_EXCEPT
unsigned char u8
Definition stdint.h:131

References fl::FL_NO_EXCEPT, mImpl, and fl::fled::sectionNameIsPayload().

Referenced by videoFrame().

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