Main Page   Class Overview   Pixels   Images   Geometry   Quick Index  

HxMfMpo Class Reference

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

#include <HxMfMpo.h>

List of all members.

Public Methods

 HxMfMpo (HxImageData **srcs, int nSrcs, HxString mpoName)
 Constructor. More...

 ~HxMfMpo ()
 Destructor. More...

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

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

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


Detailed Description

Class definition of method frame for unary pixel operations.


Constructor & Destructor Documentation

HxMfMpo::HxMfMpo (  HxImageData **    srcs,
int    nSrcs,
HxString    mpoName
) 
 

Constructor.

00019 {
00020     if (!nSrcs)
00021         return;
00022     
00023     _nSrcs = nSrcs;
00024     _src = new HxImageData * [nSrcs];
00025     _tmp = new HxImageData * [nSrcs];
00026 
00027     int i;
00028     for (i = 0; i < nSrcs; i++) {
00029         if (!srcs[i])
00030             return;
00031         _src[i] = srcs[i];
00032         _tmp[i] = 0;
00033     }
00034 
00035     /* find broadest signature and minimum sizes */
00036     HxImageSignature broadestSig(srcs[0]->signature());
00037     HxSizes sizes = srcs[0]->sizes();
00038     for (i = 1; i < nSrcs; i++) {
00039         HxImageSignature srcnSig(srcs[i]->signature());
00040         broadestSig = broadestSig.broadest(srcnSig);
00041         sizes = sizes.sup(srcs[i]->sizes());
00042     }
00043 
00044     static HxRegKey* mpoKey
00045         = HxRegistry::instance().findKey("/imagefunctortable/mpo");
00046     HxRegKey* k = mpoKey ? mpoKey->findKey(mpoName) : 0;
00047     k = k ? k->findKey("resulttype") : 0;
00048     const HxRegValue* v = k ? k->findValue(broadestSig.toString()) : 0;
00049     HxImageSignature resultSig
00050         = v ? HxImageSignature::NameToSignature(v->getData().toString()) :
00051             broadestSig;
00052 
00053     for (i = 0; i < nSrcs; i++) {
00054         if (!broadestSig.isEqual(srcs[i]->signature())) {
00055             _tmp[i] = HxImgDataFactory::instance().makeImage(broadestSig, sizes);
00056             _tmp[i]->set(srcs[i]);
00057             _src[i] = _tmp[i];
00058         }
00059     }
00060 
00061     _result = HxImgDataFactory::instance().makeImage(resultSig, sizes);
00062 }

HxMfMpo::~HxMfMpo (    ) 
 

Destructor.

00065 {
00066     for (int i = 0; i < _nSrcs; i++) {
00067         if (_tmp[i])
00068             delete _tmp[i];
00069     }
00070     delete [] _tmp;
00071     delete [] _src;
00072 }


Member Function Documentation

HxImageData ** HxMfMpo::sources (    )  const
 

The source images of the frame.

00076 { 
00077     return _src; 
00078 }

int HxMfMpo::nSources (    )  const
 

The number of source images of the frame.

00082 { 
00083     return _nSrcs; 
00084 }

HxImageData * HxMfMpo::result (    )  const
 

The result image of the frame.

00088 { 
00089     return _result; 
00090 }


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