Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ControlPoint.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
24 #ifndef _CONTROLPOINT_H
25 #define _CONTROLPOINT_H
26 
27 #include <hugin_shared.h>
28 
29 #include <string>
30 #include <vector>
31 
33 
34 
35 namespace HuginBase {
36 
39 {
40 
41 public:
45  enum OptimizeMode {
46  X_Y = 0,
47  X,
48  Y
49  };
50 
51 
52 public:
55  : image1Nr(0), image2Nr(0),
56  x1(0),y1(0),
57  x2(0),y2(0),
58  error(0), mode(X_Y)
59  { };
60 
62  ControlPoint(unsigned int img1, double sX, double sY,
63  unsigned int img2, double dX, double dY,
64  int mode = X_Y)
65  : image1Nr(img1), image2Nr(img2),
66  x1(sX),y1(sY),
67  x2(dX),y2(dY),
68  error(0), mode(mode)
69  { };
70 
72  bool operator==(const ControlPoint & o) const;
73 
74 
75 public:
76 
82  const std::string getCPString() const;
83 
85  void mirror();
86 
87 public:
88  // TODO: accessors
89 
90  unsigned int image1Nr;
91  unsigned int image2Nr;
92  double x1,y1;
93  double x2,y2;
94  double error;
95  int mode;
96 };
97 
99 typedef std::vector<ControlPoint> CPVector;
100 // pair of global control point number and corrosponding control point
101 typedef std::pair<typename CPVector::size_type, ControlPoint> CPoint;
102 typedef std::vector<CPoint> CPointVector;
103 
104 } // namespace
105 #endif // _CONTROLPOINT_H
represents a control point
Definition: ControlPoint.h:38
std::pair< typename CPVector::size_type, ControlPoint > CPoint
Definition: ControlPoint.h:101
evaluate x, points are on a vertical line
Definition: ControlPoint.h:47
OptimizeMode
minimize x,y or both.
Definition: ControlPoint.h:45
#define IMPEX
Definition: hugin_shared.h:39
std::vector< CPoint > CPointVector
Definition: ControlPoint.h:102
The pano tools interpolators ported to vigra.
double Y
std::vector< ControlPoint > CPVector
Definition: ControlPoint.h:99
ControlPoint(unsigned int img1, double sX, double sY, unsigned int img2, double dX, double dY, int mode=X_Y)
Definition: ControlPoint.h:62