From: Pablo d'A. <da...@us...> - 2005-10-28 16:48:01
|
Update of /cvsroot/hugin/hugin/src/hugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2776/src/hugin Modified Files: NonaStitcherPanel.cpp PreferencesDialog.cpp Log Message: added TIFF compression and TIFF_m roi mode selections to GUI Index: PreferencesDialog.cpp =================================================================== RCS file: /cvsroot/hugin/hugin/src/hugin/PreferencesDialog.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- PreferencesDialog.cpp 16 Sep 2005 14:09:56 -0000 1.37 +++ PreferencesDialog.cpp 28 Oct 2005 16:47:50 -0000 1.38 @@ -616,6 +616,10 @@ wxT(HUGIN_ENBLEND_ARGS))); t = cfg->Read(wxT("/Enblend/DeleteRemappedFiles"), HUGIN_ENBLEND_DELETE_REMAPPED_FILES) == 1; MY_BOOL_VAL("prefs_enblend_DeleteRemapped", t); + + t = cfg->Read(wxT("/Enblend/UseCroppedFiles"), HUGIN_ENBLEND_USE_CROPPED_FILES) == 1; + MY_BOOL_VAL("prefs_enblend_UseCroppedFiles", t); + ///// /// Display Panotools version if we can if (GetPanoVersion()) @@ -685,6 +689,7 @@ cfg->Write(wxT("/Enblend/EnblendExe"), wxT(HUGIN_ENBLEND_EXE)); cfg->Write(wxT("/Enblend/EnblendArgs"), wxT(HUGIN_ENBLEND_ARGS)); cfg->Write(wxT("/Enblend/DeleteRemappedFiles"), HUGIN_ENBLEND_DELETE_REMAPPED_FILES); + cfg->Write(wxT("/Enblend/UseCroppedFiles"), HUGIN_ENBLEND_USE_CROPPED_FILES); } UpdateDisplayData(); @@ -761,4 +766,5 @@ cfg->Write(wxT("/Enblend/EnblendExe"), MY_G_STR_VAL("prefs_enblend_EnblendExe")); cfg->Write(wxT("/Enblend/EnblendArgs"), MY_G_STR_VAL("prefs_enblend_EnblendArgs")); cfg->Write(wxT("/Enblend/DeleteRemappedFiles"), MY_G_BOOL_VAL("prefs_enblend_DeleteRemapped")); + cfg->Write(wxT("/Enblend/UseCroppedFiles"), MY_G_BOOL_VAL("prefs_enblend_UseCroppedFiles")); } Index: NonaStitcherPanel.cpp =================================================================== RCS file: /cvsroot/hugin/hugin/src/hugin/NonaStitcherPanel.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- NonaStitcherPanel.cpp 16 Aug 2005 20:43:33 -0000 1.53 +++ NonaStitcherPanel.cpp 28 Oct 2005 16:47:50 -0000 1.54 @@ -58,7 +58,9 @@ EVT_CHOICE ( XRCID("nona_choice_interpolator"),NonaStitcherPanel::InterpolatorChanged) EVT_SPINCTRL(XRCID("nona_jpeg_quality"), NonaStitcherPanel::OnSetQuality) EVT_CHECKBOX( XRCID("nona_check_enblend"), NonaStitcherPanel::OnEnblendChanged) + EVT_CHECKBOX( XRCID("nona_save_cropped"), NonaStitcherPanel::OnSaveCropped) EVT_CHOICE ( XRCID("nona_choice_format_final"),NonaStitcherPanel::FileFormatChanged) + EVT_CHOICE ( XRCID("nona_comp_type"),NonaStitcherPanel::OnCompTypeChanged) END_EVENT_TABLE() @@ -86,6 +88,12 @@ m_EnblendCheckBox = XRCCTRL(*this, "nona_check_enblend", wxCheckBox); DEBUG_ASSERT(m_EnblendCheckBox); + m_SaveCroppedCB = XRCCTRL(*this, "nona_save_cropped", wxCheckBox); + DEBUG_ASSERT(m_SaveCroppedCB); + + m_CompTypeChoice = XRCCTRL(*this, "nona_comp_type", wxChoice); + DEBUG_ASSERT(m_CompTypeChoice); + UpdateDisplay(pano.getOptions()); // observe the panorama @@ -120,24 +128,24 @@ { unsigned int nImages = pano.getNrOfImages(); - if (nImages == 0) { - // disable controls - m_InterpolatorChoice->Disable(); - m_FormatChoice->Disable(); - m_JPEGQualitySpin->Disable(); - m_EnblendCheckBox->Disable(); - // - } else { - // enable controls - if (m_InterpolatorChoice->Enable()) - { - m_FormatChoice->Enable(); - m_JPEGQualitySpin->Enable(); - m_EnblendCheckBox->Enable(); - } - // + // if (nImages == 0) { + // disable controls + //m_InterpolatorChoice->Disable(); + //m_FormatChoice->Disable(); + //m_JPEGQualitySpin->Disable(); + //m_EnblendCheckBox->Disable(); + // + //} else { + // enable controls + //if (m_InterpolatorChoice->Enable()) + //{ + //m_FormatChoice->Enable(); + //m_JPEGQualitySpin->Enable(); + //m_EnblendCheckBox->Enable(); + //} + // - m_InterpolatorChoice->SetSelection(opt.interpolator); + m_InterpolatorChoice->SetSelection(opt.interpolator); // translate format int format; @@ -176,6 +184,32 @@ } m_JPEGQualitySpin->SetValue(opt.quality); + if (opt.outputFormat == PanoramaOptions::TIFF || + opt.outputFormat == PanoramaOptions::TIFF_m || + opt.outputFormat == PanoramaOptions::TIFF_multilayer) + { + m_CompTypeChoice->Enable(); + if (opt.tiffCompression == "NONE") { + m_CompTypeChoice->SetSelection(0); + } else if (opt.tiffCompression == "LZW") { + m_CompTypeChoice->SetSelection(1); + } else if (opt.tiffCompression == "DEFLATE") { + m_CompTypeChoice->SetSelection(2); + } else { + DEBUG_ERROR("Unknown compression type"); + } + } else { + m_CompTypeChoice->Disable(); + } + + if (opt.outputFormat == PanoramaOptions::TIFF_m) { + m_SaveCroppedCB->Enable(); + } else { + m_SaveCroppedCB->Disable(); + } + + m_SaveCroppedCB->SetValue(opt.tiff_saveROI); + if (opt.outputFormat == PanoramaOptions::TIFF) { // enable enblend m_EnblendCheckBox->Enable(); @@ -184,7 +218,7 @@ m_EnblendCheckBox->SetValue(false); m_EnblendCheckBox->Disable(); } - } + //} } @@ -282,11 +316,9 @@ // set output to multiple tiff. // hope the next enblend will also contain multilayer support opts.outputFormat = PanoramaOptions::TIFF_m; - if (wxConfigBase::Get()->Read(wxT("/Enblend/WriteCroppedImages"), - HUGIN_ENBLEND_WRITE_CROPPED_IMAGES)) - { - opts.tiff_saveROI = true; - } + + opts. tiff_saveROI = (wxConfigBase::Get()->Read(wxT("/Enblend/UseCroppedFiles"), + HUGIN_ENBLEND_USE_CROPPED_FILES)); } // stitch panorama PT::stitchPanorama(pano, opts, @@ -465,3 +497,37 @@ ); } + +void NonaStitcherPanel::OnSaveCropped(wxCommandEvent & e) +{ + PanoramaOptions opt = pano.getOptions(); + + opt.tiff_saveROI= m_SaveCroppedCB->GetValue(); + + GlobalCmdHist::getInstance().addCommand( + new PT::SetPanoOptionsCmd( pano, opt ) + ); +} + +void NonaStitcherPanel::OnCompTypeChanged( wxCommandEvent & e ) +{ + PanoramaOptions opt = pano.getOptions(); + + switch (e.GetSelection()) { + case 0: + opt.tiffCompression = "NONE"; + break; + case 1: + opt.tiffCompression = "LZW"; + break; + case 2: + opt.tiffCompression = "DEFLATE"; + break; + default: + DEBUG_ERROR("Unknown compression type"); + } + + GlobalCmdHist::getInstance().addCommand( + new PT::SetPanoOptionsCmd( pano, opt ) + ); +} |