Public Member Functions | |
SIMD_INLINE | Index () |
SIMD_INLINE | Index (ptrdiff_t w, ptrdiff_t h, ptrdiff_t d=1) |
SIMD_INLINE | Index (const Size &s, ptrdiff_t d=1) |
SIMD_INLINE | Index (const Index &i) |
SIMD_INLINE void | Resize (ptrdiff_t w, ptrdiff_t h, ptrdiff_t d) |
SIMD_INLINE void | Resize (const Size &s, ptrdiff_t d) |
SIMD_INLINE ptrdiff_t | Offset (ptrdiff_t x, ptrdiff_t y, ptrdiff_t c) const |
template<class T , class A > | |
SIMD_INLINE const T * | Get (const std::vector< T, A > &v, ptrdiff_t x, ptrdiff_t y, ptrdiff_t c) const |
template<class T , class A > | |
SIMD_INLINE T * | Get (std::vector< T, A > &v, ptrdiff_t x, ptrdiff_t y, ptrdiff_t c) const |
SIMD_INLINE Neural::Size | Size () const |
SIMD_INLINE ptrdiff_t | Area () const |
SIMD_INLINE ptrdiff_t | Volume () const |
Data Fields | |
ptrdiff_t | width |
A width of 3D-array. | |
ptrdiff_t | height |
A height of 3D-array. | |
ptrdiff_t | depth |
A depth of 3D-array. | |
Detailed Description
Index structure.
Provides access to complex 3D-array inside simple 1D-array.
Constructor & Destructor Documentation
◆ Index() [1/4]
◆ Index() [2/4]
SIMD_INLINE Index | ( | ptrdiff_t | w, |
ptrdiff_t | h, | ||
ptrdiff_t | d = 1 |
||
) |
Creates a new Index structure that contains the specified parameters.
- Parameters
-
[in] w - initial value for width. [in] h - initial value for height. [in] d - initial value for depth (default value is equal to 1).
◆ Index() [3/4]
Creates a new Index structure that contains the specified parameters.
- Parameters
-
[in] s - initial size (width and height). [in] d - initial value for depth (default value is equal to 1).
◆ Index() [4/4]
Member Function Documentation
◆ Resize() [1/2]
SIMD_INLINE void Resize | ( | ptrdiff_t | w, |
ptrdiff_t | h, | ||
ptrdiff_t | d | ||
) |
Recreates the Index structure with specified width, height and depth.
- Parameters
-
[in] w - new value for width. [in] h - new value for height. [in] d - new value for depth.
◆ Resize() [2/2]
SIMD_INLINE void Resize | ( | const Size & | s, |
ptrdiff_t | d | ||
) |
Recreates the Index structure with specified width, height and depth.
- Parameters
-
[in] s - new size (width and height). [in] d - new value for depth.
◆ Offset()
SIMD_INLINE ptrdiff_t Offset | ( | ptrdiff_t | x, |
ptrdiff_t | y, | ||
ptrdiff_t | c | ||
) | const |
Gets offset for 3D-point with specified coordinates.
- Parameters
-
[in] x - x-coordinate of 3D-point. [in] y - y-coordinate of 3D-point. [in] c - z-coordinate(channel) of 3D-point.
- Returns
- - an offset of the point in 1D-array.
◆ Get() [1/2]
SIMD_INLINE const T* Get | ( | const std::vector< T, A > & | v, |
ptrdiff_t | x, | ||
ptrdiff_t | y, | ||
ptrdiff_t | c | ||
) | const |
Gets constant address of 3D-point in 1D-array (std::vector).
- Parameters
-
[in] v - std::vector. [in] x - x-coordinate of 3D-point. [in] y - y-coordinate of 3D-point. [in] c - z-coordinate(channel) of 3D-point.
- Returns
- - a constant address of the point in std::vector.
◆ Get() [2/2]
SIMD_INLINE T* Get | ( | std::vector< T, A > & | v, |
ptrdiff_t | x, | ||
ptrdiff_t | y, | ||
ptrdiff_t | c | ||
) | const |
Gets address of 3D-point in 1D-array (std::vector).
- Parameters
-
[in] v - std::vector. [in] x - x-coordinate of 3D-point. [in] y - y-coordinate of 3D-point. [in] c - z-coordinate(channel) of 3D-point.
- Returns
- - an address of the point in std::vector.
◆ Size()
SIMD_INLINE Neural::Size Size | ( | ) | const |
◆ Area()
SIMD_INLINE ptrdiff_t Area | ( | ) | const |
Gets area of the channel plane in the Index.
- Returns
- - an area of the channel.
◆ Volume()
SIMD_INLINE ptrdiff_t Volume | ( | ) | const |
Gets total size (volume) of the Index.
- Returns
- - total size (volume) of 3D-array.