FastCV Sample Application  1.7.1
FPSCounter.h
00001 /*
00002  * Copyright (c) 2010-2011 Qualcomm Technologies Incorporated.
00003  * All Rights Reserved 
00004  * Qualcomm Technologies Confidential and Proprietary
00005  * 
00006  * 
00007  * @file Defines FPSCounter class. This class maintains the fps
00008  *               being maintained by the application
00009  *
00010  */
00011 
00012 
00013 #ifndef __QCCommon_FPSCOUNTER_HEADERFILE__
00014 #define __QCCommon_FPSCOUNTER_HEADERFILE__
00015 
00016 #include <stdint.h>
00020 class FPSCounter
00021 {
00022 protected:
00023 
00024 
00028    static const uint64_t   SECOND = 1000000;  
00029 
00033    float                   mFPS;
00034 
00038    float                   mFilteredFPS;
00039 
00043    uint64_t                mStartTime;
00044 
00048    uint64_t                mLastTime;
00049 
00053    uint64_t                mFrameCount;
00054 
00058    float                   mSecIIR;
00059 
00060 public:
00061 
00065    FPSCounter();
00066 
00070    void FrameTick();
00074    void Reset();
00075 
00080    inline float GetCurrentFPS()
00081    {
00082       return mFPS;
00083    }
00084    
00089    inline float GetFilteredFPS()
00090    {
00091       return mFilteredFPS;
00092    }
00093 
00098    ~FPSCounter();
00099 
00100 };
00101 
00102 #endif //#ifndef __QCCommon_FPSCOUNTER_HEADERFILE__
 All Data Structures Functions Variables