mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
core: added MatSize::dims() method
to avoid accessing of 'p[-1]' (static code analysers dislike this)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
// Third party copyrights are property of their respective owners.
|
||||
|
||||
#include "precomp.hpp"
|
||||
#include <opencv2/dnn/shape_utils.hpp>
|
||||
#include "op_halide.hpp"
|
||||
|
||||
#ifdef HAVE_HALIDE
|
||||
@@ -36,7 +37,7 @@ static MatShape getBufferShape(const MatShape& shape)
|
||||
|
||||
static MatShape getBufferShape(const MatSize& size)
|
||||
{
|
||||
return getBufferShape(MatShape(size.p, size.p + size[-1]));
|
||||
return getBufferShape(shape(size));
|
||||
}
|
||||
|
||||
Halide::Buffer<float> wrapToHalideBuffer(const Mat& mat)
|
||||
@@ -160,7 +161,7 @@ void HalideBackendWrapper::setHostDirty()
|
||||
|
||||
void getCanonicalSize(const MatSize& size, int* w, int* h, int* c, int* n)
|
||||
{
|
||||
getCanonicalSize(MatShape(size.p, size.p + size[-1]), w, h, c, n);
|
||||
getCanonicalSize(shape(size), w, h, c, n);
|
||||
}
|
||||
|
||||
void getCanonicalSize(const MatShape& shape, int* width, int* height,
|
||||
|
||||
Reference in New Issue
Block a user