FastLED 3.9.15
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 <iostream>
5
6// using namespace std;
7
8namespace fl {
9namespace video {
10
11// Tracks the current frame number based on the time elapsed since the start of
12// the animation.
14 public:
15 FrameTracker(float fps);
16
17 // Gets the current frame and the next frame number based on the current
18 // time.
19 void get_interval_frames(fl::u32 now, fl::u32 *frameNumber,
20 fl::u32 *nextFrameNumber,
21 u8 *amountOfNextFrame = nullptr) const;
22
23 // Given a frame number, returns the exact timestamp in milliseconds that
24 // the frame should be displayed.
25 fl::u32 get_exact_timestamp_ms(fl::u32 frameNumber) const;
26
28
29 private:
31 fl::u32 mStartTime = 0;
32};
33
34} // namespace video
36} // namespace fl
fl::u32 get_exact_timestamp_ms(fl::u32 frameNumber) const
fl::u32 microsecondsPerFrame() const
void get_interval_frames(fl::u32 now, fl::u32 *frameNumber, fl::u32 *nextFrameNumber, u8 *amountOfNextFrame=nullptr) const
unsigned char u8
Definition stdint.h:131
video::FrameTracker FrameTracker
Base definition for an LED controller.
Definition crgb.hpp:179