OutputProjectionInfo.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00002 
00023 /* An OutputProjectionInfo gives information about where specific points of
00024  * latitude and longitude map to on the output image.
00025  * The object is valid for only the projection passed to its constructor.
00026  * The idea is that ChoosyRemapper and VertexCoordRemapper can get information
00027  * about the output projection not specific to their images.
00028  * ViewState recreates the object when the projections change.
00029  */
00030 
00031 #ifndef _OUTPUTPROJECTIONINFO_H
00032 #define _OUTPUTPROJECTIONINFO_H
00033 
00034 #include "panodata/PanoramaOptions.h"
00035 #include <panotools/PanoToolsInterface.h>
00036 
00037 class OutputProjectionInfo
00038 {
00039 public:
00040     OutputProjectionInfo(HuginBase::PanoramaOptions *output);
00041     // most are for correcting faces crossing the +/-180 degree boundary
00042     const double GetMiddleX() const
00043         {return middle_x;}
00044     const double GetMiddleY() const
00045         {return middle_y;}
00046     const double GetLowerX() const
00047         {return lower_x;}
00048     const double GetUpperX() const
00049         {return upper_x;}
00050     const double GetLowerY() const
00051         {return lower_y;}
00052     const double GetUpperY() const
00053         {return upper_y;}
00054     // for sinusoidal (or similar) projections, the bounds move with height.
00055     const double GetUpperX(const double y) const;
00056     const double GetLowerX(const double y) const;
00057     // the seam is a circle in some projections
00058     const double GetRadius() const
00059         {return radius;}
00060     // we'll need these to flip things across the seam in cylinder-like cases.
00061     const double GetXAdd360() const
00062         {return x_add_360;}
00063     const double GetYAdd360() const
00064         {return y_add_360;}
00065     // they can move with height too
00066     const double GetXAdd360(const double y) const;
00067     // locations of poles, used by the ChoosyRemapper.
00068     const double GetNorthPoleX() const
00069         {return north_pole_x;}
00070     const double GetNorthPoleY() const
00071         {return north_pole_y;}
00072     const double GetSouthPoleX() const
00073         {return south_pole_x;}
00074     const double GetSouthPoleY() const
00075         {return south_pole_y;}
00076     // use the transformation for anything else
00077     bool AngularToImage(double &image_x, double &image_y, double yaw, double pitch);
00078     bool ImageToAngular(double &yaw, double &pitch, double image_x, double image_y);
00079 private:
00080     double lower_x, middle_x, upper_x,
00081            lower_y, middle_y, upper_y,
00082            radius, x_add_360, y_add_360,
00083            north_pole_x, north_pole_y,
00084            south_pole_x, south_pole_y;
00085     HuginBase::PanoramaOptions *proj;
00086     HuginBase::PTools::Transform transform;
00087     HuginBase::PTools::Transform reverse_transform;
00088 };
00089 
00090 #endif
00091 

Generated on Tue Sep 30 01:25:32 2014 for Hugintrunk by  doxygen 1.3.9.1