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
8
namespace
fl
{
9
namespace
video
{
10
11
// Tracks the current frame number based on the time elapsed since the start of
12
// the animation.
13
class
FrameTracker
{
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
27
fl::u32
microsecondsPerFrame
()
const
{
return
mMicrosSecondsPerInterval
; }
28
29
private
:
30
fl::u32
mMicrosSecondsPerInterval
;
31
fl::u32
mStartTime
= 0;
32
};
33
34
}
// namespace video
35
using
FrameTracker
=
video::FrameTracker
;
36
}
// namespace fl
fl::video::FrameTracker::get_exact_timestamp_ms
fl::u32 get_exact_timestamp_ms(fl::u32 frameNumber) const
Definition
frame_tracker.cpp.hpp:37
fl::video::FrameTracker::mStartTime
fl::u32 mStartTime
Definition
frame_tracker.h:31
fl::video::FrameTracker::FrameTracker
FrameTracker(float fps)
Definition
frame_tracker.cpp.hpp:8
fl::video::FrameTracker::microsecondsPerFrame
fl::u32 microsecondsPerFrame() const
Definition
frame_tracker.h:27
fl::video::FrameTracker::mMicrosSecondsPerInterval
fl::u32 mMicrosSecondsPerInterval
Definition
frame_tracker.h:30
fl::video::FrameTracker::get_interval_frames
void get_interval_frames(fl::u32 now, fl::u32 *frameNumber, fl::u32 *nextFrameNumber, u8 *amountOfNextFrame=nullptr) const
Definition
frame_tracker.cpp.hpp:13
fl::video::FrameTracker
Definition
frame_tracker.h:13
int.h
fl::video
Definition
video.h:24
fl::u8
unsigned char u8
Definition
stdint.h:131
fl::FrameTracker
video::FrameTracker FrameTracker
Definition
frame_tracker.h:35
fl
Base definition for an LED controller.
Definition
crgb.hpp:179
fl
video
frame_tracker.h
Generated on Tue Jun 16 2026 00:07:00 for FastLED by
1.13.2