Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

PatSet.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_Pattern_PatSet_h
00002 #define Impala_Core_Array_Pattern_PatSet_h
00003 
00004 #include "Core/Array/Pattern/FuncSet.h"
00005 #include "Core/Array/Array2dTem.h"
00006 
00007 #ifdef PX_HORUS_USED
00008 #include "Core/Array/Pattern/PxArrayFunc.h"
00009 #include "Core/Array/Pattern/PxStateTrans.h"
00010 #endif
00011 
00012 namespace Impala
00013 {
00014 namespace Core
00015 {
00016 namespace Array
00017 {
00018 namespace Pattern
00019 {
00020 
00021 
00022 template<class DstArrayT, class SrcArrayT>
00023 inline void
00024 PatSet(DstArrayT*& dst, SrcArrayT* src, int minimalBW = 0, int minimalBH = 0)
00025 {
00026     if (dst == 0)
00027         dst = ArrayClone<DstArrayT>(src, minimalBW, minimalBH);
00028 
00029     // todo : check core array sizes
00030 
00031 #ifdef PX_HORUS_USED
00032     if (!PxRunParallel() || PxArrayIsPD(src)) {     // run sequential
00033 #endif
00034         FuncSet(dst, src, 0, 0, src->CW(), src->CH(), 0, 0);
00035 
00036 #ifdef PX_HORUS_USED
00037     } else {                                        // run parallel
00038         PxArrayPreStateTrans(src, PAR_PART, STRONG);
00039         PxArrayPreStateTrans(dst, PAR_PART, WEAK);
00040         FuncSet(PxArrayPD(dst), PxArrayPD(src), 0, 0,
00041             ArrayCW(PxArrayPD(src)), ArrayCH(PxArrayPD(src)), 0, 0);
00042         PxArrayPostStateTrans(dst);
00043 
00044         if (!PxRunLazyParallel()) {
00045             PxArrayForceNonDistributed(src);
00046             PxArrayForceNonDistributed(dst);
00047         }
00048     }
00049 #endif
00050 }
00051 
00052 
00053 template<class DstArrayT, class SrcArrayT>
00054 inline void
00055 PatSet(DstArrayT*& dst, SrcArrayT* src, int srcX, int srcY,
00056        int width, int height, int dstX, int dstY,
00057        int minimalBW = 0, int minimalBH = 0)
00058 {
00059     if (dst == 0)
00060         dst = ArrayClone<DstArrayT>(src, minimalBW, minimalBH);
00061 
00062     // todo : check core array sizes
00063 
00064 #ifdef PX_HORUS_USED
00065     if (!PxRunParallel()) {                         // run sequential
00066 #endif
00067         FuncSet(dst, src, srcX, srcY, width, height, dstX, dstY);
00068 
00069 #ifdef PX_HORUS_USED
00070     } else {                                        // run parallel
00071         PX_COUT << "NOTE: CxPatSet NOT PARALLELIZED YET!"
00072                 << PX_ENDL;
00073         PxArrayForceNonDistributed(src);
00074         PxArrayForceNonDistributed(dst);
00075         FuncSet(dst, src, srcX, srcY, width, height, dstX, dstY);
00076     }
00077 #endif
00078 }
00079 
00080 } // namespace Pattern
00081 } // namespace Array
00082 } // namespace Core
00083 } // namespace Impala
00084 
00085 #endif

Generated on Fri Mar 19 09:30:51 2010 for ImpalaSrc by  doxygen 1.5.1