Rate This Document
Findability
Accuracy
Completeness
Readability

Copy

Copies the source address data to the destination address.

The function interface declaration is as follows:

  • Operations on integers:

    HmppResult HMPPS_Copy_8u(const uint8_t* src, uint8_t* dst, int32_t len);

    HmppResult HMPPS_Copy_16s(const int16_t *src, int16_t *dst, int32_t len);

    HmppResult HMPPS_Copy_32s(const int32_t *src, int32_t *dst, int32_t len);

    HmppResult HMPPS_Copy_64s(const int64_t* src, int64_t* dst, int32_t len);

    HmppResult HMPPS_Copy_16sc(const Hmpp16sc* src, Hmpp16sc* dst, int32_t len);

    HmppResult HMPPS_Copy_32sc(const Hmpp32sc* src, Hmpp32sc* dst, int32_t len);

    HmppResult HMPPS_Copy_64sc(const Hmpp64sc* src, Hmpp64sc* dst, int32_t len);

  • Operations on floating-point numbers:

    HmppResult HMPPS_Copy_32f(const float *src, float *dst, int32_t len);

    HmppResult HMPPS_Copy_64f(const double *src, double *dst, int32_t len);

    HmppResult HMPPS_Copy_32fc(const Hmpp32fc *src, Hmpp32fc *dst, int32_t len);

    HmppResult HMPPS_Copy_64fc(const Hmpp64fc* src, Hmpp64fc* dst, 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

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 src or dst is NULL.

HMPP_STS_SIZE_ERR

The value of len is less than or equal to 0.

Example

#define BUFFER_SIZE_T 10

int main()
{
    float src[BUFFER_SIZE_T] = {1.64, 1.63, -1.09, 0.71, -3.20, -0.43, 0.41, -4.83, 5.36, -4.40};
    float dst[BUFFER_SIZE_T];
    int32_t i;

    HmppResult result = HMPPS_Copy_32f(src, dst, BUFFER_SIZE_T);
    printf("result = %d \ndst =", result);
    for (i = 0; i < BUFFER_SIZE_T; i++) {
        printf("%.2f    ", dst[i]);
    }

    return 0;
}

Output:

result = 0
dst = 1.64      1.63      -1.09      0.71      -3.20      -0.43      0.41      -4.83      5.36       -4.40