template<class DstArrayT, class SrcArrayT, class KerArrayT, class MaskArrayT, class PixOpT, class RedOpT>
Definition at line 168 of file FuncGenConv2d.h. References ArrayCH(), ArrayCPB(), and ArrayCW(). 00170 { 00171 typedef typename DstArrayT::StorType DstStorT; 00172 typedef typename DstArrayT::ArithType DstArithT; 00173 typedef typename SrcArrayT::StorType SrcStorT; 00174 typedef typename SrcArrayT::ArithType SrcArithT; 00175 typedef typename KerArrayT::StorType KerStorT; 00176 typedef typename KerArrayT::ArithType KerArithT; 00177 typedef typename MaskArrayT::StorType MaskStorT; 00178 00179 int imgWidth = ArrayCW(dst); 00180 int imgHeight = ArrayCH(dst); 00181 int kerWidth = ArrayCW(ker); 00182 int kerHeight = ArrayCH(ker); 00183 int kerBW = ArrayCW(ker) / 2; 00184 int kerBH = ArrayCH(ker) / 2; 00185 00186 DstStorT* temp = new DstStorT[DstArrayT::ElemSize()]; 00187 00188 for (int y=0 ; y<imgHeight ; y++) 00189 { 00190 DstStorT* dPtr = ArrayCPB(dst, 0, y); 00191 MaskStorT* mPtr = mask->CPB(0, y); 00192 for (int x=0 ; x<imgWidth ; x++) 00193 { 00194 if (*mPtr) 00195 { 00196 RedOpT::NeutralElement(dPtr); 00197 for (int j=0 ; j<kerHeight ; j++) 00198 { 00199 SrcStorT* sPtr = ArrayCPB(src, -kerBW + x, -kerBH + y + j); 00200 KerStorT* kPtr = ArrayCPB(ker, 0, j); 00201 for (int i=0 ; i<kerWidth ; i++) 00202 { 00203 pixOp.DoIt(temp, sPtr, kPtr); 00204 redOp.DoIt(dPtr, temp); 00205 sPtr += SrcArrayT::ElemSize(); 00206 kPtr += KerArrayT::ElemSize(); 00207 } 00208 } 00209 } 00210 dPtr += DstArrayT::ElemSize(); 00211 mPtr += MaskArrayT::ElemSize(); 00212 } 00213 } 00214 00215 delete temp; 00216 }
Here is the call graph for this function:
|