IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
arrayUtilsImpl.h
Go to the documentation of this file.
1 // arrayUtilsImpl.h:
3 // -----------------
4 //
14 
15 #ifndef __IPSDKUTIL_TOOLS_DETAIL_ARRAYUTILSIMPL_H__
16 #define __IPSDKUTIL_TOOLS_DETAIL_ARRAYUTILSIMPL_H__
17 
19 
20 namespace ipsdk {
21 namespace arrayop {
22 namespace detail {
23 
25 
27 // structures CopyArray and CopyArray_, used to copy a given
28 // number of elements from a source array to a destination array
30 template <int begin, int end> struct CopyArray_
31 {
32  template <typename T>
33  static IPSDK_FORCEINLINE void act(const T* src, T* dest)
34  {
35  dest[begin] = src[begin];
37  }
38 };
39 
40 template <int end> struct CopyArray_<end, end> {
41  template <typename T>
42  static IPSDK_FORCEINLINE void act(const T* src, T* dest)
43  {
44  dest[end] = src[end];
45  }
46 };
47 
48 template <int how_many> struct CopyArray {
49  template <typename T>
50  static IPSDK_FORCEINLINE void act(const T* src, T* dest)
51  {
53  }
54 };
55 
57 // structures IndexedIncrement and IndexedIncrement_, used to increment a given
58 // number of elements of an array
59 // given by their indexes
60 // \param a: array, whose elements have to be incremented
61 // \param idx: array of indexes of the elements in a to be increments
63 template <int begin, int end> struct IndexedIncrement_
64 {
65  template <typename T> static IPSDK_FORCEINLINE void act(T* a, ipInt32* idx)
66  {
67  a[idx[begin]] = a[idx[begin]] + 1;
69  }
70 };
71 
72 template <int end> struct IndexedIncrement_<end, end> {
73  template <typename T> static IPSDK_FORCEINLINE void act(T* a, ipInt32* idx)
74  {
75  a[idx[end]] = a[idx[end]] + 1;
76  }
77 };
78 
79 template <int how_many> struct IndexedIncrement {
80  template <typename T> static IPSDK_FORCEINLINE void act(T* a, ipInt32* idx)
81  {
83  }
84 };
85 
88 
89 } // end of namespace detail
90 } // end of namespace arrayop
91 } // end of namespace ipsdk
92 
93 #endif // __IPSDKUTIL_TOOLS_DETAIL_ARRAYUTILSIMPL_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
int32_t ipInt32
Base types definition.
Definition: BaseTypes.h:52
Definition: arrayUtilsImpl.h:63
Definition: arrayUtilsImpl.h:30
Definition: arrayUtilsImpl.h:79
Definition: arrayUtilsImpl.h:48
Definition of import/export macro for library.