#include <HxMfMpo.h>
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... |
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.
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 } |
|
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 } |
|
The source images of the frame.
00070 { 00071 return _src; 00072 } |
|
The number of source images of the frame.
00076 { 00077 return _nSrcs; 00078 } |
|
The result image of the frame.
00082 { 00083 return _result; 00084 } |