00001 #ifndef Impala_Core_Array_InvOpponentDer_h
00002 #define Impala_Core_Array_InvOpponentDer_h
00003
00004 #include <vector>
00005 #include "Core/Array/Trait/M9N4poFO.h"
00006 #include "Core/Array/Trait/M9poFO3x.h"
00007 #include "Core/Array/Trait/M9poFO3y.h"
00008 #include "Core/Array/Pattern/PatM9N4PixOp.h"
00009 #include "Core/Array/Pattern/PatM9PixOp.h"
00010
00011 namespace Impala
00012 {
00013 namespace Core
00014 {
00015 namespace Array
00016 {
00017
00018
00028 template<class ArrayT>
00029 inline std::vector<ArrayT*>
00030 InvOpponentDer(std::vector<ArrayT*>& src)
00031 {
00032 Trait::M9N4poFO<ArrayT, ArrayT> traitO1xy2xy;
00033 std::vector<ArrayT*> resList;
00034 resList = Pattern::PatM9N4PixOp<ArrayT>(src[0], src[3], src[6],
00035 src[1], src[4], src[7],
00036 src[2], src[5], src[8],
00037 traitO1xy2xy);
00038
00039 ArrayT* o3x = ArrayClone<ArrayT>(src[0]);
00040 Trait::M9poFO3x<ArrayT, ArrayT> traitO3x;
00041 Pattern::PatM9PixOp<ArrayT>(o3x, src[0], src[3], src[6],
00042 src[1], src[4], src[7],
00043 src[2], src[5], src[8],
00044 traitO3x);
00045 resList.push_back(o3x);
00046
00047 ArrayT* o3y = ArrayClone<ArrayT>(src[0]);
00048 Trait::M9poFO3y<ArrayT, ArrayT> traitO3y;
00049 Pattern::PatM9PixOp<ArrayT>(o3y, src[0], src[3], src[6],
00050 src[1], src[4], src[7],
00051 src[2], src[5], src[8],
00052 traitO3y);
00053 resList.push_back(o3y);
00054 return resList;
00055 }
00056
00057 }
00058 }
00059 }
00060
00061 #endif