Main Page   Class Overview   Pixels   Images   Geometry   Quick Index  

HxMfGenConv Class Reference

Class definition of method frame for generalized convolution operations. More...

#include <HxMfGenConv.h>

List of all members.

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...

HxImageDatasource () const
 The source image of the frame. More...

HxImageDatakernel () const
 The kernel image of the frame. More...

HxImageDatakernel2 () const
 The second kernel image of the frame. More...

HxImageDataobject () const
 The image to perform the convolution on. More...

HxImageDataresult () 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...


Detailed Description

Class definition of method frame for generalized convolution operations.

The method frame tries to satisfy the general rules set out for generalized convolutions. If this is not possible, preOpOk() will return false.


Constructor & Destructor Documentation

HxMfGenConv::HxMfGenConv HxImageData   source,
HxImageData   kernel,
HxImageRep::ResultPrecision    resPrec,
bool    is1dConv = false,
HxImageRep::ResultPrecision    interPrec = HxImageRep::DEFAULT_PREC
 

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 }

HxMfGenConv::HxMfGenConv HxImageData   source,
HxImageData   kernel,
HxImageData   kernel2,
HxImageRep::ResultPrecision    resPrec,
bool    is1dConv = false,
HxImageRep::ResultPrecision    interPrec = HxImageRep::DEFAULT_PREC
 

Constructor.

00032     :   _preOpIsOk(true), _resultIsCopied(false), _source(source), 
00033         _kernel(kernel), _tmpKernel(0), _kernel2(kernel2), _tmpKernel2(0)
00034 {
00035     initMethodFrame(resPrec, interPrec, is1dConv);
00036 }

HxMfGenConv::~HxMfGenConv  
 

Destructor.

00039 {
00040     if (_tmpKernel) 
00041         delete _tmpKernel;
00042     if (_tmpKernel2) 
00043         delete _tmpKernel2;
00044     if (_object != _result)
00045         delete _object;
00046 }


Member Function Documentation

HxImageData * HxMfGenConv::source   const
 

The source image of the frame.

00050 { 
00051     return _source; 
00052 }

HxImageData * HxMfGenConv::kernel   const
 

The kernel image of the frame.

00063 { 
00064     return _kernel; 
00065 }

HxImageData * HxMfGenConv::kernel2   const
 

The second kernel image of the frame.

00069 { 
00070     return _kernel2; 
00071 }

HxImageData * HxMfGenConv::object   const
 

The image to perform the convolution on.

00056 {
00057     ((HxMfGenConv*)this)->_resultIsCopied = false;
00058     return _object; 
00059 }

HxImageData * HxMfGenConv::result   const
 

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 }

void HxMfGenConv::setObjectAsSource  
 

Use the object as source.

00086 {
00087     _source = _object;
00088 }

bool HxMfGenConv::preOpIsOk   const [inline]
 

Indicates whether initialization was OK.

00126 {
00127     return _preOpIsOk;
00128 }


The documentation for this class was generated from the following files:
Generated on Tue Jan 8 13:59:33 2002 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001