Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LensCalTypes.cpp
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
2 
11 /*
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
16  *
17  * This software is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public
23  * License along with this software. If not, see
24  * <http://www.gnu.org/licenses/>.
25  *
26  */
27 
28 #include "panoinc_WX.h"
29 #include "panoinc.h"
30 #include "LensCalTypes.h"
31 #include "base_wx/platform.h"
32 
33 ImageLineList::ImageLineList(wxString newFilename)
34 {
35  SetFilename(newFilename);
36  m_edge=new vigra::BImage();
37 };
38 
40 {
41  delete m_panoImage;
42  if(m_edge)
43  delete m_edge;
44 };
45 
47 {
48  unsigned int count=0;
49  for(unsigned int i=0;i<m_lines.size();i++)
50  {
51  if(m_lines[i].status==HuginLines::valid_line)
52  count++;
53  };
54  return count;
55 };
56 
57 void ImageLineList::SetEdgeImage(vigra::BImage* newEdgeImage)
58 {
59  if(m_edge)
60  delete m_edge;
61  m_edge=newEdgeImage;
62 };
63 
65 {
66  return m_edge;
67 };
68 
69 void ImageLineList::SetFilename(wxString newFilename)
70 {
71  m_filename=newFilename;
72  std::string filenamestring(newFilename.mb_str(HUGIN_CONV_FILENAME));
74  m_panoImage->setFilename(filenamestring);
75  m_panoImage->readEXIF();
76  m_panoImage->applyEXIFValues();
77  if(m_panoImage->getCropFactor()<=0)
78  {
79  m_panoImage->readCropfactorFromDB();
80  };
81  m_panoImage->readProjectionFromDB();
82  //reset roll to 0, it could be 90/-90/180 if loaded an image with Exif rotation tag
83  m_panoImage->setRoll(0);
84  //reset exposure value to prevent exposure correction when calculating corrected preview
85  m_panoImage->setExposureValue(0);
86 };
87 
89 {
90  return m_filename;
91 };
92 
94 {
95  return m_panoImage;
96 };
97 
99 {
100  m_lines=lines;
101 };
102 
104 {
105  return m_lines;
106 };
107 
108 void ImageLineList::ScaleLines(double scaleFactor)
109 {
110  HuginLines::ScaleLines(m_lines,scaleFactor);
111 };
112 
implementation of huginApp Class
HuginLines::Lines m_lines
list of detected lines
Definition: LensCalTypes.h:65
void SetLines(HuginLines::Lines lines)
store given lines in member variable
wxString m_filename
the filename
Definition: LensCalTypes.h:67
void SetEdgeImage(vigra::BImage *newEdgeImage)
sets the edge detected image (old image will be deleted)
#define HUGIN_CONV_FILENAME
Definition: platform.h:40
HuginBase::SrcPanoImage * GetPanoImage()
return the SrcPanoImage from the given filename
void SetFilename(wxString newFilename)
sets the filename, will also regenerated the m_panoImage
void ScaleLines(Lines &lines, const double scale)
scales the given lines with given factor use in conjugation with HuginLines::detectEdges to scale the...
Definition: FindLines.cpp:130
ImageLineList(wxString newFilename)
constructor
include file for the hugin project
const unsigned int GetNrOfValidLines()
returns the number of valid lines for given image
void ScaleLines(double scaleFactor)
scale all lines by given scaleFactor
include file for the hugin project
std::vector< SingleLine > Lines
vector of extracted lines from image
Definition: LinesTypes.h:50
vigra::BImage * m_edge
pointer to edge image
Definition: LensCalTypes.h:63
bool readEXIF()
try to fill out information about the image, by examining the exif data
~ImageLineList()
destructor, cleans up
const HuginLines::Lines GetLines()
returns the list of detected lines
declaration of helper class for LensCal
vigra::BImage * GetEdgeImage()
return pointer to edge image
const wxString GetFilename()
returns the filename
All variables of a source image.
Definition: SrcPanoImage.h:194
HuginBase::SrcPanoImage * m_panoImage
the HuginBase::SrcPanoImage, for generating the panorama class and necessary transformations ...
Definition: LensCalTypes.h:69