kanzi::FrameTimeQueue Class Reference

Queue specialization for calculating frame rate. More...

#include <kanzi/core.ui/legacy/kzu_frame_time_queue.hpp>

Public Member Functions

 FrameTimeQueue ()
 Constructor. More...
 
void update (unsigned int frameTime)
 Updates the frame time queue with a new frame time. More...
 
float getFPS () const
 Returns the current FPS. More...
 
unsigned int getLastFrameTime () const
 Returns the last frame time. More...
 

Protected Attributes

array< unsigned int, KZU_FRAME_TIME_QUEUE_SIZEm_frames
 Frame time queue data. More...
 
unsigned int m_firstFrame
 Frame time queue front index. More...
 
unsigned int m_frameCount
 Frame time queue size. More...
 
unsigned int m_milliseconds
 Frame time queue content sum cache. More...
 
unsigned int m_latestFrameTime
 Duration of last frame in milliseconds. More...
 
float m_fps
 Frame rate cache. More...
 

Detailed Description

Queue specialization for calculating frame rate.

Constructor & Destructor Documentation

kanzi::FrameTimeQueue::FrameTimeQueue ( )
explicit

Constructor.

Member Function Documentation

void kanzi::FrameTimeQueue::update ( unsigned int  frameTime)

Updates the frame time queue with a new frame time.

Parameters
frameTimeDuration of the new frame in milliseconds.
float kanzi::FrameTimeQueue::getFPS ( ) const
inline

Returns the current FPS.

Returns
Current frame rate in frames per second.
unsigned int kanzi::FrameTimeQueue::getLastFrameTime ( ) const
inline

Returns the last frame time.

Returns
Last frame duration in milliseconds.

Member Data Documentation

array<unsigned int, KZU_FRAME_TIME_QUEUE_SIZE> kanzi::FrameTimeQueue::m_frames
protected

Frame time queue data.

unsigned int kanzi::FrameTimeQueue::m_firstFrame
protected

Frame time queue front index.

unsigned int kanzi::FrameTimeQueue::m_frameCount
protected

Frame time queue size.

unsigned int kanzi::FrameTimeQueue::m_milliseconds
protected

Frame time queue content sum cache.

unsigned int kanzi::FrameTimeQueue::m_latestFrameTime
protected

Duration of last frame in milliseconds.

float kanzi::FrameTimeQueue::m_fps
protected

Frame rate cache.


The documentation for this class was generated from the following file: