#include <HxMfMNpo.h>
Public Methods | |
HxMfMNpo (HxImageData **srcs, int srcCnt, HxString mnpoName) | |
Constructor. More... | |
~HxMfMNpo () | |
Destructor. More... | |
HxImageData ** | results () const |
The result images of the frame. More... | |
HxImageData * | results (int n) const |
The n-th result image of the frame. More... | |
int | resultCnt () const |
The number of result 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... |
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.
The number of result images is determined by calling HxImageData::probeMNpo. Result images will be allocated with the same size as the source images. The type of the result images is obtained from the HxImgFtorRuleBase via
resulttype of mnpo<broadest,mnpoName>
|
Constructor.
00018 : _preOpIsOk(true) 00019 { 00020 if (srcCnt <= 0) { 00021 _preOpIsOk = false; 00022 return; 00023 } 00024 00025 _srcCnt = srcCnt; 00026 _src = new HxImageData * [srcCnt]; 00027 _tmp = new HxImageData * [srcCnt]; 00028 00029 int i; 00030 for (i = 0; i < srcCnt; i++) { 00031 if (!srcs[i]) { 00032 _preOpIsOk = false; 00033 return; 00034 } 00035 _src[i] = srcs[i]; 00036 _tmp[i] = 0; 00037 } 00038 00039 /* find broadest signature and supremum of sizes */ 00040 HxImageSignature broadestSig(srcs[0]->signature()); 00041 HxSizes sizes = srcs[0]->sizes(); 00042 for (i = 1; i < srcCnt; i++) { 00043 HxImageSignature srcnSig(srcs[i]->signature()); 00044 broadestSig = broadestSig.broadest(srcnSig); 00045 sizes = sizes.sup(srcs[i]->sizes()); 00046 } 00047 00048 HxImageSignature resultSig 00049 = HxImgFtorRuleBase::instance().getResultType( 00050 broadestSig, "mnpo", broadestSig.toString(), mnpoName); 00051 00052 for (i = 0; i < srcCnt; i++) { 00053 if (!broadestSig.isEqual(srcs[i]->signature())) { 00054 _tmp[i] = HxImgDataFactory::instance().makeImage(broadestSig, sizes); 00055 _tmp[i]->set(srcs[i]); 00056 _src[i] = _tmp[i]; 00057 } 00058 } 00059 00061 HxTagList tags; 00062 HxAddTag(tags, "sourceCnt", _srcCnt); 00063 if (!HxImageData::probeMNpo(resultSig, broadestSig, mnpoName, tags)) { 00064 _preOpIsOk = false; 00065 return; 00066 } 00067 _resCnt = HxGetTag(tags, "resultCnt", 1); 00068 00069 _result = new HxImageData * [_resCnt]; 00070 for (i = 0; i < _resCnt; i++) 00071 _result[i] = HxImgDataFactory::instance().makeImage(resultSig, sizes); 00072 } |
|
Destructor.
00075 { 00076 for (int i = 0; i < _srcCnt; i++) { 00077 if (_tmp[i]) 00078 delete _tmp[i]; 00079 } 00080 delete [] _result; 00081 delete [] _tmp; 00082 delete [] _src; 00083 } |
|
The result images of the frame.
00099 { 00100 return _result; 00101 } |
|
The n-th result image of the frame.
00075 { 00076 return ((n>=0) && (n < _resCnt)) ? _result[n] : 0; 00077 } |
|
The number of result images of the frame.
00105 { 00106 return _resCnt; 00107 } |
|
The source images of the frame.
00087 { 00088 return _src; 00089 } |
|
The number of source images of the frame.
00093 { 00094 return _srcCnt; 00095 } |
|
Indicates whether initialization was OK.
00069 { 00070 return _preOpIsOk; 00071 } |