00001 // -*- c-basic-offset: 4 -*- 00002 00011 /* 00012 * This program is free software; you can redistribute it and/or 00013 * modify it under the terms of the GNU General Public 00014 * License as published by the Free Software Foundation; either 00015 * version 2 of the License, or (at your option) any later version. 00016 * 00017 * This software is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 * General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU General Public 00023 * License along with this software; if not, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00025 * 00026 */ 00027 00028 #include "panoinc_WX.h" 00029 #include "panoinc.h" 00030 #include "LensCalTypes.h" 00031 #include "base_wx/platform.h" 00032 00033 ImageLineList::ImageLineList(wxString newFilename) 00034 { 00035 SetFilename(newFilename); 00036 m_edge=new vigra::BImage(); 00037 }; 00038 00039 ImageLineList::~ImageLineList() 00040 { 00041 delete m_panoImage; 00042 if(m_edge) 00043 delete m_edge; 00044 }; 00045 00046 const unsigned int ImageLineList::GetNrOfValidLines() 00047 { 00048 unsigned int count=0; 00049 for(unsigned int i=0;i<m_lines.size();i++) 00050 { 00051 if(m_lines[i].status==HuginLines::valid_line) 00052 count++; 00053 }; 00054 return count; 00055 }; 00056 00057 void ImageLineList::SetEdgeImage(vigra::BImage* newEdgeImage) 00058 { 00059 if(m_edge) 00060 delete m_edge; 00061 m_edge=newEdgeImage; 00062 }; 00063 00064 vigra::BImage* ImageLineList::GetEdgeImage() 00065 { 00066 return m_edge; 00067 }; 00068 00069 void ImageLineList::SetFilename(wxString newFilename) 00070 { 00071 m_filename=newFilename; 00072 std::string filenamestring(newFilename.mb_str(HUGIN_CONV_FILENAME)); 00073 m_panoImage=new HuginBase::SrcPanoImage(filenamestring); 00074 if(m_panoImage->getExifCropFactor()<=0) 00075 { 00076 m_panoImage->readCropfactorFromDB(); 00077 }; 00078 m_panoImage->readProjectionFromDB(); 00079 //reset roll to 0, it could be 90/-90/180 if loaded an image with Exif rotation tag 00080 m_panoImage->setRoll(0); 00081 //reset exposure value to prevent exposure correction when calculating corrected preview 00082 m_panoImage->setExposureValue(0); 00083 }; 00084 00085 const wxString ImageLineList::GetFilename() 00086 { 00087 return m_filename; 00088 }; 00089 00090 HuginBase::SrcPanoImage* ImageLineList::GetPanoImage() 00091 { 00092 return m_panoImage; 00093 }; 00094 00095 void ImageLineList::SetLines(HuginLines::Lines lines) 00096 { 00097 m_lines=lines; 00098 }; 00099 00100 const HuginLines::Lines ImageLineList::GetLines() 00101 { 00102 return m_lines; 00103 }; 00104 00105 void ImageLineList::ScaleLines(double scaleFactor) 00106 { 00107 HuginLines::ScaleLines(m_lines,scaleFactor); 00108 }; 00109
1.3.9.1