mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
feat: named arguments handling in Python interface
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user