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

ArrayFunc.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_Pattern_ArrayFunc_h
00002 #define Impala_Core_Array_Pattern_ArrayFunc_h
00003 
00004 #include "Basis/NativeTypes.h"
00005 
00006 namespace Impala
00007 {
00008 namespace Core
00009 {
00010 namespace Array
00011 {
00012 namespace Pattern
00013 {
00014 
00015 
00016 template<class ArrayT>
00017 inline Int64
00018 ArrayW(ArrayT* array)
00019 {
00020     return array->mCW + 2*array->mBW;
00021 }
00022 
00023 template<class ArrayT>
00024 inline Int64
00025 ArrayBW(ArrayT* array)
00026 {
00027     return array->mBW;
00028 }
00029 
00030 template<class ArrayT>
00031 inline Int64
00032 ArrayCW(ArrayT* array)
00033 {
00034     return array->mCW;
00035 }
00036 
00037 template<class ArrayT>
00038 inline Int64
00039 ArrayH(ArrayT* array)
00040 {
00041     return array->mCH + 2*array->mBH;
00042 }
00043 
00044 template<class ArrayT>
00045 inline Int64
00046 ArrayBH(ArrayT* array)
00047 {
00048     return array->mBH;
00049 }
00050 
00051 template<class ArrayT>
00052 inline Int64
00053 ArrayCH(ArrayT* array)
00054 {
00055     return array->mCH;
00056 }
00057 
00058 template<class ArrayT>
00059 inline Int64
00060 ArrayInc(ArrayT* array, Int64 x, Int64 y)
00061 {
00062     return y * ArrayW(array) * ArrayT::ElemSize() + x * ArrayT::ElemSize();
00063 }
00064 
00065 template<class ArrayT>
00066 inline typename ArrayT::StorType*
00067 ArrayPB(ArrayT* array, Int64 x=0, Int64 y=0)
00068 {
00069     return array->mData + ArrayInc(array, x, y);
00070 }
00071 
00072 template<class ArrayT>
00073 inline typename ArrayT::StorType*
00074 ArrayCPB(ArrayT* array, Int64 x=0, Int64 y=0)
00075 {
00076     return array->mData + ArrayInc(array, array->mBW + x, array->mBH + y);
00077 }
00078 
00079 template<class ArrayT>
00080 inline typename ArrayT::StorType*
00081 ArrayCPE(ArrayT* array, Int64 x=0, Int64 y=0)
00082 {
00083     return array->mData + ArrayInc(array, array->mBW + array->mCW - 1 + x,
00084                                      array->mBH + array->mCH - 1 + y);
00085 }
00086 
00087 } // namespace Pattern
00088 } // namespace Array
00089 } // namespace Core
00090 } // namespace Impala
00091 
00092 #endif

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