#include <HxImgFtorGenConv3d.h>
Inheritance diagram for HxImgFtorGenConv3d::
Public Types | |
typedef HxImgFtorGenConvKey | KeyType |
The key type of this class. More... | |
typedef SrcImgSigT::DataPtrType | SrcDataPtrType |
The data pointer type of the source image. More... | |
typedef KerImgSigT::DataPtrType | KerDataPtrType |
The data pointer type of the kernel image. More... | |
Public Methods | |
HxImgFtorGenConv3d () | |
Constructor. More... | |
virtual | ~HxImgFtorGenConv3d () |
Destructor. More... | |
Protected Methods | |
virtual void | doIt (DstDataPtrType dstPtr, SrcDataPtrType srcPtr, KerDataPtrType kerPtr, HxSizes dstSize, HxSizes srcSize, HxSizes kerSize, HxTagList &tags, HxImgFtorDescription *=0) |
The actual operation. More... |
|
The key type of this class.
Reimplemented from HxImgFtorI3Cast. |
|
The data pointer type of the source image.
|
|
The data pointer type of the kernel image.
|
|
Constructor.
00032 : HxImgFtorI3Cast<DstImgSigT, SrcImgSigT, KerImgSigT>( 00033 HxImgFtorGenConvKey(HxClassName<DstImgSigT>(), 00034 HxClassName<SrcImgSigT>(), HxClassName<KerImgSigT>(), 00035 HxClassName<PixOpT>(), HxClassName<RedOpT>(), 00036 HxClassName<KernelT>())) 00037 { 00038 #ifdef CD_TRACE 00039 HxEnvironment::instance()->outputStream() 00040 << "HxImgFtorGenConv3d::HxImgFtorGenConv3d()" << STD_ENDL; 00041 #endif 00042 } |
|
Destructor.
00048 { 00049 #ifdef CD_TRACE 00050 HxEnvironment::instance()->outputStream() 00051 << "HxImgFtorGenConv3d::~HxImgFtorGenConv3d()" << STD_ENDL; 00052 #endif 00053 } |
|
The actual operation.
00064 { 00065 int imgWidth = dstSize.x(); 00066 int imgHeight = dstSize.y(); 00067 int imgDepth = dstSize.z(); 00068 int kerWidth = kerSize.x(); 00069 int kerHeight = kerSize.y(); 00070 int kerDepth = kerSize.z(); 00071 int x, y, z, i, j, k; 00072 00073 PixOpT pixOp(tags); 00074 RedOpT redOp(tags); 00075 KernelT kernel(kerPtr, kerSize, tags); 00076 00077 typedef typename KerImgSigT::ArithType ArithType; 00078 ArithType result, tmpVal; 00079 00080 for (z=0; z<imgDepth; z++) { 00081 for (y=0 ; y<imgHeight ; y++) { 00082 DstDataPtrType dPtr = dstPtr; 00083 dPtr.incXYZ(0, y, z); 00084 for (x=0 ; x<imgWidth ; x++) { 00085 SrcDataPtrType sPtr = srcPtr; 00086 sPtr.incXYZ(x, y, z); 00087 result = RedOpT::neutralElement(); 00088 for (k=0; k<kerDepth; k++) { 00089 for (j=0 ; j<kerHeight ; j++) { 00090 for (i=0 ; i<kerWidth ; i++) { 00091 tmpVal = pixOp.doIt(sPtr.read(), kernel(i,j,k)); 00092 redOp.doIt(result, tmpVal); 00093 sPtr.incX(); 00094 } 00095 sPtr.decX(kerWidth); 00096 sPtr.incY(); 00097 } 00098 sPtr.decY(kerHeight); 00099 sPtr.incZ(); 00100 } 00101 dPtr.write(result); 00102 dPtr.incX(); 00103 } 00104 } 00105 } 00106 } |