Main Page   Class Overview   Pixels   Images   Geometry   Quick Index  

HxMfMNpo Class Reference

Class definition of method frame for unary pixel operations. More...

#include <HxMfMNpo.h>

List of all members.

Public Methods

 HxMfMNpo (HxImageData **srcs, int srcCnt, HxString mpoName)
 Constructor. More...

 ~HxMfMNpo ()
 Destructor. More...

HxImageData ** results () const
 The result images of the frame. More...

HxImageDataresults (int n) const
int resultCnt () const
 The number of source images of the frame. More...

HxImageData ** sources () const
 The source images of the frame. More...

int sourceCnt () const
 The number of source images of the frame. More...

bool preOpIsOk () const
 Indicates whether initialization was OK. More...


Detailed Description

Class definition of method frame for unary pixel operations.


Constructor & Destructor Documentation

HxMfMNpo::HxMfMNpo HxImageData **    srcs,
int    srcCnt,
HxString    mpoName
 

Constructor.

00019     : _preOpIsOk(true)
00020 {
00021     if (srcCnt <= 0) {
00022         _preOpIsOk = false;
00023         return;
00024     }
00025     
00026     _srcCnt = srcCnt;
00027     _src = new HxImageData * [srcCnt];
00028     _tmp = new HxImageData * [srcCnt];
00029     
00030     int i;
00031     for (i = 0; i < srcCnt; i++) {
00032         if (!srcs[i]) {
00033             _preOpIsOk = false;
00034             return;
00035         }
00036         _src[i] = srcs[i];
00037         _tmp[i] = 0;
00038     }
00039 
00040     /* find broadest signature and minimum sizes */
00041     HxImageSignature broadestSig(srcs[0]->signature());
00042     HxSizes sizes = srcs[0]->sizes();
00043     for (i = 1; i < srcCnt; i++) {
00044         HxImageSignature srcnSig(srcs[i]->signature());
00045         broadestSig = broadestSig.broadest(srcnSig);
00046         sizes = sizes.sup(srcs[i]->sizes());
00047     }
00048 
00049     static HxRegKey* mpoKey
00050         = HxRegistry::instance().findKey("/imagefunctortable/mpo");
00051     HxRegKey* k = mpoKey ? mpoKey->findKey(mpoName) : 0;
00052     k = k ? k->findKey("resulttype") : 0;
00053     const HxRegValue* v = k ? k->findValue(broadestSig.toString()) : 0;
00054     HxImageSignature resultSig
00055         = v ? HxImageSignature::NameToSignature(v->getData().toString()) :
00056             broadestSig;
00057 
00058     for (i = 0; i < srcCnt; i++) {
00059         if (!broadestSig.isEqual(srcs[i]->signature())) {
00060             _tmp[i] = HxImgDataFactory::instance().makeImage(broadestSig, sizes);
00061             _tmp[i]->set(srcs[i]);
00062             _src[i] = _tmp[i];
00063         }
00064     }
00065 
00067     HxTagList tags;
00068     HxAddTag(tags, "sourceCnt", _srcCnt);
00069     if (!HxImageData::probeMNpo(resultSig, broadestSig, mpoName, tags)) {
00070         _preOpIsOk = false;
00071         return;
00072     }
00073     _resCnt = HxGetTag(tags, "resultCnt", 1);
00074 
00075     _result = new HxImageData * [_resCnt];
00076     for (i = 0; i < _resCnt; i++)
00077         _result[i] = HxImgDataFactory::instance().makeImage(resultSig, sizes);
00078 }

HxMfMNpo::~HxMfMNpo  
 

Destructor.

00081 {
00082     for (int i = 0; i < _srcCnt; i++) {
00083         if (_tmp[i])
00084             delete _tmp[i];
00085     }
00086     delete [] _result;
00087     delete [] _tmp;
00088     delete [] _src;
00089 }


Member Function Documentation

HxImageData ** HxMfMNpo::results   const
 

The result images of the frame.

00105 { 
00106     return _result; 
00107 }

int HxMfMNpo::resultCnt   const
 

The number of source images of the frame.

00111 { 
00112     return _resCnt; 
00113 }

HxImageData ** HxMfMNpo::sources   const
 

The source images of the frame.

00093 { 
00094     return _src; 
00095 }

int HxMfMNpo::sourceCnt   const
 

The number of source images of the frame.

00099 { 
00100     return _srcCnt; 
00101 }

bool HxMfMNpo::preOpIsOk   const [inline]
 

Indicates whether initialization was OK.

00057 {
00058     return _preOpIsOk;
00059 }


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