#include <HxMfGenConv.h>
Public Methods | |
HxMfGenConv (HxImageData *source, HxImageData *kernel, HxImageRep::ResultPrecision resPrec, bool is1dConv=false, HxImageRep::ResultPrecision interPrec=HxImageRep::DEFAULT_PREC) | |
Constructor. More... | |
HxMfGenConv (HxImageData *source, HxImageData *kernel, HxImageData *kernel2, HxImageRep::ResultPrecision resPrec, bool is1dConv=false, HxImageRep::ResultPrecision interPrec=HxImageRep::DEFAULT_PREC) | |
Constructor. More... | |
~HxMfGenConv () | |
Destructor. More... | |
HxImageData * | source () const |
The source image of the frame. More... | |
HxImageData * | kernel () const |
The kernel image of the frame. More... | |
HxImageData * | kernel2 () const |
The second kernel image of the frame. More... | |
HxImageData * | object () const |
The image to perform the convolution on. More... | |
HxImageData * | result () const |
The result image of the frame. More... | |
void | setObjectAsSource () |
Use the object as source. More... | |
bool | preOpIsOk () const |
Indicates whether initialization was OK. More... |
The method frame tries to satisfy the general rules set out for generalized convolutions. If this is not possible, preOpOk() will return false.
|
Constructor. The kernel should have the same dimensionality as the image, otherwise preOpOk() will return false. If necessary the type of the kernel will be converted according to the following rules: 1) The kernel type signature must be equal or broader than the source type signature. 2a) If the kernel has an integral pixel type its pixel precision will be that of int. 2b) If the kernel has a real pixel type its pixel precision will be that of double. The type of the result image will be set according to the specified precision: SOURCE\_PREC The result type is the same as the source type. ARITH\_PREC The result type is the same as the type of the kernel after the kernel has been converted. SMALL\_PREC The result type will be the same as above but with a smaller pixel precision. If the kernel has an integral pixel type the result pixel precision is that of short. If the kernel has a real pixel type the result pixel precision is that of float. If the intermediate precision is set to ARITH\_PREC a temporary object image with the same type as the kernel image will be allocated. Whenever the method frame is queried for the reslt image the object image will be copied to the result image. Note that the actual convolution will be performed in the precision of the kernel type after conversion.
00022 : _preOpIsOk(true), _resultIsCopied(false), _source(source), 00023 _kernel(kernel), _tmpKernel(0), _kernel2(0), _tmpKernel2(0) 00024 { 00025 initMethodFrame(resPrec, interPrec, is1dConv); 00026 } |
|
Constructor.
00032 : _preOpIsOk(true), _resultIsCopied(false), _source(source), 00033 _kernel(kernel), _tmpKernel(0), _kernel2(kernel2), _tmpKernel2(0) 00034 { 00035 initMethodFrame(resPrec, interPrec, is1dConv); 00036 } |
|
Destructor.
00039 { 00040 if (_tmpKernel) 00041 delete _tmpKernel; 00042 if (_tmpKernel2) 00043 delete _tmpKernel2; 00044 if (_object != _result) 00045 delete _object; 00046 } |
|
The source image of the frame.
00050 { 00051 return _source; 00052 } |
|
The kernel image of the frame.
00063 { 00064 return _kernel; 00065 } |
|
The second kernel image of the frame.
00069 { 00070 return _kernel2; 00071 } |
|
The image to perform the convolution on.
00056 { 00057 ((HxMfGenConv*)this)->_resultIsCopied = false; 00058 return _object; 00059 } |
|
The result image of the frame.
00075 { 00076 if ((_result != _object) && !_resultIsCopied) 00077 { 00078 _result->set(_object); 00079 ((HxMfGenConv*)this)->_resultIsCopied = true; 00080 } 00081 return _result; 00082 } |
|
Use the object as source.
00086 { 00087 _source = _object; 00088 } |
|
Indicates whether initialization was OK.
00126 { 00127 return _preOpIsOk; 00128 } |