Flip
Reverses the vector.
The function interface declaration is as follows:
- Operations on integers:
HmppResult HMPPS_Flip_8u(const uint8_t* src, uint8_t* dst, int32_t len);
HmppResult HMPPS_Flip_16u(const uint16_t* src, uint16_t* dst, int32_t len);
- Operations on floating-point numbers:
HmppResult HMPPS_Flip_32f(const float* src, float* dst, int32_t len);
HmppResult HMPPS_Flip_64f(const double* src, double* dst, int32_t len);
HmppResult HMPPS_Flip_32fc(const Hmpp32fc* src, Hmpp32fc* dst, int32_t len);
HmppResult HMPPS_Flip_64fc(const Hmpp64fc* src, Hmpp64fc* dst, int32_t len);
- In-place operations on integers:
HmppResult HMPPS_Flip_8u_I(uint8_t* srcDst, int32_t len);
HmppResult HMPPS_Flip_16u_I(uint16_t* srcDst, int32_t len);
- In-place operations on floating-point numbers:
HmppResult HMPPS_Flip_32f_I(float* srcDst, int32_t len);
HmppResult HMPPS_Flip_64f_I(double* srcDst, int32_t len);
HmppResult HMPPS_Flip_32fc_I(Hmpp32fc* srcDst, int32_t len);
HmppResult HMPPS_Flip_64fc_I(Hmpp64fc* srcDst, int32_t len);
Parameters
Parameter |
Description |
Value Range |
Input/Output |
|---|---|---|---|
src |
Pointer to the source vector |
The value cannot be NULL. |
Input |
dst |
Pointer to the destination vector |
The value cannot be NULL. |
Output |
srcDst |
Pointer to the source vector for in-place operations |
The value cannot be NULL. |
Input/Output |
len |
Vector length |
(0, INT_MAX] |
Input |
Return Value
- Success: HMPP_STS_NO_ERR
- Failure: An error code is returned.
Error Codes
Error Code |
Description |
|---|---|
HMPP_STS_NULL_PTR_ERR |
The value of dst, src, or srcDst is NULL. |
HMPP_STS_SIZE_ERR |
The value of len is less than or equal to 0. |
Example
#define BUFFER_SIZE_T 9
void FlipExample()
{
uint8_t src[BUFFER_SIZE_T] = {0, 1, 2, 3, 4, 5, 6, 7, 255};
uint8_t dst[BUFFER_SIZE_T] = {};
int32_t i;
HmppResult result = HMPPS_Flip_8u(src, dst, BUFFER_SIZE_T);
if (result == HMPP_STS_NO_ERR) {
for (i = 0; i < BUFFER_SIZE_T; i++) {
printf("%d ", dst[i]);
}
printf("\n");
}
}
Output:
dst = 255 7 6 5 4 3 2 1 0