Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TexCoordRemapper.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
2 
23 /* A TexCoordRemapper uses the reamapping transformations to create a set of
24  * quadrilatrials that approximate the remapping. Each quad represents a small
25  * axis-aligned rectangle of the output panorama.
26  *
27  * The mapping works by setting the texture coordinates of the input image to
28  * reflect the output one.
29  */
30 
31 #ifndef __TEXCOORDREMAPPER_H
32 #define __TEXCOORDREMAPPER_H
33 
34 #include "MeshRemapper.h"
35 #include <vector>
36 #include "hugin_math/hugin_math.h"
37 
39 {
40 public:
43  virtual void UpdateAndResetIndex();
44  virtual bool GetNextFaceCoordinates(Coords *result);
45 private:
46  void SetSize();
47  // this stores all the coordinates, and can return rows of them.
48  // arrays don't meet the requirements for std::vector, so we use a pair.
49  std::vector< std::vector<hugin_utils::FDiff2D> > map;
50  // dimensions for the area we cover. This can be used for clipping.
52  // this is the number of vertices we use in each direction.
53  unsigned int divisions_x, divisions_y;
54  // the size of the output
55  double o_width, o_height;
56  // the size of each face
57  double face_width;
58  double face_height;
59  // these are used to index faces between calls of GetNextFaceCoordinates
60  unsigned int face_index, number_of_faces;
61  double vertex_coords[2][2][2];
62  double texture_coords[2][2][2];
63 };
64 
65 #endif
66 
67 
double vertex_coords[2][2][2]
An abstract base class for objects that calculate an approximate remap specified by quadrilatrials...
Definition: MeshRemapper.h:43
unsigned int face_index
TexCoordRemapper(HuginBase::Panorama *m_pano, HuginBase::SrcPanoImage *image, VisualizationState *visualization_state)
misc math function &amp; classes used by other parts of the program
A class for exchanging pointers to coordinates.
Definition: MeshRemapper.h:60
HuginBase::SrcPanoImage * image
Definition: MeshRemapper.h:85
VisualizationState * visualization_state
Definition: MeshRemapper.h:83
Model for a panorama.
Definition: Panorama.h:152
std::vector< std::vector< hugin_utils::FDiff2D > > map
unsigned int divisions_y
unsigned int number_of_faces
virtual bool GetNextFaceCoordinates(Coords *result)
Get the texture and vertex coordinates for the next face.
virtual void UpdateAndResetIndex()
unsigned int divisions_x
All variables of a source image.
Definition: SrcPanoImage.h:194
HuginBase::Panorama * m_pano
Definition: MeshRemapper.h:84
double texture_coords[2][2][2]