1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #23224 from VadimLevin:dev/vlevin/cxx-named-arguments

This commit is contained in:
Alexander Alekhin
2023-02-08 17:31:30 +00:00
5 changed files with 250 additions and 60 deletions
@@ -243,6 +243,33 @@ struct CV_EXPORTS_W_SIMPLE ClassWithKeywordProperties {
}
};
struct CV_EXPORTS_W_PARAMS FunctionParams
{
CV_PROP_RW int lambda = -1;
CV_PROP_RW float sigma = 0.0f;
FunctionParams& setLambda(int value) CV_NOEXCEPT
{
lambda = value;
return *this;
}
FunctionParams& setSigma(float value) CV_NOEXCEPT
{
sigma = value;
return *this;
}
};
CV_WRAP static inline String
copyMatAndDumpNamedArguments(InputArray src, OutputArray dst,
const FunctionParams& params = FunctionParams())
{
src.copyTo(dst);
return format("lambda=%d, sigma=%.1f", params.lambda,
params.sigma);
}
namespace nested {
CV_WRAP static inline bool testEchoBooleanFunction(bool flag) {
return flag;
@@ -459,6 +459,7 @@ Cv64suf;
#define CV_EXPORTS_W_SIMPLE CV_EXPORTS
#define CV_EXPORTS_AS(synonym) CV_EXPORTS
#define CV_EXPORTS_W_MAP CV_EXPORTS
#define CV_EXPORTS_W_PARAMS CV_EXPORTS
#define CV_IN_OUT
#define CV_OUT
#define CV_PROP