mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Merge pull request #12310 from cv3d:chunks/enum_interface
* Cleanup macros and enable expansion of `__VA_ARGS__` for Visual Studio * Macros for enum-arguments backwards compatibility * Convert struct Param to enum struct * Enabled ParamType.type for enum types * Enabled `cv.read` and `cv.write` for enum types * Rename unnamed enum to AAKAZE.DescriptorType * Rename unnamed enum to AccessFlag * Rename unnamed enum to AgastFeatureDetector.DetectorType * Convert struct DrawMatchesFlags to enum struct * Rename unnamed enum to FastFeatureDetector.DetectorType * Rename unnamed enum to Formatter.FormatType * Rename unnamed enum to HOGDescriptor.HistogramNormType * Rename unnamed enum to DescriptorMatcher.MatcherType * Rename unnamed enum to KAZE.DiffusivityType * Rename unnamed enum to ORB.ScoreType * Rename unnamed enum to UMatData.MemoryFlag * Rename unnamed enum to _InputArray.KindFlag * Rename unnamed enum to _OutputArray.DepthMask * Convert normType enums to static const NormTypes * Avoid conflicts with ElemType * Rename unnamed enum to DescriptorStorageFormat
This commit is contained in:
committed by
Alexander Alekhin
parent
84ae8097b1
commit
ef5579dc86
@@ -95,7 +95,7 @@ struct CV_EXPORTS_W DictValue
|
||||
|
||||
private:
|
||||
|
||||
int type;
|
||||
Param type;
|
||||
|
||||
union
|
||||
{
|
||||
@@ -105,7 +105,7 @@ private:
|
||||
void *pv;
|
||||
};
|
||||
|
||||
DictValue(int _type, void *_p) : type(_type), pv(_p) {}
|
||||
DictValue(Param _type, void *_p) : type(_type), pv(_p) {}
|
||||
void release();
|
||||
};
|
||||
|
||||
|
||||
@@ -199,6 +199,16 @@ inline void DictValue::release()
|
||||
case Param::REAL:
|
||||
delete pd;
|
||||
break;
|
||||
case Param::BOOLEAN:
|
||||
case Param::MAT:
|
||||
case Param::MAT_VECTOR:
|
||||
case Param::ALGORITHM:
|
||||
case Param::FLOAT:
|
||||
case Param::UNSIGNED_INT:
|
||||
case Param::UINT64:
|
||||
case Param::UCHAR:
|
||||
case Param::SCALAR:
|
||||
break; // unhandled
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,8 +283,18 @@ inline int DictValue::size() const
|
||||
return (int)ps->size();
|
||||
case Param::REAL:
|
||||
return (int)pd->size();
|
||||
case Param::BOOLEAN:
|
||||
case Param::MAT:
|
||||
case Param::MAT_VECTOR:
|
||||
case Param::ALGORITHM:
|
||||
case Param::FLOAT:
|
||||
case Param::UNSIGNED_INT:
|
||||
case Param::UINT64:
|
||||
case Param::UCHAR:
|
||||
case Param::SCALAR:
|
||||
break; // unhandled
|
||||
}
|
||||
CV_Error(Error::StsInternal, "");
|
||||
CV_Error_(Error::StsInternal, ("Unhandled type (%d)", static_cast<int>(type)));
|
||||
}
|
||||
|
||||
inline std::ostream &operator<<(std::ostream &stream, const DictValue &dictv)
|
||||
|
||||
Reference in New Issue
Block a user