"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "saga-gis/src/tools/io/io_grid_image/grid_export.cpp" between
saga-7.6.2_src.zip and saga-7.6.3_src.zip

About: SAGA (System for Automated Geoscientific Analyses) is a Geographic Information System (GIS) software for geodata processing and analysis. All source codes.

grid_export.cpp  (saga-7.6.2_src):grid_export.cpp  (saga-7.6.3_src)
/**********************************************************
* Version $Id$
*********************************************************/
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// // // //
// SAGA // // SAGA //
// // // //
// System for Automated Geoscientific Analyses // // System for Automated Geoscientific Analyses //
// // // //
// Tool Library // // Tool Library //
// image_io // // image_io //
// // // //
skipping to change at line 52 skipping to change at line 49
// e-mail: oconrad@saga-gis.org // // e-mail: oconrad@saga-gis.org //
// // // //
// contact: Olaf Conrad // // contact: Olaf Conrad //
// Institute of Geography // // Institute of Geography //
// University of Hamburg // // University of Hamburg //
// Germany // // Germany //
// // // //
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//--------------------------------------------------------- //---------------------------------------------------------
///////////////////////////////////////////////////////////
//
//
//
//
//
//
///////////////////////////////////////////////////////////
//---------------------------------------------------------
#include <wx/filename.h> #include <wx/filename.h>
#include <wx/image.h> #include <wx/image.h>
#include <wx/quantize.h> #include <wx/quantize.h>
#include "grid_export.h" #include "grid_export.h"
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// // // //
// // // //
// // // //
skipping to change at line 211 skipping to change at line 200
CSG_String::Format("%s|%s|%s", CSG_String::Format("%s|%s|%s",
_TL("linear intervals"), _TL("linear intervals"),
_TL("increasing geometrical intervals"), _TL("increasing geometrical intervals"),
_TL("decreasing geometrical intervals") _TL("decreasing geometrical intervals")
), 0 ), 0
); );
Parameters.Add_Double("SCALE_MODE", Parameters.Add_Double("SCALE_MODE",
"SCALE_LOG" , _TL("Geometrical Interval Factor"), "SCALE_LOG" , _TL("Geometrical Interval Factor"),
_TL(""), _TL(""),
10.0, 0.001, true 10., 0.001, true
); );
//----------------------------------------------------- //-----------------------------------------------------
CSG_Table *pLUT = Parameters.Add_FixedTable("", "LUT", _TL("Looku p Table"), _TL(""))->asTable(); CSG_Table *pLUT = Parameters.Add_FixedTable("", "LUT", _TL("Looku p Table"), _TL(""))->asTable();
pLUT->Set_Name(_TL("Table")); pLUT->Set_Name(_TL("Table"));
pLUT->Add_Field("Color" , SG_DATATYPE_Color ); pLUT->Add_Field("Color" , SG_DATATYPE_Color );
pLUT->Add_Field("Name" , SG_DATATYPE_String); pLUT->Add_Field("Name" , SG_DATATYPE_String);
pLUT->Add_Field("Description", SG_DATATYPE_String); pLUT->Add_Field("Description", SG_DATATYPE_String);
skipping to change at line 432 skipping to change at line 421
#ifdef _SAGA_MSW #ifdef _SAGA_MSW
else if( SG_File_Cmp_Extension(fName, "bmp") ) pImgHandler = new wxBMPHandler ; else if( SG_File_Cmp_Extension(fName, "bmp") ) pImgHandler = new wxBMPHandler ;
#endif #endif
else/*if(SG_File_Cmp_Extension(fName, "png") )*/pImgHandler = new wxPNGHandler ; else/*if(SG_File_Cmp_Extension(fName, "png") )*/pImgHandler = new wxPNGHandler ;
wxImage::AddHandler(pImgHandler); wxImage::AddHandler(pImgHandler);
} }
bool bOkay = Image.SaveFile(fName.c_str()); bool bOkay = Image.SaveFile(fName.c_str());
if( !has_GUI() && pImgHandler != NULL ) if( !SG_UI_Get_Window_Main() && pImgHandler != NULL )
{ {
wxImage::RemoveHandler(pImgHandler->GetName()); wxImage::RemoveHandler(pImgHandler->GetName());
} }
if( !bOkay ) if( !bOkay )
{ {
Error_Fmt("%s [%s]", _TL("failed to save image file"), fName.c_st r()); Error_Fmt("%s [%s]", _TL("failed to save image file"), fName.c_st r());
return( false ); return( false );
} }
skipping to change at line 456 skipping to change at line 445
if ( SG_File_Cmp_Extension(fName, "bmp") ) Stream.Open(SG_File_Make_P ath("", fName, "bpw"), SG_FILE_W, false); if ( SG_File_Cmp_Extension(fName, "bmp") ) Stream.Open(SG_File_Make_P ath("", fName, "bpw"), SG_FILE_W, false);
else if( SG_File_Cmp_Extension(fName, "jpg") ) Stream.Open(SG_File_Make_P ath("", fName, "jgw"), SG_FILE_W, false); else if( SG_File_Cmp_Extension(fName, "jpg") ) Stream.Open(SG_File_Make_P ath("", fName, "jgw"), SG_FILE_W, false);
else if( SG_File_Cmp_Extension(fName, "pcx") ) Stream.Open(SG_File_Make_P ath("", fName, "pxw"), SG_FILE_W, false); else if( SG_File_Cmp_Extension(fName, "pcx") ) Stream.Open(SG_File_Make_P ath("", fName, "pxw"), SG_FILE_W, false);
else if( SG_File_Cmp_Extension(fName, "png") ) Stream.Open(SG_File_Make_P ath("", fName, "pgw"), SG_FILE_W, false); else if( SG_File_Cmp_Extension(fName, "png") ) Stream.Open(SG_File_Make_P ath("", fName, "pgw"), SG_FILE_W, false);
else if( SG_File_Cmp_Extension(fName, "tif") ) Stream.Open(SG_File_Make_P ath("", fName, "tfw"), SG_FILE_W, false); else if( SG_File_Cmp_Extension(fName, "tif") ) Stream.Open(SG_File_Make_P ath("", fName, "tfw"), SG_FILE_W, false);
if( Stream.is_Open() ) if( Stream.is_Open() )
{ {
Stream.Printf("%.10f\n%f\n%f\n%.10f\n%.10f\n%.10f\n", Stream.Printf("%.10f\n%f\n%f\n%.10f\n%.10f\n%.10f\n",
Get_Cellsize(), 0.0, 0.0, -Get_Cellsize(), Get_XMin(), G et_YMax() Get_Cellsize(), 0., 0., -Get_Cellsize(), Get_XMin(), Get _YMax()
); );
} }
//----------------------------------------------------- //-----------------------------------------------------
CSG_Projection Projection = Parameters("GRID")->asGrid()->Get_Proje ction(); CSG_Projection Projection = Parameters("GRID")->asGrid()->Get_Proje ction();
if( Projection.is_Okay() ) if( Projection.is_Okay() )
{ {
Projection.Save(SG_File_Make_Path("", fName, "prj"), SG_PROJ_FMT_ WKT); Projection.Save(SG_File_Make_Path("", fName, "prj"), SG_PROJ_FMT_ WKT);
} }
skipping to change at line 541 skipping to change at line 530
Minimum = pGrid->Get_Min() + pGrid->Get_Range() * Parameters("LIN EAR.MIN")->asDouble() / 100.; Minimum = pGrid->Get_Min() + pGrid->Get_Range() * Parameters("LIN EAR.MIN")->asDouble() / 100.;
Maximum = pGrid->Get_Max() + pGrid->Get_Range() * Parameters("LIN EAR.MAX")->asDouble() / 100.; Maximum = pGrid->Get_Max() + pGrid->Get_Range() * Parameters("LIN EAR.MAX")->asDouble() / 100.;
break; break;
case 2: // histogram stretch to value range case 2: // histogram stretch to value range
Minimum = Parameters("STRETCH.MIN")->asDouble(); Minimum = Parameters("STRETCH.MIN")->asDouble();
Maximum = Parameters("STRETCH.MAX")->asDouble(); Maximum = Parameters("STRETCH.MAX")->asDouble();
break; break;
} }
if( Minimum >= Maximum || pGrid->Get_Range() <= 0.0 ) if( Minimum >= Maximum || pGrid->Get_Range() <= 0. )
{ {
Error_Set(_TL("invalid user specified value range.")); Error_Set(_TL("invalid user specified value range."));
return( false ); return( false );
} }
//------------------------------------------------- //-------------------------------------------------
#pragma omp parallel for #pragma omp parallel for
for(int y=0; y<Get_NY(); y++) for(int y=0; y<Get_NY(); y++)
{ {
skipping to change at line 680 skipping to change at line 669
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// // // //
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
//--------------------------------------------------------- //---------------------------------------------------------
bool CGrid_Export::Add_Shading(CSG_Grid &Grid) bool CGrid_Export::Add_Shading(CSG_Grid &Grid)
{ {
CSG_Grid *pShade = Parameters("SHADE")->asGrid(); CSG_Grid *pShade = Parameters("SHADE")->asGrid();
if( !pShade || pShade->Get_Range() <= 0.0 || Parameters("SHADE_BRIGHT.MIN ")->asDouble() >= Parameters("SHADE_BRIGHT.MAX")->asDouble() ) if( !pShade || pShade->Get_Range() <= 0. || Parameters("SHADE_BRIGHT.MIN" )->asDouble() >= Parameters("SHADE_BRIGHT.MAX")->asDouble() )
{ {
return( false ); return( false );
} }
//----------------------------------------------------- //-----------------------------------------------------
double Minimum, Maximum, Scale, Transparency = Parameters("SHADE_TRANS ")->asDouble() / 100.0; double Minimum, Maximum, Scale, Transparency = Parameters("SHADE_TRANS ")->asDouble() / 100.;
switch( Parameters("SHADE_COLOURING")->asInt() ) switch( Parameters("SHADE_COLOURING")->asInt() )
{ {
default: default:
Minimum = pShade->Get_Min() + pShade->Get_Range() * Parameters("S HADE_BRIGHT.MIN")->asDouble() / 100.; Minimum = pShade->Get_Min() + pShade->Get_Range() * Parameters("S HADE_BRIGHT.MIN")->asDouble() / 100.;
Maximum = pShade->Get_Min() + pShade->Get_Range() * Parameters("S HADE_BRIGHT.MAX")->asDouble() / 100.; Maximum = pShade->Get_Min() + pShade->Get_Range() * Parameters("S HADE_BRIGHT.MAX")->asDouble() / 100.;
break; break;
case 1: case 1:
Minimum = pShade->Get_Mean() - pShade->Get_StdDev() * Parameters( "SHADE_STDDEV")->asDouble(); if( Minimum < pShade->Get_Min() ) Minimum = pShade- >Get_Min(); Minimum = pShade->Get_Mean() - pShade->Get_StdDev() * Parameters( "SHADE_STDDEV")->asDouble(); if( Minimum < pShade->Get_Min() ) Minimum = pShade- >Get_Min();
 End of changes. 8 change blocks. 
20 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)