FastLED 3.10.8
Loading...
Searching...
No Matches
frame_tracker.h
Go to the documentation of this file.
1#pragma once
2
3#include "fl/stl/int.h"
4#include "fl/stl/noexcept.h"
5// #include <iostream>
6
7// using namespace std;
8
9namespace fl {
10namespace video {
11
12// Tracks the current frame number based on the time elapsed since the start of
13// the animation.
15 public:
16 FrameTracker(float fps) FL_NO_EXCEPT;
17
18 // Gets the current frame and the next frame number based on the current
19 // time.
20 void get_interval_frames(fl::u32 now, fl::u32 *frameNumber,
21 fl::u32 *nextFrameNumber,
22 u8 *amountOfNextFrame = nullptr) const FL_NO_EXCEPT;
23
24 // Given a frame number, returns the exact timestamp in milliseconds that
25 // the frame should be displayed.
26 fl::u32 get_exact_timestamp_ms(fl::u32 frameNumber) const FL_NO_EXCEPT;
27
29
30 private:
32 fl::u32 mStartTime = 0;
33};
34
35} // namespace video
37} // namespace fl
void get_interval_frames(fl::u32 now, fl::u32 *frameNumber, fl::u32 *nextFrameNumber, u8 *amountOfNextFrame=nullptr) const FL_NO_EXCEPT
fl::u32 microsecondsPerFrame() const FL_NO_EXCEPT
FrameTracker(float fps) FL_NO_EXCEPT
fl::u32 get_exact_timestamp_ms(fl::u32 frameNumber) const FL_NO_EXCEPT
unsigned char u8
Definition stdint.h:131
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
video::FrameTracker FrameTracker
Base definition for an LED controller.