view include/utils.hpp @ 14:e7bbe8465591

homography and other utils
author Nicolas Saunier <nico@confins.net>
date Sat, 14 Nov 2009 19:02:46 -0500
parents ff5403319cec
children ef0d7caf8e91
line wrap: on
line source

#ifndef UTILS_HPP
#define UTILS_HPP

static const double pi = 3.14159265358979323846;

inline double square(const int& a) { return a*a;}

/** Implements key bindings, for example for cvWaitKey(). */
inline bool forwardKey(const int& pressedKey) { return (((char)pressedKey) == '+');}

inline bool backwardKey(const int& pressedKey) { return (((char)pressedKey) == '-');}

inline bool saveKey(const int& pressedKey) { return (((char)pressedKey) == 's' || ((char)pressedKey) == 'S');}

inline bool interruptionKey(const int& pressedKey) { return (((char)pressedKey) == 'q' || ((char)pressedKey) == 'Q');}

inline bool skipKey(const int& pressedKey) { return (((char)pressedKey) == 'n' || ((char)pressedKey) == 'N');}

#endif