mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 14:13:15 +08:00
Fixed size estimation for copyFrom/To vector in vx_matrix and vx_convolution wrappers
This commit is contained in:
parent
fd93ae08b6
commit
d873fe66ab
12
3rdparty/openvx/include/ivx.hpp
vendored
12
3rdparty/openvx/include/ivx.hpp
vendored
@ -2508,10 +2508,10 @@ public:
|
||||
{
|
||||
if (!areTypesCompatible(TypeToEnum<T>::value, dataType()))
|
||||
throw WrapperError(std::string(__func__) + "(): destination type is wrong");
|
||||
if (data.size() != size())
|
||||
if (data.size()*sizeof(T) != size())
|
||||
{
|
||||
if (data.size() == 0)
|
||||
data.resize(size());
|
||||
data.resize(size()/sizeof(T));
|
||||
else
|
||||
throw WrapperError(std::string(__func__) + "(): destination size is wrong");
|
||||
}
|
||||
@ -2522,7 +2522,7 @@ public:
|
||||
{
|
||||
if (!areTypesCompatible(TypeToEnum<T>::value, dataType()))
|
||||
throw WrapperError(std::string(__func__) + "(): source type is wrong");
|
||||
if (data.size() != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong");
|
||||
if (data.size()*sizeof(T) != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong");
|
||||
copyFrom(&data[0]);
|
||||
}
|
||||
|
||||
@ -2670,10 +2670,10 @@ public:
|
||||
{
|
||||
if (!areTypesCompatible(TypeToEnum<T>::value, dataType()))
|
||||
throw WrapperError(std::string(__func__) + "(): destination type is wrong");
|
||||
if (data.size() != size())
|
||||
if (data.size()*sizeof(T) != size())
|
||||
{
|
||||
if (data.size() == 0)
|
||||
data.resize(size());
|
||||
data.resize(size()/sizeof(T));
|
||||
else
|
||||
throw WrapperError(std::string(__func__) + "(): destination size is wrong");
|
||||
}
|
||||
@ -2684,7 +2684,7 @@ public:
|
||||
{
|
||||
if (!areTypesCompatible(TypeToEnum<T>::value, dataType()))
|
||||
throw WrapperError(std::string(__func__) + "(): source type is wrong");
|
||||
if (data.size() != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong");
|
||||
if (data.size()*sizeof(T) != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong");
|
||||
copyFrom(&data[0]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user