Copy

Performs copy operation.

Syntax

Case 1: Vector array operation

IppStatus ippmCopy_va_32f_SS(const Ipp32f* pSrc, int srcStride0, int srcStride2, Ipp32f* pDst, int dstStride0, int dstStride2, int len, int count);

IppStatus ippmCopy_va_64f_SS(const Ipp64f* pSrc, int srcStride0, int srcStride2, Ipp64f* pDst, int dstStride0, int dstStride2, int len, int count);

IppStatus ippmCopy_va_32f_SP(const Ipp32f* pSrc, int srcStride0, int srcStride2, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int len, int count);

IppStatus ippmCopy_va_64f_SP(const Ipp64f* pSrc, int srcStride0, int srcStride2, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int len, int count);

IppStatus ippmCopy_va_32f_SL(const Ipp32f* pSrc, int srcStride0, int srcStride2, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int len, int count);

IppStatus ippmCopy_va_64f_SL(const Ipp64f* pSrc, int srcStride0, int srcStride2, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int len, int count);

IppStatus ippmCopy_va_32f_LS(const Ipp32f** ppSrc, int srcRoiShift, int srcStride2, Ipp32f* pDst, int dstStride0, int dstStride2, int len, int count);

IppStatus ippmCopy_va_64f_LS(const Ipp64f** ppSrc, int srcRoiShift, int srcStride2, Ipp64f* pDst, int dstStride0, int dstStride2, int len, int count);

IppStatus ippmCopy_va_32f_PS(const Ipp32f** ppSrc, int srcRoiShift, int srcStride0, Ipp32f* pDst, int dstStride0, int dstStride2, int len, int count);

IppStatus ippmCopy_va_64f_PS(const Ipp64f** ppSrc, int srcRoiShift, int srcStride0, Ipp64f* pDst, int dstStride0, int dstStride2, int len, int count);

IppStatus ippmCopy_va_32f_LP(const Ipp32f** ppSrc, int srcRoiShift, int srcStride2, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int len, int count);

IppStatus ippmCopy_va_64f_LP(const Ipp64f** ppSrc, int srcRoiShift, int srcStride2, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int len, int count);

IppStatus ippmCopy_va_32f_LL(const Ipp32f** ppSrc, int srcRoiShift, int srcStride2, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int len, int count);

IppStatus ippmCopy_va_64f_LL(const Ipp64f** ppSrc, int srcRoiShift, int srcStride2, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int len, int count);

IppStatus ippmCopy_va_32f_PP(const Ipp32f** ppSrc, int srcRoiShift, int srcStride0, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int len, int count);

IppStatus ippmCopy_va_64f_PP(const Ipp64f** ppSrc, int srcRoiShift, int srcStride0, Ipp64f** pDst, int dstRoiShift, int dstStride0, int len, int count);

IppStatus ippmCopy_va_32f_PL(const Ipp32f** ppSrc, int srcRoiShift, int srcStride0, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int len, int count);

IppStatus ippmCopy_va_64f_PL(const Ipp64f** ppSrc, int srcRoiShift, int srcStride0, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int len, int count);

Case 2: Matrix array operation

IppStatus ippmCopy_ma_32f_SS(const Ipp32f* pSrc, int srcStride0, int srcStride1, int srcStride2, Ipp32f* pDst, int dstStride0, int dstStride1, int dstStride2, int width, int height, int count);

IppStatus ippmCopy_ma_64f_SS(const Ipp64f* pSrc, int srcStride0, int srcStride1, int srcStride2, Ipp64f* pDst, int dstStride0, int dstStride1, int dstStride2, int width, int height, int count);

IppStatus ippmCopy_ma_32f_SP(const Ipp32f* pSrc, int srcStride0, int srcStride1, int srcStride2, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int width, int height, int count);

IppStatus ippmCopy_ma_64f_SP(const Ipp64f* pSrc, int srcStride0, int srcStride1, int srcStride2, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int width, int height, int count);

IppStatus ippmCopy_ma_32f_SL(const Ipp32f* pSrc, int srcStride0, int srcStride1, int srcStride2, Ipp32f** ppDst, int dstRoiShift, int dstStride1, int dstStride2, int width, int height, int count);

IppStatus ippmCopy_ma_64f_SL(const Ipp64f* pSrc, int srcStride0, int srcStride1, int srcStride2, Ipp64f** ppDst, int dstRoiShift, int dstStride1, int dstStride2, int width, int height, int count);

IppStatus ippmCopy_ma_32f_LS(const Ipp32f** ppSrc, int srcRoiShift, int srcStride1, int srcStride2, Ipp32f* pDst, int dstStride0, int dstStride1, int dstStride2, int width, int height, int count);

IppStatus ippmCopy_ma_64f_LS(const Ipp64f** ppSrc, int srcRoiShift, int srcStride1, int srcStride2, Ipp64f* pDst, int dstStride0, int dstStride1, int dstStride2, int width, int height, int count);

IppStatus ippmCopy_ma_32f_PS(const Ipp32f** ppSrc, int srcRoiShift, int srcStride0, Ipp32f* pDst, int dstStride0, int dstStride1, int dstStride2, int width, int height, int count);

IppStatus ippmCopy_ma_64f_PS(const Ipp64f** ppSrc, int srcRoiShift, int srcStride0, Ipp64f* pDst, int dstStride0, int dstStride1, int dstStride2, int width, int height, int count);

IppStatus ippmCopy_ma_32f_LP(const Ipp32f** ppSrc, int srcRoiShift, int srcStride1, int srcStride2, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int width, int height, int count);

IppStatus ippmCopy_ma_64f_LP(const Ipp64f** ppSrc, int srcRoiShift, int srcStride1, int srcStride2, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int width, int height, int count);

IppStatus ippmCopy_ma_32f_LL(const Ipp32f** ppSrc, int srcRoiShift, int srcStride1, int srcStride2, Ipp32f** ppDst, int dstRoiShift, int dstStride1, int dstStride2, int width, int height, int count);

IppStatus ippmCopy_ma_64f_LL(const Ipp64f** ppSrc, int srcRoiShift, int srcStride1, int srcStride2, Ipp64f** ppDst, int dstRoiShift, int dstStride1, int dstStride2, int width, int height, int count);

IppStatus ippmCopy_ma_32f_PP(const Ipp32f** ppSrc, int srcRoiShift, int srcStride0, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int width, int height, int count);

IppStatus ippmCopy_ma_64f_PP(const Ipp64f** ppSrc, int srcRoiShift, int srcStride0, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int width, int height, int count);

IppStatus ippmCopy_ma_32f_PL(const Ipp32f** ppSrc, int srcRoiShift, int srcStride0, Ipp32f** ppDst, int dstRoiShift, int dstStride1, int dstStride2, int width, int height, int count);

IppStatus ippmCopy_ma_64f_PL(const Ipp64f** ppSrc, int srcRoiShift, int srcStride0, Ipp64f** ppDst, int dstRoiShift, int dstStride1, int dstStride2, int width, int height, int count);

Parameters

pSrc, ppSrc

Pointer to the source object or array of objects.

srcStride0

Stride between the objects in the source array.

srcStride1

Stride between the rows in the source matrix(ces).

srcStride2

Stride between the elements in the source object.

srcRoiShift

ROI shift in the source object.

pDst, ppDst

Pointer to the destination object or array of objects.

dstStride0

Stride between the objects in the destination array.

dstStride1

Stride between the rows in the destination matrix.

dstStride2

Stride between the elements in the destination object.

dstRoiShift

ROI shift in the destination object.

width

Matrix width.

height

Matrix height.

len

Vector length.

count

Number of objects in the array.

Description

The function ippmCopy is declared in the ippm.h header file. The function copies an object of any type to another object of any type and stores the result in the destination object.

If performed on matrices, all matrices involved in the operation must have the number of columns not less than width and the number of rows not less than height.

The following example demonstrates how to use the function ippmCopy_va_32f_PS. For more information, see also examples in Getting Started.

ippmCopy_va_32f_PS  

IppStatus copy_va_32f_PS(void) {
    /* Source data:  */
    Ipp32f a[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
 
    /* 
    // Pointer description for source data of interest a[0], a[6], a[7]:
    */
    Ipp32f* ppSrc[3] = { a, a+6, a+7 }; /* pointers array */
    int srcRoiShift = 0; 
    int srcStride0  = sizeof(Ipp32f); /* formally must be initialized */   
    
    /*
    // Standard description for destination vector
    */
    Ipp32f pDst[3];
    int dstStride2 = sizeof(Ipp32f);
    int dstStride0 = sizeof(Ipp32f)*3;  /* formally must be initialized */
    
    int length = 3;
    int count  = 1;
 
 
    IppStatus status = ippmCopy_va_32f_PS((const Ipp32f**)ppSrc, 
        srcRoiShift, srcStride0, pDst, dstStride0, 
        dstStride2, length, count );
 
    /*
    // It is recommended to check return status 
    // to detect wrong input parameters, if any  
    */
    if (status == ippStsNoErr) {
        printf_va_Ipp32f("Destination vector:", pDst, 3, 1, status);
    } else {
        printf("Function returns status: %s \n", ippGetStatusString(status));
    } 
    return status;
}
 

The program above produces the following output:

Destination vector:

0.000000  6.000000  7.000000

The following example demonstrates how to use the function ippmCopy_ma_32f_LS. For more information, see also examples in Getting Started.

ippmCopy_ma_32f_LS  

IppStatus copy_ma_32f_LS(void) {
    /* Source data: 4 matrices with width=3 and height=2 */
    Ipp32f a[2*3] = { 10, 11, 12, 13, 14, 15 };
    Ipp32f b[2*3] = { 20, 21, 22, 23, 24, 25 };
    Ipp32f c[2*3] = { 30, 31, 32, 33, 34, 35 };
    Ipp32f d[2*3] = { 40, 41, 42, 43, 44, 45 };
    /*
    // Layout description for 4 source matrices:
    */
    Ipp32f* ppSrc[4] = { a, b, c, d }; /* matrix pointers array */
    int srcRoiShift = 0;
    int srcStride2 = sizeof(Ipp32f);
    int srcStride1 = sizeof(Ipp32f)*3;
    /*
    // Standard description for 4 destination matrices 
    */

    Ipp32f pDst[4*2*3];
    int dstStride2 = sizeof(Ipp32f);
    int dstStride1 = sizeof(Ipp32f)*3;
    int dstStride0 = sizeof(Ipp32f)*3*2;
    int width  = 3;
    int height = 2;
    int count  = 4;
    IppStatus status = ippmCopy_ma_32f_LS((const Ipp32f**)ppSrc,
        srcRoiShift, srcStride1, srcStride2, pDst, dstStride0,
        dstStride1, dstStride2, width, height, count );
    /*
    // It is recommended to check return status 
    // to detect wrong input parameters, if any  
    */
    if (status == ippStsNoErr) {
        printf_va_Ipp32f("4 destination matrices:", pDst, 2*3, 4, status);
    } else {
        printf("Function returns status: %s \n", ippGetStatusString(status));
    } 
  return status;
}

The program above produces the following output:

4 destination matrices:

10.000000  11.000000  12.000000  13.000000  14.000000  15.000000

20.000000  21.000000  22.000000  23.000000  24.000000  25.000000

30.000000  31.000000  32.000000  33.000000  34.000000  35.000000

40.000000  41.000000  42.000000  43.000000  44.000000  45.000000

Return Values

ippStsOk

Returns no error.

ippStsNullPtrErr

Returns an error when at least one input pointer is NULL.

ippStsSizeErr

Returns an error when the input size parameter is equal to 0.

ippStsStrideMatrixErr

Returns an error when the stride value is not positive or not divisible by size of data type.

ippStsRoiShiftMatrixErr

Returns an error when the roiShift value is negative or not divisible by size of data type.

ippStsCountMatrixErr

Returns an error when the count value is less or equal to zero.

Submit feedback on this help topic

Copyright © 2000 - 2010, Intel Corporation. All rights reserved.