comparison include/utils.hpp @ 12:ff5403319cec

optical flow demo working
author Nicolas Saunier <nico@confins.net>
date Wed, 11 Nov 2009 23:25:23 -0500
parents ace29ecfb846
children ef0d7caf8e91
comparison
equal deleted inserted replaced
11:e77e2fd69b02 12:ff5403319cec
1 #ifndef UTILS_HPP 1 #ifndef UTILS_HPP
2 #define UTILS_HPP 2 #define UTILS_HPP
3 3
4 static const double pi = 3.14159265358979323846;
4 5
6 inline double square(const int& a) { return a*a;}
7
8 /** Implements key bindings, for example for cvWaitKey(). */
9 inline bool forwardKey(const int& pressedKey) { return (((char)pressedKey) == '+');}
10
11 inline bool backwardKey(const int& pressedKey) { return (((char)pressedKey) == '-');}
12
13 inline bool saveKey(const int& pressedKey) { return (((char)pressedKey) == 's' || ((char)pressedKey) == 'S');}
14
15 inline bool interruptionKey(const int& pressedKey) { return (((char)pressedKey) == 'q' || ((char)pressedKey) == 'Q');}
16
17 inline bool skipKey(const int& pressedKey) { return (((char)pressedKey) == 'n' || ((char)pressedKey) == 'N');}
5 18
6 #endif 19 #endif