@@ -2508,10 +2508,10 @@ class Convolution : public RefWrapper<vx_convolution>
2508
2508
{
2509
2509
if (!areTypesCompatible (TypeToEnum<T>::value, dataType ()))
2510
2510
throw WrapperError (std::string (__func__) + " (): destination type is wrong" );
2511
- if (data.size () != size ())
2511
+ if (data.size ()* sizeof (T) != size ())
2512
2512
{
2513
2513
if (data.size () == 0 )
2514
- data.resize (size ());
2514
+ data.resize (size ()/ sizeof (T) );
2515
2515
else
2516
2516
throw WrapperError (std::string (__func__) + " (): destination size is wrong" );
2517
2517
}
@@ -2522,7 +2522,7 @@ class Convolution : public RefWrapper<vx_convolution>
2522
2522
{
2523
2523
if (!areTypesCompatible (TypeToEnum<T>::value, dataType ()))
2524
2524
throw WrapperError (std::string (__func__) + " (): source type is wrong" );
2525
- if (data.size () != size ()) throw WrapperError (std::string (__func__) + " (): source size is wrong" );
2525
+ if (data.size ()* sizeof (T) != size ()) throw WrapperError (std::string (__func__) + " (): source size is wrong" );
2526
2526
copyFrom (&data[0 ]);
2527
2527
}
2528
2528
@@ -2670,10 +2670,10 @@ class Matrix : public RefWrapper<vx_matrix>
2670
2670
{
2671
2671
if (!areTypesCompatible (TypeToEnum<T>::value, dataType ()))
2672
2672
throw WrapperError (std::string (__func__) + " (): destination type is wrong" );
2673
- if (data.size () != size ())
2673
+ if (data.size ()* sizeof (T) != size ())
2674
2674
{
2675
2675
if (data.size () == 0 )
2676
- data.resize (size ());
2676
+ data.resize (size ()/ sizeof (T) );
2677
2677
else
2678
2678
throw WrapperError (std::string (__func__) + " (): destination size is wrong" );
2679
2679
}
@@ -2684,7 +2684,7 @@ class Matrix : public RefWrapper<vx_matrix>
2684
2684
{
2685
2685
if (!areTypesCompatible (TypeToEnum<T>::value, dataType ()))
2686
2686
throw WrapperError (std::string (__func__) + " (): source type is wrong" );
2687
- if (data.size () != size ()) throw WrapperError (std::string (__func__) + " (): source size is wrong" );
2687
+ if (data.size ()* sizeof (T) != size ()) throw WrapperError (std::string (__func__) + " (): source size is wrong" );
2688
2688
copyFrom (&data[0 ]);
2689
2689
}
2690
2690
0 commit comments