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

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

Definition at line 19 of file FuncBorderOp.h.

References ArrayCH(), ArrayCPB(), and ArrayCW().

Referenced by Impala::Core::Feature::CalculateRegionDescriptors(), and PatSetBorder().

00020 {
00021     typedef typename ArrayT::StorType StorT;
00022 
00023     Int64 cw = ArrayCW(a);
00024     Int64 ch = ArrayCH(a);
00025     Int64 x, y;
00026 
00027     if (numY > 0)
00028     {
00029         // mirror top part
00030         for (y=0 ; y<numY ; y++)
00031         {
00032             StorT* srcPtr = ArrayCPB(a, 0, y);
00033             StorT* dstPtr = ArrayCPB(a, 0, -1 - y);
00034             Int64 nElem = cw * ArrayT::ElemSize();
00035             for (x=0 ; x<nElem ; x++)
00036             {
00037                 *dstPtr++ = *srcPtr++;
00038             }
00039         }
00040 
00041         // mirror bottom part
00042         for (y=0 ; y<numY ; y++)
00043         {
00044             StorT* srcPtr = ArrayCPB(a, 0, ch - 1 - y);
00045             StorT* dstPtr = ArrayCPB(a, 0, ch + y);
00046             Int64 nElem = cw * ArrayT::ElemSize();
00047             for (x=0 ; x<nElem ; x++)
00048             {
00049                 *dstPtr++ = *srcPtr++;
00050             }
00051         }
00052     }
00053 
00054     if (numX > 0)
00055     {
00056         // mirror left part including upper and lower "corner"
00057         Int64 totalHeight = ch + 2*numY;
00058         for (y=0 ; y<totalHeight ; y++)
00059         {
00060             StorT* srcPtr = ArrayCPB(a, 0, -numY + y);
00061             StorT* dstPtr = ArrayCPB(a, -1, -numY + y);
00062             for (x=0 ; x<numX ; x++)
00063             {
00064                 for (Int64 e=0 ; e<ArrayT::ElemSize() ; e++)
00065                     dstPtr[e] = srcPtr[e];
00066                 dstPtr -= ArrayT::ElemSize();
00067                 srcPtr += ArrayT::ElemSize();
00068             }
00069         }
00070 
00071         // mirror right part including upper and lower "corner"
00072         for (y=0 ; y<totalHeight ; y++)
00073         {
00074             StorT* srcPtr = ArrayCPB(a, cw - 1, -numY + y);
00075             StorT* dstPtr = ArrayCPB(a, cw, -numY + y);
00076             for (x=0 ; x<numX ; x++)
00077             {
00078                 for (Int64 e=0 ; e<ArrayT::ElemSize() ; e++)
00079                     dstPtr[e] = srcPtr[e];
00080                 dstPtr += ArrayT::ElemSize();
00081                 srcPtr -= ArrayT::ElemSize();
00082             }
00083         }
00084     }
00085 }

Here is the call graph for this function:


Generated on Fri Mar 19 11:00:56 2010 for ImpalaSrc by  doxygen 1.5.1