拆分imageOperatorBase.cpp文件,

并注释了 引起编译器错误的函数
pull/13/head
陈增辉 2025-03-25 17:30:03 +08:00
parent 17aca87ef0
commit 54a4273ecd
11 changed files with 1923 additions and 102 deletions

View File

@ -220,10 +220,11 @@
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
<OpenMPSupport>true</OpenMPSupport>
<LanguageStandard>stdcpp14</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -269,38 +270,33 @@
<ItemGroup>
<ClInclude Include="BaseTool\BaseConstVariable.h" />
<ClInclude Include="BaseTool\BaseTool.h" />
<ClInclude Include="BaseTool\EchoDataFormat.h" />
<ClInclude Include="BaseTool\FileOperator.h" />
<ClInclude Include="BaseTool\GeoOperator.h" />
<ClInclude Include="BaseTool\ImageOperatorBase.h" />
<ClInclude Include="BaseTool\LogInfoCls.h" />
<QtMoc Include="ToolAbstract\QToolAbstract.h" />
<QtMoc Include="BaseTool\QToolProcessBarDialog.h" />
<ClInclude Include="ShowProessAbstract.h" />
<QtMoc Include="ToolAbstract\QToolAbstract.h" />
<ClInclude Include="BaseTool\PrintMsgToQDebug.h" />
<ClInclude Include="BaseTool\RasterToolBase.h" />
<ClInclude Include="BaseTool\SARSimulationImageL1.h" />
<ClInclude Include="BaseTool\stdafx.h" />
<ClInclude Include="framework.h" />
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="BaseTool\BaseTool.cpp" />
<ClCompile Include="BaseTool\EchoDataFormat.cpp" />
<ClCompile Include="BaseTool\FileOperator.cpp" />
<ClCompile Include="BaseTool\gdalImageComplexOperator.cpp" />
<ClCompile Include="BaseTool\gdalImageOperator.cpp" />
<ClCompile Include="BaseTool\GeoOperator.cpp" />
<ClCompile Include="BaseTool\ImageOperatorBase.cpp" />
<ClCompile Include="BaseTool\LogInfoCls.cpp" />
<ClCompile Include="BaseTool\MergeRasterOperator.cpp" />
<ClCompile Include="BaseTool\PrintMsgToQDebug.cpp" />
<ClCompile Include="BaseTool\QToolProcessBarDialog.cpp" />
<ClCompile Include="BaseTool\RasterToolBase.cpp" />
<ClCompile Include="BaseTool\SARSimulationImageL1.cpp" />
<ClCompile Include="BaseTool\ShowProessAbstract.cpp" />
<ClCompile Include="BaseTool\stdafx.cpp" />
<ClCompile Include="BaseTool\TestImageOperator.cpp" />
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="ImageOperatorFuntion.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>

View File

@ -33,33 +33,30 @@
<ClInclude Include="BaseTool\BaseTool.h">
<Filter>BaseTool</Filter>
</ClInclude>
<ClInclude Include="BaseTool\EchoDataFormat.h">
<Filter>BaseTool</Filter>
</ClInclude>
<ClInclude Include="BaseTool\FileOperator.h">
<Filter>BaseTool</Filter>
</ClInclude>
<ClInclude Include="BaseTool\GeoOperator.h">
<Filter>BaseTool</Filter>
</ClInclude>
<ClInclude Include="BaseTool\ImageOperatorBase.h">
<Filter>BaseTool</Filter>
</ClInclude>
<ClInclude Include="BaseTool\LogInfoCls.h">
<Filter>BaseTool</Filter>
</ClInclude>
<ClInclude Include="BaseTool\RasterToolBase.h">
<Filter>BaseTool</Filter>
</ClInclude>
<ClInclude Include="BaseTool\SARSimulationImageL1.h">
<Filter>BaseTool</Filter>
</ClInclude>
<ClInclude Include="BaseTool\stdafx.h">
<Filter>BaseTool</Filter>
</ClInclude>
<ClInclude Include="BaseTool\PrintMsgToQDebug.h">
<Filter>BaseTool</Filter>
</ClInclude>
<ClInclude Include="ShowProessAbstract.h">
<Filter>BaseTool</Filter>
</ClInclude>
<ClInclude Include="BaseTool\ImageOperatorBase.h">
<Filter>BaseTool</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
@ -71,30 +68,18 @@
<ClCompile Include="BaseTool\BaseTool.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
<ClCompile Include="BaseTool\EchoDataFormat.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
<ClCompile Include="BaseTool\FileOperator.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
<ClCompile Include="BaseTool\GeoOperator.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
<ClCompile Include="BaseTool\ImageOperatorBase.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
<ClCompile Include="BaseTool\LogInfoCls.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
<ClCompile Include="BaseTool\QToolProcessBarDialog.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
<ClCompile Include="BaseTool\RasterToolBase.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
<ClCompile Include="BaseTool\SARSimulationImageL1.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
<ClCompile Include="BaseTool\stdafx.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
@ -104,31 +89,33 @@
<ClCompile Include="BaseTool\PrintMsgToQDebug.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
<ClCompile Include="BaseTool\ShowProessAbstract.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
<ClCompile Include="BaseTool\gdalImageOperator.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
<ClCompile Include="BaseTool\gdalImageComplexOperator.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
<ClCompile Include="BaseTool\ShowProessAbstract.cpp">
<ClCompile Include="ImageOperatorFuntion.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
<ClCompile Include="BaseTool\TestImageOperator.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="BaseTool\MergeRasterOperator.cpp">
<ClCompile Include="BaseTool\QToolProcessBarDialog.cpp">
<Filter>BaseTool</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<QtMoc Include="BaseTool\QToolProcessBarDialog.h">
<Filter>头文件</Filter>
</QtMoc>
<QtMoc Include="ToolAbstract\QToolAbstract.h">
<Filter>ToolAbstract</Filter>
</QtMoc>
<QtMoc Include="BaseTool\QToolProcessBarDialog.h">
<Filter>BaseTool</Filter>
</QtMoc>
</ItemGroup>
<ItemGroup>
<QtUic Include="BaseTool\QToolProcessBarDialog.ui" />
<QtUic Include="BaseTool\QToolProcessBarDialog.ui">
<Filter>BaseTool</Filter>
</QtUic>
</ItemGroup>
</Project>

View File

@ -39,17 +39,17 @@
#include <time.h>
/** 打印时间 ***************************************************************/
inline char* get_cur_time() {
static char s[20];
time_t t;
struct tm* ltime;
time(&t);
ltime = localtime(&t);
strftime(s, 20, "%Y-%m-%d %H:%M:%S", ltime);
return s;
}
//inline char* get_cur_time() {
// static char s[20];
// time_t t;
// struct tm* ltime;
// time(&t);
// ltime = localtime(&t);
// strftime(s, 20, "%Y-%m-%d %H:%M:%S", ltime);
// return s;
//}
#define PRINT(fmt, ...) printf("%s " fmt, get_cur_time(), ##__VA_ARGS__);
//#define PRINT(fmt, ...) printf("%s " fmt, get_cur_time(), ##__VA_ARGS__);

View File

@ -746,18 +746,6 @@ void clipRaster(QString inRasterPath, QString outRasterPath, long minRow, long m
}
bool saveEigenMatrixXd2Bin(Eigen::MatrixXd data, QString dataStrPath)
{
Eigen::MatrixXd gt = Eigen::MatrixXd::Zero(2, 3);
gdalImage img= CreategdalImageDouble(dataStrPath, data.rows(), data.cols(), 1, gt, "", false, true,true);
img.saveImage(data, 0,0,1);
return true;
}
long getProjectEPSGCodeByLon_Lat(double long, double lat, ProjectStripDelta stripState)
@ -1788,7 +1776,17 @@ void CreateSARIntensityByLookTable(QString IntensityRasterPath,
}
bool saveEigenMatrixXd2Bin(Eigen::MatrixXd data, QString dataStrPath)
{
Eigen::MatrixXd gt = Eigen::MatrixXd::Zero(2, 3);
gdalImage img = CreategdalImageDouble(dataStrPath, data.rows(), data.cols(), 1, gt, "", false, true, true);
img.saveImage(data, 0, 0, 1);
return true;
}

View File

@ -28,6 +28,9 @@
#include <QObject>
#include <QList>
#include <functional>
#include "ShowProessAbstract.h"
enum ProjectStripDelta {
Strip_6, // 6度带
@ -76,13 +79,6 @@ enum GDALREADARRCOPYMETHOD {
class BASECONSTVARIABLEAPI ShowProessAbstract {
public:
virtual void showProcess(double precent, QString tip);
virtual void showToolInfo(QString tip);
};
@ -234,7 +230,7 @@ public: // 方法
Eigen::MatrixXcd getDataComplex(int start_row, int start_col, int rows_count, int cols_count, int band_ids);
std::shared_ptr<std::complex<double>> getDataComplexSharePtr(int start_row, int start_col, int rows_count, int cols_count, int band_ids);
void saveImage() override;
void saveComplexImage();//override;
void savePreViewImage();
public:
Eigen::MatrixXcd data;
@ -316,6 +312,9 @@ void BASECONSTVARIABLEAPI CreateSARIntensityByLookTable(QString IntensityRaster
//--------------------- 图像文件读写 ------------------------------
template<typename T>
inline std::shared_ptr<T> readDataArr(gdalImage& imgds, long start_row, long start_col, long& rows_count, long& cols_count, int band_ids, GDALREADARRCOPYMETHOD method)
{

View File

@ -261,6 +261,9 @@ namespace RasterToolBase {
} else if(oSRS.IsProjected()) {
return CoordinateSystemType::ProjectCoordinateSystem;
}
else {
return CoordinateSystemType::UNKNOW;
}
} else {
return CoordinateSystemType::UNKNOW;
}

View File

@ -1,34 +1,9 @@
#include "stdafx.h"
#include "ImageOperatorBase.h"
#include "ShowProessAbstract.h"
#include "BaseTool.h"
#include "GeoOperator.h"
#include <Eigen/Core>
#include <Eigen/Dense>
#include <omp.h>
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <gdal.h>
#include <gdal_utils.h>
#include <gdal_priv.h>
#include <gdalwarper.h>
#include <proj.h>
#include <string.h>
#include <memory>
#include <iostream>
#include "FileOperator.h"
#include <opencv2/opencv.hpp>
#include <QMessageBox>
#include <QDir>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <QProgressDialog>
#include <gdal_priv.h>
#include <ogr_spatialref.h> // OGRSpatialReference 用于空间参考转换
#include <gdal_alg.h> // 用于 GDALWarp 操作
#include <QString>
void ShowProessAbstract::showProcess(double precent, QString tip)

View File

@ -324,7 +324,7 @@ std::shared_ptr<std::complex<double>> gdalImageComplex::getDataComplexSharePtr(i
return rasterData;
}
void gdalImageComplex::saveImage()
void gdalImageComplex::saveComplexImage()
{
this->saveImage(this->data, this->start_row, this->start_col, this->data_band_ids);
}

View File

@ -988,6 +988,9 @@ void gdalImage::saveImage()
this->saveImage(this->data, this->start_row, this->start_col, this->data_band_ids);
}
void gdalImage::setNoDataValue(double nodatavalue = -9999, int band_ids = 1)
{
GDALAllRegister();
@ -1471,7 +1474,3 @@ gdalImage CreategdalImage(const QString& img_path, int height, int width, int ba

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,15 @@
#ifndef __SHOWPROCESSABSTRACT_H__
#define __SHOWPROCESSABSTRACT_H__
#include "BaseConstVariable.h"
#include <QString>
class BASECONSTVARIABLEAPI ShowProessAbstract {
public:
virtual void showProcess(double precent, QString tip);
virtual void showToolInfo(QString tip);
};
#endif