Hugin trunk 0.1
Loading...
Searching...
No Matches
Lens.cpp
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
2
27#include "Lens.h"
28
29#include <hugin_utils/utils.h>
31
32
33namespace HuginBase {
34
36 : m_hasExif(false), m_projectionFormat(BaseSrcPanoImage::RECTILINEAR),
37 m_imageSize(0,0), m_cropFactor(1.0)
38{
40}
41
42
43const char* Lens::variableNames[] = { "v", "a", "b", "c", "d", "e", "g", "t",
44 "Va", "Vb", "Vc", "Vd", "Vx", "Vy",
45 "Ra", "Rb", "Rc", "Rd", "Re", 0};
46
47double Lens::getHFOV() const
48{
49 return const_map_get(this->variables,"v").getValue();
50}
51
52void Lens::setHFOV(double d)
53{
54 map_get(variables,"v").setValue(d);
55}
56
63
65{
66 return (double)m_imageSize.x / m_imageSize.y;
67}
68
69
71{
72 return m_imageSize.x >= m_imageSize.y;
73}
74
75
82
83
84
85} //namespace
Lens class.
Base class containing all the variables, but missing some of the other important functions and with s...
vigra::Size2D m_imageSize
Definition Lens.h:118
double getHFOV() const
get HFOV in degrees
Definition Lens.cpp:47
LensProjectionFormat m_projectionFormat
Definition Lens.h:117
double getFocalLength() const
get focal length of lens, it is calculated from the HFOV
Definition Lens.cpp:57
double m_cropFactor
Definition Lens.h:119
bool isLandscape() const
check if the image associated with this lens is in landscape orientation.
Definition Lens.cpp:70
void setHFOV(double d)
set HFOV in degrees
Definition Lens.cpp:52
Lens()
construct a new lens.
Definition Lens.cpp:35
double getCropFactor() const
get crop factor, d35mm/dreal
Definition Lens.h:73
void update(const Lens &l)
Definition Lens.cpp:76
LensVarMap variables
Definition Lens.h:106
double getAspectRatio() const
return the sensor ratio (width/height)
Definition Lens.cpp:64
static const char * variableNames[]
Definition Lens.h:110
static double calcFocalLength(SrcPanoImage::Projection proj, double hfov, double crop, vigra::Size2D imageSize)
calcualte focal length, given crop factor and hfov
double HFOV
mainly consists of wrapper around the pano tools library, to assist in ressource management and to pr...
Definition wxcms.cpp:39
void fillLensVarMap(LensVarMap &variables)
just lens variables
Map::mapped_type & map_get(Map &m, const typename Map::key_type &key)
get a map element.
Definition stl_utils.h:98
const Map::mapped_type & const_map_get(const Map &m, const typename Map::key_type &key)
Definition stl_utils.h:110
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.
Definition threshold.h:41