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

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

Definition at line 89 of file FuncBorderOp.h.

References ArrayCH(), ArrayCPB(), ArrayCW(), Impala::Core::Array::Element::E1Cast(), and PtrWrite().

Referenced by PatSetBorder().

00090 {
00091     typedef typename ArrayT::StorType StorT;
00092     typedef typename ArrayT::ArithType ArithT;
00093 
00094     Int64 cw = ArrayCW(a);
00095     Int64 ch = ArrayCH(a);
00096     Int64 x, y;
00097     ArithT v = Element::E1Cast(value, ArithT());
00098 
00099     if (numX > 0)
00100     {
00101         // set left and right part
00102         for (y=0 ; y<ch ; y++)
00103         {
00104             StorT* dstPtr = ArrayCPB(a, -numX, y);
00105             for (x=0 ; x<numX ; x++)
00106             {
00107                 PtrWrite(dstPtr, v);
00108                 dstPtr += ArrayT::ElemSize();
00109             }
00110             dstPtr = ArrayCPB(a, cw, y);
00111             for (x=0 ; x<numX ; x++)
00112             {
00113                 PtrWrite(dstPtr, v);
00114                 dstPtr += ArrayT::ElemSize();
00115             }
00116         }
00117     }
00118 
00119     if (numY > 0)
00120     {
00121         // set top and bottom part including left and right "corners"
00122         Int64 totalWidth = cw + 2*numX;
00123         for (y=0 ; y<numY ; y++)
00124         {
00125             StorT* dstPtr = ArrayCPB(a, -numX, -numY + y);
00126             for (x=0 ; x<totalWidth ; x++)
00127             {
00128                 PtrWrite(dstPtr, v);
00129                 dstPtr += ArrayT::ElemSize();
00130             }
00131             dstPtr = ArrayCPB(a, -numX, ch + y);
00132             for (x=0 ; x<totalWidth ; x++)
00133             {
00134                 PtrWrite(dstPtr, v);
00135                 dstPtr += ArrayT::ElemSize();
00136             }
00137         }
00138     }
00139 }

Here is the call graph for this function:


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