Skip to content

Commit

Permalink
Merge pull request #1139 from shimat/pragmaonce
Browse files Browse the repository at this point in the history
#pragma once
  • Loading branch information
shimat authored Dec 31, 2020
2 parents 5921d3f + 2ab8868 commit 4068b18
Show file tree
Hide file tree
Showing 81 changed files with 134 additions and 317 deletions.
2 changes: 2 additions & 0 deletions src/OpenCvSharpExtern/OpenCvSharpExtern.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ copy "$(SolutionDir)opencv_files\opencv451_win_x64\x64\vc16\bin\opencv_videoio_f
<ClCompile Include="imgcodecs.cpp" />
<ClCompile Include="imgproc.cpp" />
<ClCompile Include="img_hash.cpp" />
<ClCompile Include="line_descriptor.cpp" />
<ClCompile Include="ml.cpp" />
<ClCompile Include="objdetect.cpp" />
<ClCompile Include="flann.cpp" />
Expand Down Expand Up @@ -295,6 +296,7 @@ copy "$(SolutionDir)opencv_files\opencv451_win_x64\x64\vc16\bin\opencv_videoio_f
<ClInclude Include="imgproc_Subdiv2D.h" />
<ClInclude Include="img_hash.h" />
<ClInclude Include="include_opencv.h" />
<ClInclude Include="line_descriptor.h" />
<ClInclude Include="ml.h" />
<ClInclude Include="ml_ANN_MLP.h" />
<ClInclude Include="ml_Boost.h" />
Expand Down
9 changes: 9 additions & 0 deletions src/OpenCvSharpExtern/OpenCvSharpExtern.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
<ClCompile Include="dnn_superres.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="line_descriptor.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="core.h">
Expand Down Expand Up @@ -348,6 +351,9 @@
<ClInclude Include="dnn_superres.h">
<Filter>Header Files\dnn_suprerres</Filter>
</ClInclude>
<ClInclude Include="line_descriptor.h">
<Filter>Header Files\line_descriptor</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Source Files">
Expand Down Expand Up @@ -418,5 +424,8 @@
<Filter Include="Header Files\dnn_suprerres">
<UniqueIdentifier>{267ed99d-14d6-4dff-8df8-c9a03bd32a39}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\line_descriptor">
<UniqueIdentifier>{6b664b6f-45fc-4431-b4af-432dcafd6bac}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
9 changes: 5 additions & 4 deletions src/OpenCvSharpExtern/aruco.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#ifndef _CPP_ARUCO_H_
#define _CPP_ARUCO_H_
#pragma once

#include "include_opencv.h"

// ReSharper disable IdentifierTypo
// ReSharper disable CppInconsistentNaming
// ReSharper disable CppNonInlineFunctionDefinitionInHeaderFile

extern "C"
{
struct aruco_DetectorParameters
Expand Down Expand Up @@ -283,5 +286,3 @@ CVAPI(ExceptionStatus) aruco_drawDetectedDiamonds(
cv::aruco::drawDetectedDiamonds(*image, cornerVec, idArray, cpp(borderColor));
END_WRAP
}

#endif
5 changes: 1 addition & 4 deletions src/OpenCvSharpExtern/bgsegm.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef _CPP_BGSEGM_H_
#define _CPP_BGSEGM_H_
#pragma once

// ReSharper disable IdentifierTypo
// ReSharper disable CppInconsistentNaming
Expand Down Expand Up @@ -242,5 +241,3 @@ CVAPI(ExceptionStatus) bgsegm_BackgroundSubtractorGMG_setMaxVal(cv::Ptr<cv::bgse
}

#pragma endregion

#endif
7 changes: 2 additions & 5 deletions src/OpenCvSharpExtern/calib3d.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef _CPP_CALIB3D_H_
#define _CPP_CALIB3D_H_
#pragma once

// ReSharper disable IdentifierTypo
// ReSharper disable CppInconsistentNaming
Expand Down Expand Up @@ -338,7 +337,7 @@ CVAPI(ExceptionStatus) calib3d_drawFrameAxes(
}


static void BlobDetectorDeleter(cv::FeatureDetector *p) {}
static void BlobDetectorDeleter(cv::FeatureDetector *) {}

CVAPI(ExceptionStatus) calib3d_findCirclesGrid_InputArray(
cv::_InputArray *image, MyCvSize patternSize,
Expand Down Expand Up @@ -1196,5 +1195,3 @@ CVAPI(ExceptionStatus) calib3d_findEssentialMat_InputArray2(
*returnValue = new cv::Mat(mat);
END_WRAP
}

#endif
5 changes: 1 addition & 4 deletions src/OpenCvSharpExtern/calib3d_StereoMatcher.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef _CPP_CALIB3D_STEREOMATCHER_H_
#define _CPP_CALIB3D_STEREOMATCHER_H_
#pragma once

// ReSharper disable IdentifierTypo
// ReSharper disable CppInconsistentNaming
Expand Down Expand Up @@ -358,5 +357,3 @@ CVAPI(ExceptionStatus) calib3d_StereoSGBM_setMode(cv::Ptr<cv::StereoSGBM> *obj,
}

#pragma endregion

#endif
5 changes: 1 addition & 4 deletions src/OpenCvSharpExtern/calib3d_fisheye.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef _CPP_CALIB3D_FISHEYE_H_
#define _CPP_CALIB3D_FISHEYE_H_
#pragma once

// ReSharper disable IdentifierTypo
// ReSharper disable CppInconsistentNaming
Expand Down Expand Up @@ -121,5 +120,3 @@ CVAPI(ExceptionStatus) calib3d_fisheye_stereoCalibrate(
cpp(imageSize), entity(R), entity(T), flags, cpp(criteria));
END_WRAP
}

#endif
29 changes: 8 additions & 21 deletions src/OpenCvSharpExtern/core.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#ifndef _CPP_CORE_H_
#define _CPP_CORE_H_
#pragma once

#include "include_opencv.h"

// ReSharper disable IdentifierTypo
// ReSharper disable CppInconsistentNaming
// ReSharper disable CppNonInlineFunctionDefinitionInHeaderFile

#pragma region core.hpp
Expand Down Expand Up @@ -306,7 +307,7 @@ CVAPI(ExceptionStatus) core_repeat1(cv::_InputArray* src, int ny, int nx, cv::_O
CVAPI(ExceptionStatus) core_repeat2(cv::Mat* src, int ny, int nx, cv::Mat** returnValue)
{
BEGIN_WRAP
cv::Mat ret = cv::repeat(*src, ny, nx);
const cv::Mat ret = cv::repeat(*src, ny, nx);
*returnValue = new cv::Mat(ret);
END_WRAP
}
Expand Down Expand Up @@ -567,31 +568,31 @@ CVAPI(ExceptionStatus) core_perspectiveTransform_Mat(cv::Mat *src, cv::Mat *dst,
CVAPI(ExceptionStatus) core_perspectiveTransform_Point2f(cv::Point2f *src, int srcLength, cv::Point2f *dst, int dstLength, cv::_InputArray *m)
{
BEGIN_WRAP
std::vector<cv::Point2f> srcVector(src, src + srcLength);
const std::vector<cv::Point2f> srcVector(src, src + srcLength);
std::vector<cv::Point2f> dstVector(dst, dst + dstLength);
cv::perspectiveTransform(srcVector, dstVector, *m);
END_WRAP
}
CVAPI(ExceptionStatus) core_perspectiveTransform_Point2d(cv::Point2d *src, int srcLength, cv::Point2d *dst, int dstLength, cv::_InputArray *m)
{
BEGIN_WRAP
std::vector<cv::Point2d> srcVector(src, src + srcLength);
const std::vector<cv::Point2d> srcVector(src, src + srcLength);
std::vector<cv::Point2d> dstVector(dst, dst + dstLength);
cv::perspectiveTransform(srcVector, dstVector, *m);
END_WRAP
}
CVAPI(ExceptionStatus) core_perspectiveTransform_Point3f(cv::Point3f *src, int srcLength, cv::Point3f *dst, int dstLength, cv::_InputArray *m)
{
BEGIN_WRAP
std::vector<cv::Point3f> srcVector(src, src + srcLength);
const std::vector<cv::Point3f> srcVector(src, src + srcLength);
std::vector<cv::Point3f> dstVector(dst, dst + dstLength);
cv::perspectiveTransform(srcVector, dstVector, *m);
END_WRAP
}
CVAPI(ExceptionStatus) core_perspectiveTransform_Point3d(cv::Point3d *src, int srcLength, cv::Point3d *dst, int dstLength, cv::_InputArray *m)
{
BEGIN_WRAP
std::vector<cv::Point3d> srcVector(src, src + srcLength);
const std::vector<cv::Point3d> srcVector(src, src + srcLength);
std::vector<cv::Point3d> dstVector(dst, dst + dstLength);
cv::perspectiveTransform(srcVector, dstVector, *m);
END_WRAP
Expand Down Expand Up @@ -1024,17 +1025,6 @@ CVAPI(ExceptionStatus) core_getNumberOfCPUs(int* returnValue)
END_WRAP
}

/*
CVAPI(void*) core_fastMalloc(size_t bufSize)
{
return cv::fastMalloc(bufSize);
}
CVAPI(void) core_fastFree(void *ptr)
{
return cv::fastFree(ptr);
}
*/

CVAPI(ExceptionStatus) core_setUseOptimized(int onoff)
{
BEGIN_WRAP
Expand Down Expand Up @@ -1082,6 +1072,3 @@ CVAPI(ExceptionStatus) core_RNG_gaussian(uint64 *state, double sigma, double *re
}

#pragma endregion


#endif
5 changes: 1 addition & 4 deletions src/OpenCvSharpExtern/core_Algorithm.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef _CPP_CORE_ALGORITHM_H_
#define _CPP_CORE_ALGORITHM_H_
#pragma once

#include "include_opencv.h"

Expand Down Expand Up @@ -37,5 +36,3 @@ CVAPI(ExceptionStatus) core_Algorithm_getDefaultName(cv::Algorithm *obj, std::st
buf->assign(obj->getDefaultName());
END_WRAP
}

#endif
9 changes: 5 additions & 4 deletions src/OpenCvSharpExtern/core_FileNode.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#ifndef _CPP_CORE_FILENODE_H_
#define _CPP_CORE_FILENODE_H_
#pragma once

#include "include_opencv.h"

// ReSharper disable IdentifierTypo
// ReSharper disable CppInconsistentNaming
// ReSharper disable CppNonInlineFunctionDefinitionInHeaderFile

CVAPI(ExceptionStatus) core_FileNode_new1(cv::FileNode **returnValue)
{
BEGIN_WRAP
Expand Down Expand Up @@ -446,5 +449,3 @@ CVAPI(ExceptionStatus) core_FileNodeIterator_operatorLessThan(cv::FileNodeIterat
}

#pragma endregion

#endif
9 changes: 5 additions & 4 deletions src/OpenCvSharpExtern/core_FileStorage.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#ifndef _CPP_CORE_FILESTORAGE_H_
#define _CPP_CORE_FILESTORAGE_H_
#pragma once

#include "include_opencv.h"

// ReSharper disable IdentifierTypo
// ReSharper disable CppInconsistentNaming
// ReSharper disable CppNonInlineFunctionDefinitionInHeaderFile

#pragma region FileStorage

CVAPI(ExceptionStatus) core_FileStorage_new1(cv::FileStorage **returnValue)
Expand Down Expand Up @@ -498,5 +501,3 @@ CVAPI(ExceptionStatus) core_FileStorage_shift_Vec6w(cv::FileStorage *fs, CvVec6w
}

#pragma endregion

#endif
7 changes: 3 additions & 4 deletions src/OpenCvSharpExtern/core_InputArray.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#ifndef _CPP_CORE_INPUTARRAY_H_
#define _CPP_CORE_INPUTARRAY_H_
#pragma once

#include "include_opencv.h"

// ReSharper disable IdentifierTypo
// ReSharper disable CppInconsistentNaming
// ReSharper disable CppNonInlineFunctionDefinitionInHeaderFile

CVAPI(ExceptionStatus) core_InputArray_new_byMat(cv::Mat *mat, cv::_InputArray **returnValue)
Expand Down Expand Up @@ -301,5 +302,3 @@ CVAPI(ExceptionStatus) core_InputArray_isGpuMatVector(cv::_InputArray *ia, int *
*returnValue = ia->isGpuMatVector() ? 1 : 0;
END_WRAP
}

#endif
6 changes: 2 additions & 4 deletions src/OpenCvSharpExtern/core_LDA.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef _CPP_CORE_LDA_H_
#define _CPP_CORE_LDA_H_
#pragma once

// ReSharper disable IdentifierTypo
// ReSharper disable CppInconsistentNaming
// ReSharper disable CppNonInlineFunctionDefinitionInHeaderFile

Expand Down Expand Up @@ -108,5 +108,3 @@ CVAPI(ExceptionStatus) core_LDA_subspaceReconstruct(cv::_InputArray *W, cv::_Inp
*returnValue = new cv::Mat(mat);
END_WRAP
}

#endif
7 changes: 3 additions & 4 deletions src/OpenCvSharpExtern/core_Mat.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#ifndef _CPP_CORE_MAT_H_
#define _CPP_CORE_MAT_H_
#pragma once

#include "include_opencv.h"

// ReSharper disable IdentifierTypo
// ReSharper disable CppInconsistentNaming
// ReSharper disable CppNonInlineFunctionDefinitionInHeaderFile

#pragma region Init & Release
Expand Down Expand Up @@ -1487,5 +1488,3 @@ CVAPI(ExceptionStatus) core_Mat_operatorNE_MatDouble(cv::Mat *a, double b, cv::M
}

#pragma endregion

#endif
9 changes: 5 additions & 4 deletions src/OpenCvSharpExtern/core_MatExpr.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#ifndef _CPP_CORE_MATEXPR_H_
#define _CPP_CORE_MATEXPR_H_
#pragma once

#include "include_opencv.h"

// ReSharper disable IdentifierTypo
// ReSharper disable CppInconsistentNaming
// ReSharper disable CppNonInlineFunctionDefinitionInHeaderFile

CVAPI(ExceptionStatus) core_MatExpr_new1(cv::MatExpr **returnValue)
{
BEGIN_WRAP
Expand Down Expand Up @@ -296,5 +299,3 @@ CVAPI(ExceptionStatus) core_abs_MatExpr(cv::MatExpr *e, cv::MatExpr **returnValu
*returnValue = new cv::MatExpr(ret);
END_WRAP
}

#endif
5 changes: 1 addition & 4 deletions src/OpenCvSharpExtern/core_OutputArray.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef _CPP_CORE_OUTPUTARRAY_H_
#define _CPP_CORE_OUTPUTARRAY_H_
#pragma once

#include "include_opencv.h"

Expand Down Expand Up @@ -71,5 +70,3 @@ CVAPI(ExceptionStatus) core_OutputArray_getVectorOfMat(cv::_OutputArray *oa, std
}
END_WRAP
}

#endif
5 changes: 1 addition & 4 deletions src/OpenCvSharpExtern/core_PCA.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef _CPP_CORE_PCA_H_
#define _CPP_CORE_PCA_H_
#pragma once

#include "include_opencv.h"

Expand Down Expand Up @@ -115,5 +114,3 @@ CVAPI(ExceptionStatus) core_PCA_read(cv::PCA *obj, cv::FileNode *fn)
obj->read(*fn);
END_WRAP
}

#endif
5 changes: 1 addition & 4 deletions src/OpenCvSharpExtern/core_SVD.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef _CPP_CORE_SVD_H_
#define _CPP_CORE_SVD_H_
#pragma once

// ReSharper disable CppInconsistentNaming
// ReSharper disable CppNonInlineFunctionDefinitionInHeaderFile
Expand Down Expand Up @@ -88,5 +87,3 @@ CVAPI(ExceptionStatus) core_SVD_vt(cv::SVD *obj, cv::Mat **returnValue)
*returnValue = new cv::Mat(obj->vt);
END_WRAP
}

#endif
5 changes: 1 addition & 4 deletions src/OpenCvSharpExtern/core_SparseMat.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef _CPP_CORE_SPARSEMAT_H_
#define _CPP_CORE_SPARSEMAT_H_
#pragma once

// ReSharper disable CppInconsistentNaming
// ReSharper disable CppNonInlineFunctionDefinitionInHeaderFile
Expand Down Expand Up @@ -259,5 +258,3 @@ CVAPI(ExceptionStatus) core_SparseMat_ptr_nd(cv::SparseMat *obj, const int* idx,
}
END_WRAP
}

#endif
Loading

0 comments on commit 4068b18

Please sign in to comment.