Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[6d12f1]: src / hugin1 / calibrate_lens / LensCalTypes.cpp Maximize Restore History

Download this file

LensCalTypes.cpp    113 lines (97 with data), 2.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
// -*- c-basic-offset: 4 -*-
/** @file LensCalTypes.cpp
*
* @brief implementation of helper class for LensCal
*
* @author T. Modes
*
*/
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "panoinc_WX.h"
#include "panoinc.h"
#include "LensCalTypes.h"
#include "base_wx/platform.h"
ImageLineList::ImageLineList(wxString newFilename)
{
SetFilename(newFilename);
m_edge=new vigra::BImage();
};
ImageLineList::~ImageLineList()
{
delete m_panoImage;
if(m_edge)
delete m_edge;
};
const unsigned int ImageLineList::GetNrOfValidLines()
{
unsigned int count=0;
for(unsigned int i=0;i<m_lines.size();i++)
{
if(m_lines[i].status==HuginLines::valid_line)
count++;
};
return count;
};
void ImageLineList::SetEdgeImage(vigra::BImage* newEdgeImage)
{
if(m_edge)
delete m_edge;
m_edge=newEdgeImage;
};
vigra::BImage* ImageLineList::GetEdgeImage()
{
return m_edge;
};
void ImageLineList::SetFilename(wxString newFilename)
{
m_filename=newFilename;
std::string filenamestring(newFilename.mb_str(HUGIN_CONV_FILENAME));
m_panoImage=new HuginBase::SrcPanoImage;
m_panoImage->setFilename(filenamestring);
m_panoImage->readEXIF();
m_panoImage->applyEXIFValues();
if(m_panoImage->getCropFactor()<=0)
{
m_panoImage->readCropfactorFromDB();
};
m_panoImage->readProjectionFromDB();
//reset roll to 0, it could be 90/-90/180 if loaded an image with Exif rotation tag
m_panoImage->setRoll(0);
//reset exposure value to prevent exposure correction when calculating corrected preview
m_panoImage->setExposureValue(0);
};
const wxString ImageLineList::GetFilename()
{
return m_filename;
};
HuginBase::SrcPanoImage* ImageLineList::GetPanoImage()
{
return m_panoImage;
};
void ImageLineList::SetLines(HuginLines::Lines lines)
{
m_lines=lines;
};
const HuginLines::Lines ImageLineList::GetLines()
{
return m_lines;
};
void ImageLineList::ScaleLines(double scaleFactor)
{
HuginLines::ScaleLines(m_lines,scaleFactor);
};