|
Blender V4.3
|
A multidimensional array class. More...
#include <array_nd.h>
Inherits libmv::BaseArray.
Public Types | |
| typedef T | Scalar |
| typedef Tuple< int, N > | Index |
| Type for the multidimensional indices. | |
Public Member Functions | |
| ArrayND () | |
| Create an empty array. | |
| ArrayND (const Index &shape) | |
| Create an array with the specified shape. | |
| ArrayND (int *shape) | |
| Create an array with the specified shape. | |
| ArrayND (const ArrayND< T, N > &b) | |
| Copy constructor. | |
| ArrayND (int s0) | |
| ArrayND (int s0, int s1) | |
| ArrayND (int s0, int s1, int s2) | |
| ArrayND (T *data, int s0, int s1, int s2) | |
| ~ArrayND () | |
| Destructor deletes pixel data. | |
| ArrayND & | operator= (const ArrayND< T, N > &b) |
| Assignation copies pixel data. | |
| const Index & | Shapes () const |
| const Index & | Strides () const |
| void | Resize (const Index &new_shape) |
| Create an array of shape s. | |
| template<typename D > | |
| void | ResizeLike (const ArrayND< D, N > &other) |
| void | Resize (const int *new_shape_array) |
| Resizes the array to shape s. All data is lost. | |
| void | Resize (int s0) |
| Resize a 1D array to length s0. | |
| void | Resize (int s0, int s1) |
| Resize a 2D array to shape (s0,s1). | |
| void | resize (int rows, int cols) |
| void | Resize (int s0, int s1, int s2) |
| Resize a 3D array to shape (s0,s1,s2). | |
| template<typename D > | |
| void | CopyFrom (const ArrayND< D, N > &other) |
| void | Fill (T value) |
| void | fill (T value) |
| const Index & | Shape () const |
| Return a tuple containing the length of each axis. | |
| int | Shape (int axis) const |
| Return the length of an axis. | |
| int | Stride (int axis) const |
| Return the distance between neighboring elements along axis. | |
| int | Size () const |
| Return the number of elements of the array. | |
| int | MemorySizeInBytes () const |
| Return the total amount of memory used by the array. | |
| T * | Data () |
| Pointer to the first element of the array. | |
| const T * | Data () const |
| Constant pointer to the first element of the array. | |
| int | Offset (const Index &index) const |
| Distance between the first element and the element at position index. | |
| int | Offset (int i0) const |
| 1D specialization. | |
| int | Offset (int i0, int i1) const |
| 2D specialization. | |
| int | Offset (int i0, int i1, int i2) const |
| 3D specialization. | |
| T & | operator() (const Index &index) |
| Return a reference to the element at position index. | |
| T & | operator() (int i0) |
| 1D specialization. | |
| T & | operator() (int i0, int i1) |
| 2D specialization. | |
| T & | operator() (int i0, int i1, int i2) |
| 3D specialization. | |
| const T & | operator() (const Index &index) const |
| Return a constant reference to the element at position index. | |
| const T & | operator() (int i0) const |
| 1D specialization. | |
| const T & | operator() (int i0, int i1) const |
| 2D specialization. | |
| const T & | operator() (int i0, int i1, int i2) const |
| 3D specialization. | |
| bool | Contains (const Index &index) const |
| True if index is inside array. | |
| bool | Contains (int i0) const |
| 1D specialization. | |
| bool | Contains (int i0, int i1) const |
| 2D specialization. | |
| bool | Contains (int i0, int i1, int i2) const |
| 3D specialization. | |
| bool | operator== (const ArrayND< T, N > &other) const |
| bool | operator!= (const ArrayND< T, N > &other) const |
| ArrayND< T, N > | operator* (const ArrayND< T, N > &other) const |
Protected Attributes | |
| Index | shape_ |
| The number of element in each dimension. | |
| Index | strides_ |
| How to jump to neighbors in each dimension. | |
| T * | data_ |
| Pointer to the first element of the array. | |
| bool | own_data_ |
| Flag if this Array either own or reference the data. | |
A multidimensional array class.
Definition at line 36 of file array_nd.h.
Type for the multidimensional indices.
Definition at line 41 of file array_nd.h.
Definition at line 38 of file array_nd.h.
|
inline |
Create an empty array.
Definition at line 44 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
Create an array with the specified shape.
Definition at line 47 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
Create an array with the specified shape.
Definition at line 50 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
Copy constructor.
Definition at line 53 of file array_nd.h.
References b, libmv::ArrayND< T, N >::Data(), and libmv::ArrayND< T, N >::ResizeLike().
Definition at line 58 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
Definition at line 59 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
Definition at line 60 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
Definition at line 64 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
Destructor deletes pixel data.
Definition at line 70 of file array_nd.h.
References libmv::ArrayND< T, N >::data_, and libmv::ArrayND< T, N >::own_data_.
|
inline |
True if index is inside array.
Definition at line 264 of file array_nd.h.
References N, and libmv::ArrayND< T, N >::Shape().
1D specialization.
Definition at line 274 of file array_nd.h.
References libmv::ArrayND< T, N >::Shape().
2D specialization.
Definition at line 277 of file array_nd.h.
References libmv::ArrayND< T, N >::Shape().
3D specialization.
Definition at line 282 of file array_nd.h.
References libmv::ArrayND< T, N >::Shape().
Definition at line 143 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), libmv::ArrayND< T, N >::ResizeLike(), libmv::ArrayND< T, N >::Size(), and T.
Pointer to the first element of the array.
Definition at line 187 of file array_nd.h.
References libmv::ArrayND< T, N >::data_.
Referenced by libmv::ArrayND< T, N >::ArrayND(), libmv::ArrayND< T, N >::CopyFrom(), libmv::ArrayND< T, N >::Fill(), libmv::ArrayND< T, N >::fill(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator*(), libmv::ArrayND< T, N >::operator=(), libmv::ArrayND< T, N >::operator==(), libmv::TEST(), and libmv::TEST().
Constant pointer to the first element of the array.
Definition at line 190 of file array_nd.h.
References libmv::ArrayND< T, N >::data_.
Definition at line 152 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), and libmv::ArrayND< T, N >::Size().
Definition at line 159 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), and libmv::ArrayND< T, N >::Size().
Return the total amount of memory used by the array.
Definition at line 184 of file array_nd.h.
References libmv::ArrayND< T, N >::Size(), and T.
Distance between the first element and the element at position index.
Definition at line 193 of file array_nd.h.
References N, and libmv::ArrayND< T, N >::Stride().
Referenced by libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator()(), and libmv::ArrayND< T, N >::operator()().
1D specialization.
Definition at line 202 of file array_nd.h.
References N, and libmv::ArrayND< T, N >::Stride().
2D specialization.
Definition at line 208 of file array_nd.h.
References N, and libmv::ArrayND< T, N >::Stride().
3D specialization.
Definition at line 214 of file array_nd.h.
References N, and libmv::ArrayND< T, N >::Stride().
Definition at line 302 of file array_nd.h.
Return a reference to the element at position index.
Definition at line 220 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), and libmv::ArrayND< T, N >::Offset().
|
inline |
Return a constant reference to the element at position index.
Definition at line 244 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), and libmv::ArrayND< T, N >::Offset().
1D specialization.
Definition at line 226 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), and libmv::ArrayND< T, N >::Offset().
1D specialization.
Definition at line 249 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), and libmv::ArrayND< T, N >::Offset().
2D specialization.
Definition at line 229 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), libmv::ArrayND< T, N >::Offset(), and libmv::ArrayND< T, N >::Shape().
2D specialization.
Definition at line 252 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), libmv::ArrayND< T, N >::Offset(), and libmv::ArrayND< T, N >::Shape().
3D specialization.
Definition at line 236 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), libmv::ArrayND< T, N >::Offset(), and libmv::ArrayND< T, N >::Shape().
3D specialization.
Definition at line 259 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), and libmv::ArrayND< T, N >::Offset().
Definition at line 306 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), libmv::ArrayND< T, N >::ResizeLike(), libmv::ArrayND< T, N >::Shape(), and libmv::ArrayND< T, N >::Size().
Assignation copies pixel data.
Definition at line 77 of file array_nd.h.
References b, libmv::ArrayND< T, N >::Data(), and libmv::ArrayND< T, N >::ResizeLike().
Definition at line 287 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), libmv::ArrayND< T, N >::shape_, libmv::ArrayND< T, N >::Size(), and libmv::ArrayND< T, N >::strides_.
Create an array of shape s.
Definition at line 89 of file array_nd.h.
References libmv::ArrayND< T, N >::data_, N, NULL, libmv::ArrayND< T, N >::own_data_, libmv::Tuple< T, N >::Reset(), libmv::ArrayND< T, N >::shape_, libmv::ArrayND< T, N >::Size(), and libmv::ArrayND< T, N >::strides_.
Referenced by libmv::ArrayND< T, N >::ArrayND(), libmv::ArrayND< T, N >::ArrayND(), libmv::ArrayND< T, N >::ArrayND(), libmv::ArrayND< T, N >::ArrayND(), libmv::ArrayND< T, N >::ArrayND(), libmv::ArrayND< T, N >::ArrayND(), libmv::ArrayND< T, N >::ArrayND(), libmv::ArrayND< T, N >::Resize(), libmv::ArrayND< T, N >::Resize(), libmv::ArrayND< T, N >::Resize(), libmv::ArrayND< T, N >::resize(), and libmv::ArrayND< T, N >::ResizeLike().
|
inline |
Resizes the array to shape s. All data is lost.
Definition at line 114 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
Referenced by libmv::ArrayND< T, N >::Resize().
Resize a 1D array to length s0.
Definition at line 117 of file array_nd.h.
References N, and libmv::ArrayND< T, N >::Resize().
Resize a 2D array to shape (s0,s1).
Definition at line 124 of file array_nd.h.
References N, and libmv::ArrayND< T, N >::Resize().
Resize a 3D array to shape (s0,s1,s2).
Definition at line 136 of file array_nd.h.
References N, and libmv::ArrayND< T, N >::Resize().
Definition at line 133 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
|
inline |
Definition at line 109 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
Referenced by libmv::ArrayND< T, N >::ArrayND(), libmv::BoxFilterHorizontal(), libmv::BoxFilterVertical(), libmv::ByteArrayToScaledFloatArray(), libmv::Convolve(), libmv::ArrayND< T, N >::CopyFrom(), libmv::FloatArrayToScaledByteArray(), libmv::MultiplyElements(), libmv::MultiplyElements(), libmv::ArrayND< T, N >::operator*(), and libmv::ArrayND< T, N >::operator=().
Return a tuple containing the length of each axis.
Definition at line 166 of file array_nd.h.
References libmv::ArrayND< T, N >::shape_.
Referenced by libmv::ArrayND< T, N >::Contains(), libmv::ArrayND< T, N >::Contains(), libmv::ArrayND< T, N >::Contains(), libmv::ArrayND< T, N >::Contains(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator()(), libmv::ArrayND< T, N >::operator*(), and libmv::ArrayND< T, N >::Size().
Return the length of an axis.
Definition at line 169 of file array_nd.h.
References libmv::ArrayND< T, N >::shape_.
Definition at line 84 of file array_nd.h.
References libmv::ArrayND< T, N >::shape_.
Return the number of elements of the array.
Definition at line 175 of file array_nd.h.
References N, libmv::ArrayND< T, N >::Shape(), and size().
Referenced by libmv::ArrayND< T, N >::CopyFrom(), libmv::ArrayND< T, N >::Fill(), libmv::ArrayND< T, N >::fill(), libmv::ArrayND< T, N >::MemorySizeInBytes(), libmv::ArrayND< T, N >::operator*(), libmv::ArrayND< T, N >::operator==(), and libmv::ArrayND< T, N >::Resize().
Return the distance between neighboring elements along axis.
Definition at line 172 of file array_nd.h.
References libmv::ArrayND< T, N >::strides_.
Referenced by libmv::ArrayND< T, N >::Offset(), libmv::ArrayND< T, N >::Offset(), libmv::ArrayND< T, N >::Offset(), and libmv::ArrayND< T, N >::Offset().
Definition at line 86 of file array_nd.h.
References libmv::ArrayND< T, N >::strides_.
Pointer to the first element of the array.
Definition at line 324 of file array_nd.h.
Referenced by libmv::ArrayND< T, N >::Data(), libmv::ArrayND< T, N >::Data(), libmv::ArrayND< T, N >::Resize(), and libmv::ArrayND< T, N >::~ArrayND().
|
protected |
Flag if this Array either own or reference the data.
Definition at line 327 of file array_nd.h.
Referenced by libmv::ArrayND< T, N >::Resize(), and libmv::ArrayND< T, N >::~ArrayND().
The number of element in each dimension.
Definition at line 318 of file array_nd.h.
Referenced by libmv::ArrayND< T, N >::operator==(), libmv::ArrayND< T, N >::Resize(), libmv::ArrayND< T, N >::Shape(), libmv::ArrayND< T, N >::Shape(), and libmv::ArrayND< T, N >::Shapes().
How to jump to neighbors in each dimension.
Definition at line 321 of file array_nd.h.
Referenced by libmv::ArrayND< T, N >::operator==(), libmv::ArrayND< T, N >::Resize(), libmv::ArrayND< T, N >::Stride(), and libmv::ArrayND< T, N >::Strides().