Hugin trunk 0.1
Loading...
Searching...
No Matches
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>
37
39{
40public:
43 virtual void UpdateAndResetIndex();
44 virtual bool GetNextFaceCoordinates(Coords *result);
45private:
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
56 // the size of each face
57 double face_width;
59 // these are used to index faces between calls of GetNextFaceCoordinates
61 double vertex_coords[2][2][2];
62 double texture_coords[2][2][2];
63};
64
65#endif
66
67
Model for a panorama.
Definition Panorama.h:153
All variables of a source image.
A class for exchanging pointers to coordinates.
An abstract base class for objects that calculate an approximate remap specified by quadrilatrials.
HuginBase::SrcPanoImage * image
VisualizationState * visualization_state
HuginBase::Panorama * m_pano
std::vector< std::vector< hugin_utils::FDiff2D > > map
double texture_coords[2][2][2]
virtual void UpdateAndResetIndex()
unsigned int divisions_x
unsigned int face_index
unsigned int divisions_y
unsigned int number_of_faces
virtual bool GetNextFaceCoordinates(Coords *result)
Get the texture and vertex coordinates for the next face.
double vertex_coords[2][2][2]
misc math function & classes used by other parts of the program