[ VIGRA Homepage | Class Index | Function Index | File Index | Main Page ]
![]() |
MultiArrayView Class Template Reference | ![]() |
---|
Base class for, and view to, vigra::MultiArray. More...
#include "vigra/multi_array.hxx"
Public Types | |
typedef T | value_type |
typedef value_type & | reference |
typedef const value_type & | const_reference |
typedef value_type * | pointer |
typedef const value_type * | const_pointer |
typedef TinyVector< ptrdiff_t, actual_dimension > | difference_type |
typedef difference_type | size_type |
typedef detail::MultiIteratorChooser< C >::template Traverser< actual_dimension, T, T &, T * >::type | traverser |
typedef detail::MultiIteratorChooser< C >::template Traverser< actual_dimension, T, T const &, T const * >::type | const_traverser |
typedef MultiArrayView< N, T, C > | view_type |
typedef MultiArray< N, T > | matrix_type |
typedef NormTraits< T >::SquaredNormType | SquaredNormType |
typedef SquareRootTraits< SquaredNormType >::SquareRootResult | NormType |
enum | ActualDimension |
Public Methods | |
MultiArrayView () | |
MultiArrayView (const difference_type &shape, pointer ptr) | |
MultiArrayView (const difference_type &shape, const difference_type &stride, pointer ptr) | |
reference | operator[] (const difference_type &d) |
const_reference | operator[] (const difference_type &d) const |
reference | operator() (int x) |
reference | operator() (int x, int y) |
reference | operator() (int x, int y, int z) |
reference | operator() (int x, int y, int z, int u) |
reference | operator() (int x, int y, int z, int u, int v) |
const_reference | operator() (int x) const |
const_reference | operator() (int x, int y) const |
const_reference | operator() (int x, int y, int z) const |
const_reference | operator() (int x, int y, int z, int u) const |
const_reference | operator() (int x, int y, int z, int u, int v) const |
template<class U> void | init (const U &init) |
template<class U, class CN> void | copy (const MultiArrayView< N, U, CN > &rhs) |
template<unsigned int M> MultiArrayView< N-M, T, C > | bindOuter (const TinyVector< ptrdiff_t, M > &d) const |
template<unsigned int M> MultiArrayView< N-M, T, StridedArrayTag > | bindInner (const TinyVector< ptrdiff_t, M > &d) const |
template<unsigned int M> MultiArrayView< N-1, T, typename detail::MaybeStrided< M >::type > | bind (int d) const |
MultiArrayView< N-1, T, C > | bindOuter (int d) const |
MultiArrayView< N-1, T, StridedArrayTag > | bindInner (int d) const |
MultiArrayView< N-1, T, StridedArrayTag > | bindAt (int m, int d) const |
MultiArrayView | subarray (const difference_type &p, const difference_type &q) const |
MultiArrayView< N, T, StridedArrayTag > | stridearray (const difference_type &s) const |
std::size_t | elementCount () const |
const size_type & | size () const |
const difference_type & | shape () const |
int | size (int n) const |
int | shape (int n) const |
const difference_type & | stride () const |
int | stride (int n) const |
bool | isInside (difference_type const &p) const |
SquaredNormType | squaredNorm () const |
NormType | norm () const |
pointer | data () const |
traverser | traverser_begin () |
const_traverser | traverser_begin () const |
traverser | traverser_end () |
const_traverser | traverser_end () const |
Protected Attributes | |
difference_type | m_shape |
difference_type | m_stride |
pointer | m_ptr |
Detailed Description |
This class implements the interface of both MultiArray and MultiArrayView. By default, MultiArrayViews are tagged as unstrided. If necessary, strided arrays are constructed automatically by calls to a variant of the bind...() function.
If you want to apply an algorithm requiring an image to a MultiArrayView
of appropriate (2-dimensional) shape, you can create a vigra::BasicImageView that acts as a wrapper with the necessary interface -- see Wrap a \ref vigra::MultiArrayView in.
The template parameter are as follows
N: the array dimension T: the type of the array elements C: a tag determining whether the array's inner dimension is strided or not. An array is unstrided if the array elements occupy consecutive memory location, strided if there is an offset in between (e.g. when a view is created that skips every other array element). The compiler can generate faster code for unstrided arrays. Possible values: UnstridedArrayTag (default), StridedArrayTag
#include "vigra/multi_array.hxx"
Namespace: vigra
|
const pointer type Reimplemented in Matrix, MultiArray, and MultiArray< 2, T, ALLOC >. |
|
const reference type (result of operator[] const) Reimplemented in Matrix, MultiArray, and MultiArray< 2, T, ALLOC >. |
|
const traverser (MultiIterator) type Reimplemented in MultiArray, and MultiArray< 2, T, ALLOC >. |
|
difference type (used for offsetting) Reimplemented in Matrix, MultiArray, and MultiArray< 2, T, ALLOC >. |
|
the matrix type associated with this array. Reimplemented in Matrix, MultiArray, and MultiArray< 2, T, ALLOC >. |
|
the norm type (return type of array.norm()). Reimplemented in Matrix, MultiArray, and MultiArray< 2, T, ALLOC >. |
|
pointer type Reimplemented in Matrix, MultiArray, and MultiArray< 2, T, ALLOC >. |
|
reference type (result of operator[]) Reimplemented in Matrix, MultiArray, and MultiArray< 2, T, ALLOC >. |
|
size type Reimplemented in MultiArray, and MultiArray< 2, T, ALLOC >. |
|
the squared norm type (return type of array.squaredNorm()). Reimplemented in Matrix, MultiArray, and MultiArray< 2, T, ALLOC >. |
|
traverser (MultiIterator) type Reimplemented in MultiArray, and MultiArray< 2, T, ALLOC >. |
|
the array's value type Reimplemented in Matrix, MultiArray, and MultiArray< 2, T, ALLOC >. |
|
the view type associated with this array. Reimplemented in Matrix, MultiArray, and MultiArray< 2, T, ALLOC >. |
|
the array's actual dimensionality. This ensures that MultiArrayView can also be used for scalars (that is, when actual_dimension = (N==0) ? 1 : N |
|
default constructor: create an empty image of size 0. |
|
construct from shape and pointer |
|
construct from shape, strides (offset of a sample to the next) for every dimension) and pointer |
|
bind dimension M to index d. this reduces the dimensionality of the image to max { 1, N-1 } |
|
bind dimension m to index d. this reduces the dimensionality of the image to max { 1, N-1 } |
|
bind the innermost dimension to a certain index. this reduces the dimensionality of the image to max { 1, N-1 } |
|
bind the M innermost dimensions to certain indices. this reduces the dimensionality of the image to max { 1, N-M } |
|
bind the outmost dimension to a certain index. this reduces the dimensionality of the image to max { 1, N-1 } |
|
bind the M outmost dimensions to certain indices. this reduces the dimensionality of the image to max { 1, N-M } |
|
Copy the data of the right-hand array (array shapes must match). |
|
return the pointer to the image data |
|
number of the elements in the array. Reimplemented in Matrix. |
|
Init with a constant. |
|
check whether the given point is in the array range. |
|
return the norm of the array (equals Reimplemented in Matrix. |
|
5D const array access. Use only if N == 5. |
|
4D const array access. Use only if N == 4. |
|
3D const array access. Use only if N == 3. |
|
2D const array access. Use only if N == 2. |
|
1D const array access. Use only if N == 1. |
|
5D array access. Use only if N == 5. |
|
4D array access. Use only if N == 4. |
|
3D array access. Use only if N == 3. |
|
2D array access. Use only if N == 2. |
|
1D array access. Use only if N == 1. |
|
array access. |
|
array access. |
|
return the array's shape at a certain dimension (same as |
|
return the array's shape (same as the |
|
return the array's size at a certain dimension. |
|
return the array's size. |
|
return the squared norm of the array (sum of squares of the array elements). Reimplemented in Matrix. |
|
return the array's stride at a certain dimension. |
|
return the array's stride for every dimension. |
|
apply an additional striding to the image, thereby reducing the shape of the array. for example, multiplying the stride of dimension one by three turns an appropriately layed out (interleaved) rgb image into a single band image. |
|
create a rectangular subarray that spans between the points p and q, where p is in the subarray, q not. |
|
returns the N-dimensional MultiIterator pointing to the const first element in every dimension. |
|
returns the N-dimensional MultiIterator pointing to the first element in every dimension. |
|
returns the N-dimensional const MultiIterator pointing beyond the last element in dimension N, and to the first element in every other dimension. |
|
returns the N-dimensional MultiIterator pointing beyond the last element in dimension N, and to the first element in every other dimension. |
|
pointer to the image. |
|
the shape of the image pointed to is stored here. |
|
the strides (offset of a sample to the next) for every dimension are stored here. |
© Ullrich Köthe (koethe@informatik.uni-hamburg.de) |
html generated using doxygen and Python
|