template<class DstArrayT, class SrcArrayT, class KerArrayT, class PixOpT, class RedOpT>
Definition at line 21 of file FuncGenConv2d.h. References ArrayCH(), ArrayCPB(), ArrayCW(), PtrRead(), and PtrWrite(). Referenced by FuncGenConv2dDispatch(). 00023 { 00024 typedef typename DstArrayT::StorType DstStorT; 00025 typedef typename DstArrayT::ArithType DstArithT; 00026 typedef typename SrcArrayT::StorType SrcStorT; 00027 typedef typename SrcArrayT::ArithType SrcArithT; 00028 typedef typename KerArrayT::StorType KerStorT; 00029 typedef typename KerArrayT::ArithType KerArithT; 00030 00031 int imgWidth = ArrayCW(dst); 00032 int imgHeight = ArrayCH(dst); 00033 int kerWidth = ArrayCW(ker); 00034 int kerHeight = ArrayCH(ker); 00035 int kerBW = ArrayCW(ker) / 2; 00036 int kerBH = ArrayCH(ker) / 2; 00037 KerArithT neutralElement(RedOpT::NeutralElement()); 00038 00039 for (int y=0 ; y<imgHeight ; y++) 00040 { 00041 DstStorT* dPtr = ArrayCPB(dst, 0, y); 00042 for (int x=0 ; x<imgWidth ; x++) 00043 { 00044 KerArithT result = neutralElement; 00045 for (int j=0 ; j<kerHeight ; j++) 00046 { 00047 SrcStorT* sPtr = ArrayCPB(src, -kerBW + x, -kerBH + y + j); 00048 KerStorT* kPtr = ArrayCPB(ker, 0, j); 00049 for (int i=0 ; i<kerWidth ; i++) 00050 { 00051 redOp.DoIt(result, pixOp.DoIt(PtrRead(sPtr, KerArithT()), 00052 PtrRead(kPtr, KerArithT()))); 00053 sPtr += SrcArrayT::ElemSize(); 00054 kPtr += KerArrayT::ElemSize(); 00055 } 00056 } 00057 PtrWrite(dPtr, result); 00058 dPtr += DstArrayT::ElemSize(); 00059 } 00060 } 00061 }
Here is the call graph for this function:
|