Blender
V3.3
|
A multidimensional array class. More...
#include <array_nd.h>
Public Types | |
typedef T | Scalar |
typedef Tuple< int, N > | Index |
Type for the multidimensional indices. More... | |
Public Member Functions | |
ArrayND () | |
Create an empty array. More... | |
ArrayND (const Index &shape) | |
Create an array with the specified shape. More... | |
ArrayND (int *shape) | |
Create an array with the specified shape. More... | |
ArrayND (const ArrayND< T, N > &b) | |
Copy constructor. More... | |
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. More... | |
ArrayND & | operator= (const ArrayND< T, N > &b) |
Assignation copies pixel data. More... | |
const Index & | Shapes () const |
const Index & | Strides () const |
void | Resize (const Index &new_shape) |
Create an array of shape s. More... | |
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. More... | |
void | Resize (int s0) |
Resize a 1D array to length s0. More... | |
void | Resize (int s0, int s1) |
Resize a 2D array to shape (s0,s1). More... | |
void | resize (int rows, int cols) |
void | Resize (int s0, int s1, int s2) |
Resize a 3D array to shape (s0,s1,s2). More... | |
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. More... | |
int | Shape (int axis) const |
Return the length of an axis. More... | |
int | Stride (int axis) const |
Return the distance between neighboring elements along axis. More... | |
int | Size () const |
Return the number of elements of the array. More... | |
int | MemorySizeInBytes () const |
Return the total amount of memory used by the array. More... | |
T * | Data () |
Pointer to the first element of the array. More... | |
const T * | Data () const |
Constant pointer to the first element of the array. More... | |
int | Offset (const Index &index) const |
Distance between the first element and the element at position index. More... | |
int | Offset (int i0) const |
1D specialization. More... | |
int | Offset (int i0, int i1) const |
2D specialization. More... | |
int | Offset (int i0, int i1, int i2) const |
3D specialization. More... | |
T & | operator() (const Index &index) |
Return a reference to the element at position index. More... | |
T & | operator() (int i0) |
1D specialization. More... | |
T & | operator() (int i0, int i1) |
2D specialization. More... | |
T & | operator() (int i0, int i1, int i2) |
3D specialization. More... | |
const T & | operator() (const Index &index) const |
Return a constant reference to the element at position index. More... | |
const T & | operator() (int i0) const |
1D specialization. More... | |
const T & | operator() (int i0, int i1) const |
2D specialization. More... | |
const T & | operator() (int i0, int i1, int i2) const |
3D specialization. More... | |
bool | Contains (const Index &index) const |
True if index is inside array. More... | |
bool | Contains (int i0) const |
1D specialization. More... | |
bool | Contains (int i0, int i1) const |
2D specialization. More... | |
bool | Contains (int i0, int i1, int i2) const |
3D specialization. More... | |
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. More... | |
Index | strides_ |
How to jump to neighbors in each dimension. More... | |
T * | data_ |
Pointer to the first element of the array. More... | |
bool | own_data_ |
Flag if this Array either own or reference the data. More... | |
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.
typedef T libmv::ArrayND< T, N >::Scalar |
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().
|
inline |
Create an array with the specified shape.
Definition at line 47 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
|
inline |
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 usdtokens::b(), libmv::ArrayND< T, N >::Data(), libmv::ArrayND< T, N >::ResizeLike(), libmv::ArrayND< T, N >::Size(), and T.
|
inline |
Definition at line 58 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
|
inline |
Definition at line 59 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
|
inline |
Definition at line 60 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
|
inline |
Definition at line 64 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
|
inline |
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 262 of file array_nd.h.
References N, and libmv::ArrayND< T, N >::Shape().
|
inline |
1D specialization.
Definition at line 270 of file array_nd.h.
References libmv::ArrayND< T, N >::Shape().
|
inline |
2D specialization.
Definition at line 273 of file array_nd.h.
References i1, and libmv::ArrayND< T, N >::Shape().
|
inline |
3D specialization.
Definition at line 278 of file array_nd.h.
References i1, and libmv::ArrayND< T, N >::Shape().
|
inline |
Definition at line 143 of file array_nd.h.
References D, libmv::ArrayND< T, N >::Data(), data, libmv::ArrayND< T, N >::ResizeLike(), libmv::ArrayND< T, N >::Size(), and T.
|
inline |
Pointer to the first element of the array.
Definition at line 186 of file array_nd.h.
References libmv::ArrayND< T, N >::data_.
Referenced by libmv::ArrayND< T, N >::ArrayND(), libmv::Convolve(), 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==(), and libmv::TEST().
|
inline |
Constant pointer to the first element of the array.
Definition at line 189 of file array_nd.h.
References libmv::ArrayND< T, N >::data_.
|
inline |
Definition at line 152 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), and libmv::ArrayND< T, N >::Size().
|
inline |
Definition at line 159 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), and libmv::ArrayND< T, N >::Size().
|
inline |
Return the total amount of memory used by the array.
Definition at line 183 of file array_nd.h.
References libmv::ArrayND< T, N >::Size(), and T.
|
inline |
Distance between the first element and the element at position index.
Definition at line 192 of file array_nd.h.
References N, offset, and libmv::ArrayND< T, N >::Stride().
Referenced by libmv::ArrayND< T, N >::operator()().
|
inline |
1D specialization.
Definition at line 200 of file array_nd.h.
References N, and libmv::ArrayND< T, N >::Stride().
|
inline |
2D specialization.
Definition at line 206 of file array_nd.h.
References i1, N, and libmv::ArrayND< T, N >::Stride().
|
inline |
3D specialization.
Definition at line 212 of file array_nd.h.
References i1, N, and libmv::ArrayND< T, N >::Stride().
|
inline |
Definition at line 295 of file array_nd.h.
|
inline |
Return a reference to the element at position index.
Definition at line 218 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 242 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), and libmv::ArrayND< T, N >::Offset().
|
inline |
1D specialization.
Definition at line 224 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), and libmv::ArrayND< T, N >::Offset().
|
inline |
1D specialization.
Definition at line 247 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), and libmv::ArrayND< T, N >::Offset().
|
inline |
2D specialization.
Definition at line 227 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), i1, libmv::ArrayND< T, N >::Offset(), and libmv::ArrayND< T, N >::Shape().
|
inline |
2D specialization.
Definition at line 250 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), i1, libmv::ArrayND< T, N >::Offset(), and libmv::ArrayND< T, N >::Shape().
|
inline |
3D specialization.
Definition at line 234 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), i1, libmv::ArrayND< T, N >::Offset(), and libmv::ArrayND< T, N >::Shape().
|
inline |
3D specialization.
Definition at line 257 of file array_nd.h.
References libmv::ArrayND< T, N >::Data(), i1, and libmv::ArrayND< T, N >::Offset().
|
inline |
Definition at line 299 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().
|
inline |
Assignation copies pixel data.
Definition at line 77 of file array_nd.h.
References usdtokens::b(), libmv::ArrayND< T, N >::Data(), libmv::ArrayND< T, N >::ResizeLike(), libmv::ArrayND< T, N >::Size(), and T.
|
inline |
Definition at line 283 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_.
|
inline |
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(), libmv::ArrayND< T, N >::strides_, and T.
Referenced by libmv::ArrayND< T, N >::ArrayND(), 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().
|
inline |
Definition at line 133 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize().
|
inline |
Resize a 1D array to length s0.
Definition at line 117 of file array_nd.h.
References N, and libmv::ArrayND< T, N >::Resize().
|
inline |
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().
|
inline |
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().
|
inline |
Definition at line 109 of file array_nd.h.
References libmv::ArrayND< T, N >::Resize(), and libmv::ArrayND< T, N >::Shape().
Referenced by libmv::ArrayND< T, N >::ArrayND(), libmv::ByteArrayToScaledFloatArray(), libmv::ArrayND< T, N >::CopyFrom(), libmv::FloatArrayToScaledByteArray(), libmv::ArrayND< T, N >::operator*(), and libmv::ArrayND< T, N >::operator=().
|
inline |
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 >::operator()(), libmv::ArrayND< T, N >::operator*(), libmv::ArrayND< T, N >::ResizeLike(), and libmv::ArrayND< T, N >::Size().
|
inline |
Return the length of an axis.
Definition at line 169 of file array_nd.h.
References libmv::ArrayND< T, N >::shape_.
|
inline |
Definition at line 84 of file array_nd.h.
References libmv::ArrayND< T, N >::shape_.
|
inline |
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 >::ArrayND(), 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=(), libmv::ArrayND< T, N >::operator==(), and libmv::ArrayND< T, N >::Resize().
|
inline |
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::Convolve(), and libmv::ArrayND< T, N >::Offset().
|
inline |
Definition at line 86 of file array_nd.h.
References libmv::ArrayND< T, N >::strides_.
|
protected |
Pointer to the first element of the array.
Definition at line 317 of file array_nd.h.
Referenced by 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 320 of file array_nd.h.
Referenced by libmv::ArrayND< T, N >::Resize(), and libmv::ArrayND< T, N >::~ArrayND().
|
protected |
The number of element in each dimension.
Definition at line 311 of file array_nd.h.
Referenced by libmv::ArrayND< T, N >::operator==(), libmv::ArrayND< T, N >::Resize(), libmv::ArrayND< T, N >::Shape(), and libmv::ArrayND< T, N >::Shapes().
|
protected |
How to jump to neighbors in each dimension.
Definition at line 314 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().