FastLED
3.9.7
Loading...
Searching...
No Matches
frame_tracker.h
1
#pragma once
2
3
#include <stdint.h>
4
5
#include "
fl/namespace.h
"
6
7
// #include <iostream>
8
9
// using namespace std;
10
11
namespace
fl
{
12
13
// Tracks the current frame number based on the time elapsed since the start of the animation.
14
class
FrameTracker
{
15
public
:
16
FrameTracker
(
float
fps);
17
18
// Gets the current frame and the next frame number based on the current time.
19
void
get_interval_frames(uint32_t now, uint32_t* frameNumber, uint32_t* nextFrameNumber, uint8_t* amountOfNextFrame =
nullptr
)
const
;
20
21
// Given a frame number, returns the exact timestamp in milliseconds that the frame should be displayed.
22
uint32_t get_exact_timestamp_ms(uint32_t frameNumber)
const
;
23
24
private
:
25
uint32_t mMicrosSecondsPerInterval;
26
uint32_t mStartTime = 0;
27
};
28
29
30
}
// namespace fl
fl::FrameTracker
Definition
frame_tracker.h:14
namespace.h
Implements the FastLED namespace macros.
fl
Implements a simple red square effect for 2D LED grids.
Definition
crgb.h:16
src
fx
video
frame_tracker.h
Generated on Fri Dec 20 2024 20:54:48 for FastLED by
1.11.0