FastLED 3.10.8
Loading...
Searching...
No Matches

◆ readFrame()

bool fl::video::PixelStream::readFrame ( Frame * frame)

Definition at line 274 of file pixel_stream.cpp.hpp.

274 {
275 if (!mHandle || !frame) {
276 return false;
277 }
278 if (mType == kFile && !framesRemaining()) {
279 return false;
280 }
281 if (!isRgb8Playback()) {
282 return false;
283 }
284 size_t n = 0;
285 const fl::size_t pixels = static_cast<fl::size_t>(mbytesPerFrame) / 3;
286 fl::span<CRGB> dst = frame->rgb();
287 for (; n < pixels && n < dst.size() && readPixel(&dst[n]); ++n) {
288 }
289 if (mType == kFile) {
290 DBG("pos: " << mHandle->pos());
291 }
292 return n * 3 == size_t(mbytesPerFrame);
293}
constexpr fl::size size() const FL_NO_EXCEPT
Definition span.h:483
fl::filebuf_ptr mHandle
i32 framesRemaining() const FL_NO_EXCEPT
bool readPixel(CRGB *dst) FL_NO_EXCEPT
bool isRgb8Playback() const FL_NO_EXCEPT
__SIZE_TYPE__ size_t
Definition s16x16x4.h:16
fl::size_t size_t
Definition s16x16x4.h:62
#define DBG
Definition time.cpp.hpp:7

References DBG, fl::FL_NO_EXCEPT, framesRemaining(), isRgb8Playback(), kFile, mbytesPerFrame, mHandle, mType, readPixel(), and fl::span< T, Extent >::size().

+ Here is the call graph for this function: