Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

template<class ArrayT>
void Impala::Core::Array::Pattern::PxFuncBorderMirror2d ( ArrayT *  a,
int  numX,
int  numY 
)

Definition at line 24 of file PxFuncBorderOp.h.

References ArrayCH(), ArrayCPB(), ArrayCW(), PxBorderExchange(), PxIsBottomCPU(), PxIsLeftCPU(), PxIsRightCPU(), PxIsTopCPU(), PxMyCPU(), XZ_PLANE, and YZ_PLANE.

Referenced by PatSetBorder().

00025 {
00026     typedef typename ArrayT::StorType StorT;
00027 
00028     int cw = ArrayCW(a);
00029     int ch = ArrayCH(a);
00030     int x, y;
00031 
00032     if (numX > 0) {
00033 
00034         PxBorderExchange(a, YZ_PLANE, numX);
00035 
00036         // mirror left part NOT including upper and lower "corners"
00037 
00038         if (PxIsLeftCPU(PxMyCPU())) {
00039             for (y=0; y<ch; y++) {
00040                 StorT* srcPtr = ArrayCPB(a,  0, y);
00041                 StorT* dstPtr = ArrayCPB(a, -1, y);
00042                 for (x=0; x<numX; x++) {
00043                     for (int e=0; e<ArrayT::ElemSize(); e++) {
00044                         dstPtr[e] = srcPtr[e];
00045                     }
00046                     dstPtr -= ArrayT::ElemSize();
00047                     srcPtr += ArrayT::ElemSize();
00048                 }
00049             }
00050         }
00051 
00052         // mirror right part NOT including upper and lower "corners"
00053 
00054         if (PxIsRightCPU(PxMyCPU())) {
00055             for (y=0; y<ch; y++) {
00056                 StorT* srcPtr = ArrayCPB(a, cw - 1, y);
00057                 StorT* dstPtr = ArrayCPB(a, cw, y);
00058                 for (x=0 ; x<numX ; x++) {
00059                     for (int e=0; e<ArrayT::ElemSize(); e++) {
00060                         dstPtr[e] = srcPtr[e];
00061                     }
00062                     dstPtr += ArrayT::ElemSize();
00063                     srcPtr -= ArrayT::ElemSize();
00064                 }
00065             }
00066         }
00067     }
00068 
00069     if (numY > 0) {
00070 
00071         PxBorderExchange(a, XZ_PLANE, numY);
00072 
00073         // mirror top part including left and right "corners"
00074 
00075         if (PxIsTopCPU(PxMyCPU())) {
00076             for (y=0; y<numY; y++) {
00077                 StorT* srcPtr = ArrayCPB(a, -numX, y);
00078                 StorT* dstPtr = ArrayCPB(a, -numX, -1 - y);
00079                 int nElem = (cw + 2*numX) * ArrayT::ElemSize();
00080                 for (x=0; x<nElem; x++) {
00081                     *dstPtr++ = *srcPtr++;
00082                 }
00083             }
00084         }
00085 
00086         // mirror bottom part including left and right "corners"
00087 
00088         if (PxIsBottomCPU(PxMyCPU())) {
00089             for (y=0; y<numY; y++) {
00090                 StorT* srcPtr = ArrayCPB(a, -numX, ch - 1 - y);
00091                 StorT* dstPtr = ArrayCPB(a, -numX, ch + y);
00092                 int nElem = (cw + 2 * numX) * ArrayT::ElemSize();
00093                 for (x=0; x<nElem; x++) {
00094                     *dstPtr++ = *srcPtr++;
00095                 }
00096             }
00097         }
00098     }
00099 }

Here is the call graph for this function:


Generated on Fri Mar 19 11:02:50 2010 for ImpalaSrc by  doxygen 1.5.1