1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2025-11-17 12:30:39 +03:00
64 changed files with 988 additions and 384 deletions
+29
View File
@@ -1406,8 +1406,13 @@ public:
When the operation mask is specified, if the Mat::create call shown above reallocates the matrix,
the newly allocated matrix is initialized with all zeros before copying the data.
If (re)allocation of destination memory is not necessary (e.g. updating ROI), use copyAt() .
@param m Destination matrix. If it does not have a proper size or type before the operation, it is
reallocated.
@sa copyAt
*/
void copyTo( OutputArray m ) const;
@@ -1420,6 +1425,30 @@ public:
*/
void copyTo( OutputArray m, InputArray mask ) const;
/** @brief Overwrites the existing matrix
This method writes existing matrix data, just like copyTo().
But if it does not have a proper size or type before the operation, an exception is thrown.
This function is helpful to update ROI in an existing matrix.
If (re)allocation of destination memory is necessary, use copyTo() .
@param m Destination matrix.
If it does not have a proper size or type before the operation, an exception is thrown.
@sa copyTo
*/
void copyAt( OutputArray m ) const;
/** @overload
@param m Destination matrix.
If it does not have a proper size or type before the operation, an exception is thrown.
@param mask Operation mask of the same size as \*this. Its non-zero elements indicate which matrix
elements need to be copied. The mask has to be of type CV_8U and can have 1 or multiple channels.
*/
void copyAt( OutputArray m, InputArray mask ) const;
/** @brief Converts an array to another data type with optional scaling.
The method converts source pixel values to the target data type. saturate_cast\<\> is applied at
@@ -257,8 +257,27 @@ VSX_IMPL_1VRG(vec_udword2, vec_udword2, vpopcntd, vec_popcntu)
VSX_IMPL_1VRG(vec_udword2, vec_dword2, vpopcntd, vec_popcntu)
// converts between single and double-precision
VSX_REDIRECT_1RG(vec_float4, vec_double2, vec_cvfo, vec_floate)
VSX_REDIRECT_1RG(vec_double2, vec_float4, vec_cvfo, vec_doubleo)
// vec_floate and vec_doubleo are available since Power10 and z14
#if defined(__POWER10__) || (defined(__powerpc64__) && defined(__ARCH_PWR10__)
// Use VSX double<->float conversion instructions (if supported by the architecture)
VSX_REDIRECT_1RG(vec_float4, vec_double2, vec_cvfo, vec_floate)
VSX_REDIRECT_1RG(vec_double2, vec_float4, vec_cvfo, vec_doubleo)
#else
// Fallback: implement vec_cvfo using scalar operations (to ensure successful linking)
static inline vec_float4 vec_cvfo(const vec_double2& a)
{
float r0 = static_cast<float>(reinterpret_cast<const double*>(&a)[0]);
float r1 = static_cast<float>(reinterpret_cast<const double*>(&a)[1]);
return (vec_float4){r0, 0.f, r1, 0.f};
}
static inline vec_double2 vec_cvfo(const vec_float4& a)
{
double r0 = static_cast<double>(reinterpret_cast<const float*>(&a)[0]);
double r1 = static_cast<double>(reinterpret_cast<const float*>(&a)[2]);
return (vec_double2){r0, r1};
}
#endif
// converts word and doubleword to double-precision
#undef vec_ctd