Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxMfMpo Class Reference

Class definition of method frame for multi 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...

HxImageDataresult () const
 The result image of the frame. More...


Detailed Description

Class definition of method frame for multi pixel operations.

First we determine the broadest signature and supremum of sizes of all source images. The sources images are prepared to match that signature and sizes.

A result image will be allocated with the same size as the source images. The type of the result image is obtained from the HxImgFtorRuleBase via

resulttype of mpo<broadest,mpoName>


Constructor & Destructor Documentation

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

Constructor.

00018 {
00019     if (!nSrcs)
00020         return;
00021     
00022     _nSrcs = nSrcs;
00023     _src = new HxImageData * [nSrcs];
00024     _tmp = new HxImageData * [nSrcs];
00025 
00026     int i;
00027     for (i = 0; i < nSrcs; i++) {
00028         if (!srcs[i])
00029             return;
00030         _src[i] = srcs[i];
00031         _tmp[i] = 0;
00032     }
00033 
00034     /* find broadest signature and supremum of sizes */
00035     HxImageSignature broadestSig(srcs[0]->signature());
00036     HxSizes sizes = srcs[0]->sizes();
00037     for (i = 1; i < nSrcs; i++) {
00038         HxImageSignature srcnSig(srcs[i]->signature());
00039         broadestSig = broadestSig.broadest(srcnSig);
00040         sizes = sizes.sup(srcs[i]->sizes());
00041     }
00042 
00043     HxImageSignature resultSig
00044         = HxImgFtorRuleBase::instance().getResultType(
00045             broadestSig, "mpo", broadestSig.toString(), mpoName);
00046 
00047     for (i = 0; i < nSrcs; i++) {
00048         if (!broadestSig.isEqual(srcs[i]->signature())) {
00049             _tmp[i] = HxImgDataFactory::instance().makeImage(broadestSig, sizes);
00050             _tmp[i]->set(srcs[i]);
00051             _src[i] = _tmp[i];
00052         }
00053     }
00054 
00055     _result = HxImgDataFactory::instance().makeImage(resultSig, sizes);
00056 }

HxMfMpo::~HxMfMpo  
 

Destructor.

00059 {
00060     for (int i = 0; i < _nSrcs; i++) {
00061         if (_tmp[i])
00062             delete _tmp[i];
00063     }
00064     delete [] _tmp;
00065     delete [] _src;
00066 }


Member Function Documentation

HxImageData ** HxMfMpo::sources   const
 

The source images of the frame.

00070 { 
00071     return _src; 
00072 }

int HxMfMpo::nSources   const
 

The number of source images of the frame.

00076 { 
00077     return _nSrcs; 
00078 }

HxImageData * HxMfMpo::result   const
 

The result image of the frame.

00082 { 
00083     return _result; 
00084 }


The documentation for this class was generated from the following files:
Generated on Tue Feb 3 14:19:06 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001