00001 #ifndef Impala_Core_Array_Pattern_PatRgbOp_h
00002 #define Impala_Core_Array_Pattern_PatRgbOp_h
00003
00004 #include "Core/Geometry/GeoIntType.h"
00005 #include "Core/Array/Pattern/FuncRgbOp.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 ArrayT, class RgbOpT>
00023 inline void
00024 PatRgbOp(ArrayT* src, int* pixels, int resWidth, int resHeight,
00025 Geometry::GeoIntType gi, RgbOpT& rgbOp)
00026 {
00027 #ifdef PX_HORUS_USED
00028 if (!PxRunParallel()) {
00029 #endif
00030 FuncRgbOp(src, pixels, resWidth, resHeight, gi, rgbOp);
00031
00032 #ifdef PX_HORUS_USED
00033 } else {
00034 PxArrayPreStateTrans(src, SEQ_VALID, WEAK);
00035 FuncRgbOp(src, pixels, resWidth, resHeight, gi, rgbOp);
00036
00037 if (!PxRunLazyParallel()) {
00038 PxArrayForceNonDistributed(src);
00039 }
00040 }
00041 #endif
00042 }
00043
00044
00045 template<class ArrayT, class RgbOpT>
00046 inline void
00047 PatRgbOp(ArrayT* src, UInt8* pixels, int resWidth, int resHeight,
00048 Geometry::GeoIntType gi, RgbOpT& rgbOp)
00049 {
00050 #ifdef PX_HORUS_USED
00051 if (!PxRunParallel()) {
00052 #endif
00053 FuncRgbOp(src, pixels, resWidth, resHeight, gi, rgbOp);
00054
00055 #ifdef PX_HORUS_USED
00056 } else {
00057 PxArrayPreStateTrans(src, SEQ_VALID, WEAK);
00058 FuncRgbOp(src, pixels, resWidth, resHeight, gi, rgbOp);
00059
00060 if (!PxRunLazyParallel()) {
00061 PxArrayForceNonDistributed(src);
00062 }
00063 }
00064 #endif
00065 }
00066
00067 }
00068 }
00069 }
00070 }
00071
00072 #endif