00001 #ifndef Impala_Core_Array_Mirror_h
00002 #define Impala_Core_Array_Mirror_h
00003
00004 namespace Impala
00005 {
00006 namespace Core
00007 {
00008 namespace Array
00009 {
00010
00011
00012
00013 template<class DstArrayT, class Src1ArrayT>
00014 inline void
00015 MirrorY(DstArrayT*& dst, Src1ArrayT* src1)
00016 {
00017 if (dst == 0)
00018 dst = ArrayClone<DstArrayT>(src1);
00019
00020 for(int y = 0; y < src1->H(); y++)
00021 {
00022 for(int x = 0; x < src1->W() / 2; x++)
00023 {
00024 int x2 = src1->W() - x - 1;
00025 typename Src1ArrayT::ArithType tmp = src1->Value(x, y);
00026 typename Src1ArrayT::ArithType tmp2 = src1->Value(x2, y);
00027 dst->SetValue(tmp, x2, y);
00028 dst->SetValue(tmp2, x, y);
00029 }
00030 }
00031 }
00032
00033 }
00034 }
00035 }
00036
00037 #endif