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/stdint.h"
4
5#include "fl/namespace.h"
6
7#include "fl/int.h"
8// #include <iostream>
9
10// using namespace std;
11
12namespace fl {
13
14// Tracks the current frame number based on the time elapsed since the start of
15// the animation.
17 public:
18 FrameTracker(float fps);
19
20 // Gets the current frame and the next frame number based on the current
21 // time.
22 void get_interval_frames(fl::u32 now, fl::u32 *frameNumber,
23 fl::u32 *nextFrameNumber,
24 uint8_t *amountOfNextFrame = nullptr) const;
25
26 // Given a frame number, returns the exact timestamp in milliseconds that
27 // the frame should be displayed.
28 fl::u32 get_exact_timestamp_ms(fl::u32 frameNumber) const;
29
31
32 private:
34 fl::u32 mStartTime = 0;
35};
36
37} // namespace fl
void get_interval_frames(fl::u32 now, fl::u32 *frameNumber, fl::u32 *nextFrameNumber, uint8_t *amountOfNextFrame=nullptr) const
fl::u32 get_exact_timestamp_ms(fl::u32 frameNumber) const
fl::u32 microsecondsPerFrame() const
FrameTracker(float fps)
fl::u32 mMicrosSecondsPerInterval
Implements the FastLED namespace macros.
IMPORTANT!
Definition crgb.h:20