27#include <vigra/windows.h>
30#include "hugin_config.h"
31#if defined HAVE_EPOXY && HAVE_EPOXY
58 visualization_state(visualization_state),
65 for (std::vector<MeshInfo*>::iterator
it =
meshes.begin() ;
it !=
meshes.end() ; ++
it) {
81 for (
unsigned int i = 0;
i <
meshes.size();
i++)
93 DEBUG_INFO(
"Making new mesh remapper for image " <<
i <<
".");
101 meshes[image_number]->CallList();
106 return meshes[image_number]->display_list_number;
116 for (std::vector<MeshInfo*>::iterator
it =
meshes.begin() ;
it !=
meshes.end() ; ++
it) {
129 for(
unsigned int i=0;
i<
meshes.size();
i++)
130 meshes[
i]->SetScaleFactor(scale);
155 m_visualization_state(
source.m_visualization_state),
177 double scale = m_visualization_state->GetVisibleArea().width() /
188 for (
int x = 0 ; x < 2 ; x++) {
189 for (
int y = 0 ; y < 2 ; y++) {
190 tex_coords[x][y][0] =
coords.tex_c[x][y][0];
191 tex_coords[x][y][1] =
coords.tex_c[x][y][1];
192 vertex_coords[x][y][0] =
coords.vertex_c[x][y][0];
193 vertex_coords[x][y][1] =
coords.vertex_c[x][y][1];
194 vertex_coords[x][y][2] = 0;
216 bool multiTexture=m_visualization_state->getViewState()->GetSupportMultiTexture();
217 unsigned int number_of_faces = 0;
221 this->BeforeCompile();
225 remap->UpdateAndResetIndex();
226 DEBUG_INFO(
"Specifying faces in display list.");
237 while (remap->GetNextFaceCoordinates(&
coords))
291 this->AfterCompile();
311 yaw = image.getYaw();
312 pitch = image.getPitch();
329 image.setPitch(pitch);
334 double width, height, hfov,
vfov;
346 th = ((
coord.x / width) * hfov - hfov / 2.0);
360 double width, height, hfov,
vfov;
371 for (
int x = 0 ; x < 2 ; x++) {
372 for (
int y = 0 ; y < 2 ; y++) {
379 th = ((
coords.vertex_c[x][y][0] / width) * hfov - hfov / 2.0);
401 double width, height;
407 res.
x = (
coord.x - width / 2.0) * scale / width;
408 res.
y = (
coord.y - height / 2.0) * (-scale) / width;
415 double width, height;
421 for (
int x = 0 ; x < 2 ; x++) {
422 for (
int y = 0 ; y < 2 ; y++) {
Define a remapper to use in the layout mode.
A ChoosyRemapper combines the other MeshRemappers and picks which one it deems is best suited for eac...
unsigned int getWidth() const
unsigned int getHeight() const
get panorama height
std::size_t getNrOfImages() const
number of images.
All variables of a source image.
Draw undistored images, but with the correct centre position.
void setScale(double scale)
Set the size to draw the images.
a class to handle a 3D point
a class to keep data of a single rectangle with texture coordinates
double tex_coords[2][2][2]
double vertex_coords[2][2][3]
Handles the remapper and a display list for a specific image.
void CallList() const
Draw the mesh.
void CompileList()
Use the remapper to create the display list.
MeshInfo(HuginBase::Panorama *m_pano, HuginBase::SrcPanoImage *image, VisualizationState *visualization_state, bool layout_mode_on)
Constructor: Creates the mesh for a given image of a panorama.
void SetScaleFactor(double scale)
void Update()
Recreate the mesh when the image or panorama it represents changes.
a subclass for the panosphere it converts coordinates obtained from an equirectangular projection to ...
static void Convert(double &x, double &y, double &z, double th, double ph, double r)
convert from spherical to cartesian coordinates
static MeshCoords3D GetMeshCoords3D(MeshRemapper::Coords &coords, VisualizationState *state)
static const double scale_diff
scale factor to be used for the layout mode TODO: test this for more scenarios
static Coord3D GetCoord3D(hugin_utils::FDiff2D &coord, VisualizationState *state)
subclass for the plane overview mode.
static MeshCoords3D GetMeshCoords3D(MeshRemapper::Coords &coords, VisualizationState *state)
static Coord3D GetCoord3D(hugin_utils::FDiff2D &coord, VisualizationState *state)
static const double scale
subclass of MeshInfo for the preview It actually does nothing in addition to the base class
bool GetLayoutMode() const
return if layout mode is active
void SetLayoutMode(bool state)
Turn layout mode on or off.
VisualizationState * visualization_state
MeshManager(HuginBase::Panorama *pano, VisualizationState *visualization_state)
HuginBase::Panorama * m_pano
void SetLayoutScale(double scale)
unsigned int GetDisplayList(unsigned int image_number) const
std::vector< MeshInfo * > meshes
virtual MeshInfo * ObtainMeshInfo(HuginBase::SrcPanoImage *, bool layout_mode_on)=0
void RenderMesh(unsigned int image_number) const
A class for exchanging pointers to coordinates.
An abstract base class for objects that calculate an approximate remap specified by quadrilatrials.
MeshInfo * ObtainMeshInfo(HuginBase::SrcPanoImage *, bool layout_mode_on)
MeshInfo * ObtainMeshInfo(HuginBase::SrcPanoImage *, bool layout_mode_on)
MeshInfo * ObtainMeshInfo(HuginBase::SrcPanoImage *, bool layout_mode_on)
virtual HuginBase::PanoramaOptions * GetOptions()
virtual HuginBase::SrcPanoImage * GetSrcImage(unsigned int image_nr)
bool RequireRecalculateMesh(unsigned int image_nr)
#define DEBUG_ASSERT(cond)
mainly consists of wrapper around the pano tools library, to assist in ressource management and to pr...
include file for the hugin project
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.