Display frame rate manager. Used to stabilize the frames-per-seconds displayed. More...
Public Member Functions | |
PvFPSStabilizer () | |
Constructor. | |
~PvFPSStabilizer () | |
Destructor. | |
bool | IsTimeToDisplay (uint32_t aTargetFPS) |
Checks whether displaying a frame now would bring us close to the desired display frame rate or not. More... | |
uint32_t | GetAverage () |
Queries the displayed frame rate average. More... | |
void | Reset () |
Resets the history. | |
Display frame rate manager. Used to stabilize the frames-per-seconds displayed.
This class is pretty simple to use. Just instantiate an object and call the IsTimeToDisplay every time you have a new frame to display, specifying the desired frame rate.
This class is not tied to the display. It simply keeps track of the times associated with displayed frames (IsTimeToDisplay returning true) in a circular buffer and uses this history to decide if it is time to display a new frame.
uint32_t PvFPSStabilizer::GetAverage | ( | ) |
Queries the displayed frame rate average.
Used by eBUS Player in the status control that displays the display frame rate.
bool PvFPSStabilizer::IsTimeToDisplay | ( | uint32_t | aTargetFPS | ) |
Checks whether displaying a frame now would bring us close to the desired display frame rate or not.
If the new frame will bring you closer to your desired frame rate, the method returns true and you send the frame to be displayed to a PvDisplayWnd or your own display class.
If it returns false, this new frame would bring you above the desired display rate. The frame can still be processed, etc. but displaying it would bring you above the desired frame rate. The expected course of action would then be to simply not display the frame and wait for a new incoming frame - instead of holding to the current one and trying to display it later.
[in] | aTargetFPS | The target (desired) display frame rate. |
Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com