| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| | #ifndef _GLOBAL_UTILITY_H |
| | #define _GLOBAL_UTILITY_H |
| |
|
| |
|
| | |
| | |
| | class LiteWindow; |
| |
|
| | class GlobalParam |
| | { |
| | public: |
| | static GLuint _texTarget; |
| | static GLuint _iTexFormat; |
| | static int _texMaxDim; |
| | static int _texMaxDimGL; |
| | static int _texMinDim; |
| | static int _MemCapGPU; |
| | static int _FitMemoryCap; |
| | static int _verbose; |
| | static int _timingS; |
| | static int _timingO; |
| | static int _timingL; |
| | static int _usePackedTex; |
| | static int _IsNvidia; |
| | static int _KeepShaderLoop; |
| | static int _UseCUDA; |
| | static int _UseOpenCL; |
| | static int _UseDynamicIndexing; |
| | static int _debug; |
| | static int _MaxFilterWidth; |
| | static float _FilterWidthFactor; |
| | static float _OrientationWindowFactor; |
| | static float _DescriptorWindowFactor; |
| | static int _MaxOrientation; |
| | static int _OrientationPack2; |
| | static int _ListGenGPU; |
| | static int _ListGenSkipGPU; |
| | static int _SupportNVFloat; |
| | static int _SupportTextureRG; |
| | static int _FullSupported; |
| | static float _MaxFeaturePercent; |
| | static int _MaxLevelFeatureNum; |
| | static int _DescriptorPPR; |
| | static int _DescriptorPPT; |
| | static int _FeatureTexBlock; |
| | static int _NarrowFeatureTex; |
| | static int _SubpixelLocalization; |
| | static int _ProcessOBO; |
| | static int _TruncateMethod; |
| | static int _PreciseBorder; |
| | static int _UseSiftGPUEX; |
| | static int _ForceTightPyramid; |
| | static int _octave_min_default; |
| | static int _octave_num_default; |
| | static int _InitPyramidWidth; |
| | static int _InitPyramidHeight; |
| | static int _PreProcessOnCPU; |
| | static int _GoodOpenGL; |
| | static int _FixedOrientation; |
| | static int _LoweOrigin; |
| | static int _ExitAfterSIFT; |
| | static int _NormalizedSIFT; |
| | static int _BinarySIFT; |
| | static int _KeepExtremumSign; |
| | static int _FeatureCountThreshold; |
| | static int _KeyPointListForceLevel0; |
| | static int _DarknessAdaption; |
| |
|
| | |
| | static float _OrientationExtraFactor; |
| | static float _OrientationGaussianFactor; |
| | static float _MulitiOrientationThreshold; |
| |
|
| | |
| | static int _WindowInitX; |
| | static int _WindowInitY; |
| | static const char* _WindowDisplay; |
| | static int _DeviceIndex; |
| | }; |
| |
|
| |
|
| | class ClockTimer |
| | { |
| | private: |
| | char _current_event[256]; |
| | int _time_start; |
| | int _time_stop; |
| | public: |
| | static int ClockMS(); |
| | static double CLOCK(); |
| | static void InitHighResolution(); |
| | void StopTimer(int verb = 1); |
| | void StartTimer(const char * event, int verb=0); |
| | float GetElapsedTime(); |
| | }; |
| |
|
| | class GlobalUtil:public GlobalParam |
| | { |
| | static ClockTimer _globalTimer; |
| | public: |
| | inline static double CLOCK() { return ClockTimer::CLOCK(); } |
| | inline static void StopTimer() { _globalTimer.StopTimer(_timingS); } |
| | inline static void StartTimer(const char * event) { _globalTimer.StartTimer(event, _timingO); } |
| | inline static float GetElapsedTime() { return _globalTimer.GetElapsedTime(); } |
| |
|
| | static void FitViewPort(int width, int height); |
| | static void SetTextureParameter(); |
| | static void SetTextureParameterUS(); |
| | #ifdef _DEBUG |
| | static void CheckErrorsGL(const char* location = NULL); |
| | #else |
| | static void inline CheckErrorsGL(const char* location = NULL){}; |
| | #endif |
| | static bool CheckFramebufferStatus(); |
| | |
| | static void SelectDisplay(); |
| | static void InitGLParam(int NotTargetGL = 0); |
| | static void SetGLParam(); |
| | static int CreateWindowEZ(); |
| | static void CleanupOpenGL(); |
| | static void SetDeviceParam(int argc, char** argv); |
| | static int CreateWindowEZ(LiteWindow* window); |
| | }; |
| |
|
| |
|
| | #if defined(_MSC_VER) && _MSC_VER == 1200 |
| | #define max(a,b) (((a) > (b)) ? (a) : (b)) |
| | #define min(a,b) (((a) < (b)) ? (a) : (b)) |
| | #endif |
| |
|
| | #endif |
| |
|
| |
|