Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros | Typedefs | Functions
hugin_math.h File Reference

misc math function & classes used by other parts of the program More...

#include <hugin_shared.h>
#include <cmath>
#include <math.h>
#include <iostream>
#include <vigra/diff2d.hxx>
Include dependency graph for hugin_math.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hugin_utils::TDiff2D< T >
 

Namespaces

 hugin_utils
 namespace for various utils
 

Macros

#define M_PI   3.14159265358979323846
 
#define PI   3.14159265358979323846
 
#define DEG_TO_RAD(x)   ( (x) * 2.0 * PI / 360.0 )
 
#define RAD_TO_DEG(x)   ( (x) * 360.0 / ( 2.0 * PI ) )
 

Typedefs

typedef TDiff2D< double > hugin_utils::FDiff2D
 

Functions

double hugin_utils::round (double x)
 
float hugin_utils::roundf (float x)
 
int hugin_utils::ceili (double x)
 
int hugin_utils::floori (double x)
 
template<class T >
int hugin_utils::roundi (T x)
 
template<class T >
hugin_utils::simpleClipPoint (const T &point, const T &min, const T &max)
 clip a point to fit int [min, max] does not do a mathematical clipping, just sets p.x and p.y to the borders if they are outside. More...
 
template<class T >
hugin_utils::sqr (T t)
 
template<class T >
double hugin_utils::norm (T t)
 
template<class InputIterator1 , class InputIterator2 >
double hugin_utils::euclid_dist (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2)
 calculate squared Euclidean distance between two vectors. More...
 
template<class InputIterator1 , class InputIterator2 , class T >
hugin_utils::sqr_dist (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T res)
 calculate squared Euclidean distance between two vectors. More...
 
template<class POINT >
vigra::Rect2D hugin_utils::calcCircleROIFromPoints (const POINT &p1, const POINT &p2)
 calculate the bounding box of a circle that goes through both points. More...
 
int hugin_utils::gcd (int a, int b)
 function to calculate greated common divisor using Euclidean algorithm both arguments should be >=0 More...
 
template<class T >
std::ostream & operator<< (std::ostream &o, const hugin_utils::TDiff2D< T > &d)
 
hugin_utils::FDiff2D operator/ (const hugin_utils::FDiff2D &lhs, double val)
 
vigra::Diff2D operator* (const vigra::Diff2D &d, double scale)
 
vigra::Rect2D operator* (const vigra::Rect2D &r, double scale)
 uses floor for left and top and ceil for right and bottom -> extend image when rounding.. More...
 

Detailed Description

misc math function & classes used by other parts of the program

This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU General Public License along with this software. If not, see http://www.gnu.org/licenses/.

Author
Pablo d'Angelo pablo.nosp@m..dan.nosp@m.gelo@.nosp@m.web..nosp@m.de

$Id$

This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU General Public License along with this software. If not, see http://www.gnu.org/licenses/.

Definition in file hugin_math.h.

Macro Definition Documentation

#define DEG_TO_RAD (   x)    ( (x) * 2.0 * PI / 360.0 )
#define M_PI   3.14159265358979323846

Definition at line 37 of file hugin_math.h.

#define PI   3.14159265358979323846

Definition at line 41 of file hugin_math.h.

#define RAD_TO_DEG (   x)    ( (x) * 360.0 / ( 2.0 * PI ) )

Function Documentation

vigra::Diff2D operator* ( const vigra::Diff2D &  d,
double  scale 
)
inline

Definition at line 249 of file hugin_math.h.

vigra::Rect2D operator* ( const vigra::Rect2D &  r,
double  scale 
)
inline

uses floor for left and top and ceil for right and bottom -> extend image when rounding..

Definition at line 256 of file hugin_math.h.

hugin_utils::FDiff2D operator/ ( const hugin_utils::FDiff2D lhs,
double  val 
)
inline

Definition at line 243 of file hugin_math.h.

References hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

template<class T >
std::ostream& operator<< ( std::ostream &  o,
const hugin_utils::TDiff2D< T > &  d 
)
inline

Definition at line 238 of file hugin_math.h.