FastCV Sample Application
1.7.1
|
00001 /* 00002 * Copyright (c) 2010-2011 Qualcomm Technologies Incorporated. 00003 * All Rights Reserved 00004 * Qualcomm Technologies Confidential and Proprietary 00005 * 00006 * 00007 * @file Defines Camera Util class 00008 * 00009 */ 00010 00011 00012 #ifndef __CAMERA_UTIL_HEADERFILE__ 00013 #define __CAMERA_UTIL_HEADERFILE__ 00014 00015 #include <GLES2/gl2.h> 00016 #include <GLES2/gl2ext.h> 00017 00018 #include <stdint.h> 00019 #include <time.h> 00020 00021 #include "FPSCounter.h" 00022 00028 class CameraUtil 00029 { 00030 00031 #define ALIGN_TO(value, alignment) (((value) + ((alignment)-1)) & (~((alignment)-1))) 00032 00033 public: 00034 00041 static inline uint64_t GetCurrentTimeus() 00042 { 00043 struct timeval tv; 00044 struct timezone tz; 00045 00046 gettimeofday(&tv, &tz); 00047 00048 return tv.tv_sec * 1000000 + tv.tv_usec; 00049 } 00050 00063 static GLuint CompileAndLinkShaderProgram 00064 ( 00065 const char* vShaderStr, 00066 const char* fShaderStr 00067 ); 00068 00080 static bool LoadShader( GLenum type, const char *shaderSrc, GLuint& shader ); 00081 00082 00092 static bool checkGlError(const char* op); 00093 00094 }; // class CameraUtil 00095 #endif //#ifndef __CAMERA_UTIL_HEADERFILE__