mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 07:13:02 +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
@@ -64,7 +64,7 @@ UMatData::UMatData(const MatAllocator* allocator)
|
||||
urefcount = refcount = mapcount = 0;
|
||||
data = origdata = 0;
|
||||
size = 0;
|
||||
flags = 0;
|
||||
flags = static_cast<UMatData::MemoryFlag>(0);
|
||||
handle = 0;
|
||||
userdata = 0;
|
||||
allocatorFlags_ = 0;
|
||||
@@ -78,7 +78,7 @@ UMatData::~UMatData()
|
||||
CV_Assert(mapcount == 0);
|
||||
data = origdata = 0;
|
||||
size = 0;
|
||||
flags = 0;
|
||||
flags = static_cast<UMatData::MemoryFlag>(0);
|
||||
handle = 0;
|
||||
userdata = 0;
|
||||
allocatorFlags_ = 0;
|
||||
@@ -333,7 +333,7 @@ void finalizeHdr(UMat& m)
|
||||
}
|
||||
|
||||
|
||||
UMat Mat::getUMat(int accessFlags, UMatUsageFlags usageFlags) const
|
||||
UMat Mat::getUMat(AccessFlag accessFlags, UMatUsageFlags usageFlags) const
|
||||
{
|
||||
UMat hdr;
|
||||
if(!data)
|
||||
@@ -444,13 +444,13 @@ void UMat::create(int d, const int* _sizes, int _type, UMatUsageFlags _usageFlag
|
||||
}
|
||||
CV_TRY
|
||||
{
|
||||
u = a->allocate(dims, size, _type, 0, step.p, 0, usageFlags);
|
||||
u = a->allocate(dims, size, _type, 0, step.p, ACCESS_RW /* ignored */, usageFlags);
|
||||
CV_Assert(u != 0);
|
||||
}
|
||||
CV_CATCH_ALL
|
||||
{
|
||||
if(a != a0)
|
||||
u = a0->allocate(dims, size, _type, 0, step.p, 0, usageFlags);
|
||||
u = a0->allocate(dims, size, _type, 0, step.p, ACCESS_RW /* ignored */, usageFlags);
|
||||
CV_Assert(u != 0);
|
||||
}
|
||||
CV_Assert( step[dims-1] == (size_t)CV_ELEM_SIZE(flags) );
|
||||
@@ -813,7 +813,7 @@ UMat UMat::reshape(int _cn, int _newndims, const int* _newsz) const
|
||||
CV_Error(CV_StsNotImplemented, "Reshaping of n-dimensional non-continuous matrices is not supported yet");
|
||||
}
|
||||
|
||||
Mat UMat::getMat(int accessFlags) const
|
||||
Mat UMat::getMat(AccessFlag accessFlags) const
|
||||
{
|
||||
if(!u)
|
||||
return Mat();
|
||||
@@ -840,7 +840,7 @@ Mat UMat::getMat(int accessFlags) const
|
||||
}
|
||||
}
|
||||
|
||||
void* UMat::handle(int accessFlags) const
|
||||
void* UMat::handle(AccessFlag accessFlags) const
|
||||
{
|
||||
if( !u )
|
||||
return 0;
|
||||
@@ -852,7 +852,7 @@ void* UMat::handle(int accessFlags) const
|
||||
u->currAllocator->unmap(u);
|
||||
}
|
||||
|
||||
if ((accessFlags & ACCESS_WRITE) != 0)
|
||||
if (!!(accessFlags & ACCESS_WRITE))
|
||||
u->markHostCopyObsolete(true);
|
||||
|
||||
return u->handle;
|
||||
|
||||
Reference in New Issue
Block a user