TexCoordRemapper.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00002 
00023 /* A TexCoordRemapper uses the reamapping transformations to create a set of
00024  * quadrilatrials that approximate the remapping. Each quad represents a small
00025  * axis-aligned rectangle of the output panorama.
00026  *
00027  * The mapping works by setting the texture coordinates of the input image to
00028  * reflect the output one.
00029  */
00030 
00031 #ifndef __TEXCOORDREMAPPER_H
00032 #define __TEXCOORDREMAPPER_H
00033 
00034 #include "MeshRemapper.h"
00035 #include <vector>
00036 #include "hugin_math/hugin_math.h"
00037 
00038 class TexCoordRemapper: public MeshRemapper
00039 {
00040 public:
00041     TexCoordRemapper(HuginBase::Panorama *m_pano, HuginBase::SrcPanoImage * image,
00042                      VisualizationState *visualization_state);
00043     virtual void UpdateAndResetIndex();
00044     virtual bool GetNextFaceCoordinates(Coords *result);
00045 private:
00046     void SetSize();
00047     // this stores all the coordinates, and can return rows of them.
00048     // arrays don't meet the requirements for std::vector, so we use a pair.
00049     std::vector< std::vector<hugin_utils::FDiff2D> > map;
00050     // dimensions for the area we cover. This can be used for clipping.
00051     double start_x, start_y, end_x, end_y;
00052     // this is the number of vertices we use in each direction.
00053     unsigned int divisions_x, divisions_y;
00054     // the size of the output
00055     double o_width, o_height;
00056     // the size of each face
00057     double face_width;
00058     double face_height;
00059     // these are used to index faces between calls of GetNextFaceCoordinates
00060     unsigned int face_index, number_of_faces;
00061     double vertex_coords[2][2][2];
00062     double texture_coords[2][2][2];
00063     std::vector<MeshRemapper::ArrayCoords> face_list;
00064 };
00065 
00066 #endif
00067 
00068 

Generated on 25 Oct 2014 for Hugintrunk by  doxygen 1.4.7