[ VIGRA Homepage | Class Index | Function Index | File Index | Main Page ]

details MultiArrayView Class Template Reference VIGRA

Base class for, and view to, vigra::MultiArray. More...

#include "vigra/multi_array.hxx"


Public Types

typedef T value_type
typedef value_typereference
typedef const value_typeconst_reference
typedef value_typepointer
typedef const value_typeconst_pointer
typedef TinyVector< int, actual_dimension > size_type
typedef TinyVector< int, actual_dimension > difference_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
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<unsigned int M> MultiArrayView< N-M, T, C > bindOuter (const TinyVector< int, M > &d) const
template<unsigned int M> MultiArrayView< N-M, T, StridedArrayTagbindInner (const TinyVector< int, 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, StridedArrayTagbindInner (int d) const
MultiArrayView< N-1, T, StridedArrayTagbindAt (int m, int d) const
MultiArrayView< N-1, T, StridedArrayTagbindRow (int d) const
MultiArrayView< N-1, T, C > bindColumn (int d) const
MultiArrayView subarray (const difference_type &p, const difference_type &q) const
MultiArrayView< N, T, StridedArrayTagstridearray (const difference_type &s) const
std::size_t elementCount () const
const size_typesize () const
const difference_typeshape () const
int shape (int n) const
const difference_typestride () const
int stride (int n) 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_stride
difference_type m_shape
pointer m_ptr


Detailed Description


template<unsigned int N, class T, class C>
class vigra::MultiArrayView< N, T, C >

Base class for, and view to, vigra::MultiArray.

This class implements the interface of both MultiArray and MultiArrayView. By default, MultiArrayViews are tagged as unstrided. I necessary, strided arrays are constructed automatically by calls to a variant of the bind...() function.

#include "vigra/multi_array.hxx"

Namespace: vigra


Member Typedef Documentation


typedef const value_type* const_pointer

 

const pointer type

Reimplemented in MultiArray.


typedef const value_type& const_reference

 

const reference type (result of operator[] const)

Reimplemented in MultiArray.


typedef detail::MultiIteratorChooser< C>::template Traverser<actual_dimension, T, T const &, T const *>::type const_traverser

 

const traverser (MultiIterator) type

Reimplemented in MultiArray.


typedef TinyVector<int, actual_dimension> difference_type

 

difference type (used for offsetting)

Reimplemented in MultiArray.


typedef MultiArray<N, T> matrix_type

 

the matrix type associated with this array.

Reimplemented in MultiArray.


typedef value_type* pointer

 

pointer type

Reimplemented in MultiArray.


typedef value_type& reference

 

reference type (result of operator[])

Reimplemented in MultiArray.


typedef TinyVector<int, actual_dimension> size_type

 

size type

Reimplemented in MultiArray.


typedef detail::MultiIteratorChooser< C>::template Traverser<actual_dimension, T, T &, T *>::type traverser

 

traverser (MultiIterator) type

Reimplemented in MultiArray.


typedef T value_type

 

the array's value type

Reimplemented in MultiArray.


typedef MultiArrayView<N, T, C> view_type

 

the view type associated with this array.

Reimplemented in MultiArray.


Member Enumeration Documentation


enum ActualDimension

 

the array's actual dimensionality. This ensures that MultiArrayView can also be used for scalars (that is, when N == 0). Calculated as:

            actual_dimension = (N==0) ? 1 : N


Constructor & Destructor Documentation


MultiArrayView   [inline]

 

default constructor: create an empty image of size 0.


MultiArrayView const difference_type   shape,
pointer    ptr

 

construct from shape and pointer


MultiArrayView const difference_type   shape,
const difference_type   stride,
pointer    ptr

 

construct from shape, strides (offset of a sample to the next) for every dimension) and pointer


Member Function Documentation


MultiArrayView< N-1, T, typename detail::MaybeStrided< M >::type > bind int    d const

 

bind dimension M to index d. this reduces the dimensionality of the image to min { 1, N-1 }


MultiArrayView< N-1, T, StridedArrayTag > bindAt int    m,
int    d
const

 

bind dimension m to index d. this reduces the dimensionality of the image to min { 1, N-1 }


MultiArrayView< N-1, T, C > bindColumn int    d const

 

bind dimension m to index d. this reduces the dimensionality of the image to min { 1, N-1 }


MultiArrayView< N-1, T, StridedArrayTag > bindInner int    d const

 

bind the innermost dimension to a certain index. this reduces the dimensionality of the image to min { 1, N-1 }


MultiArrayView< N-M, T, StridedArrayTag > bindInner const TinyVector< int, M > &    d const

 

bind the M innermost dimensions to certain indices. this reduces the dimensionality of the image to min { 1, N-M }


MultiArrayView< N-1, T, C > bindOuter int    d const

 

bind the outmost dimension to a certain index. this reduces the dimensionality of the image to min { 1, N-1 }


MultiArrayView< N-M, T, C > bindOuter const TinyVector< int, M > &    d const

 

bind the M outmost dimensions to certain indices. this reduces the dimensionality of the image to min { 1, N-M }


MultiArrayView< N-1, T, StridedArrayTag > bindRow int    d const

 

bind dimension m to index d. this reduces the dimensionality of the image to min { 1, N-1 }


pointer data   const [inline]

 

return the pointer to the image data


std::size_t elementCount   const [inline]

 

number of the elements in the array.


const_reference operator() int    x,
int    y,
int    z,
int    u,
int    v
const [inline]

 

5D const array access. Use only if N == 5.


const_reference operator() int    x,
int    y,
int    z,
int    u
const [inline]

 

4D const array access. Use only if N == 4.


const_reference operator() int    x,
int    y,
int    z
const [inline]

 

3D const array access. Use only if N == 3.


const_reference operator() int    x,
int    y
const [inline]

 

2D const array access. Use only if N == 2.


const_reference operator() int    x const [inline]

 

1D const array access. Use only if N == 1.


reference operator() int    x,
int    y,
int    z,
int    u,
int    v
[inline]

 

5D array access. Use only if N == 5.


reference operator() int    x,
int    y,
int    z,
int    u
[inline]

 

4D array access. Use only if N == 4.


reference operator() int    x,
int    y,
int    z
[inline]

 

3D array access. Use only if N == 3.


reference operator() int    x,
int    y
[inline]

 

2D array access. Use only if N == 2.


reference operator() int    x [inline]

 

1D array access. Use only if N == 1.


const_reference operator[] const difference_type   d const [inline]

 

array access.


reference operator[] const difference_type   d [inline]

 

array access.


int shape int    n const [inline]

 

return the array's shape at a certain dimension.


const difference_type& shape   const [inline]

 

return the array's shape.


const size_type& size   const [inline]

 

return the array's size (same as the shape).


int stride int    n const [inline]

 

return the array's stride at a certain dimension.


const difference_type& stride   const [inline]

 

return the array's stride for every dimension.


MultiArrayView<N, T, StridedArrayTag> stridearray const difference_type   s const [inline]

 

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.


MultiArrayView subarray const difference_type   p,
const difference_type   q
const [inline]

 

create a rectangular subarray that spans between the points p and q, where p is in the subarray, q not.


const_traverser traverser_begin   const [inline]

 

returns the N-dimensional MultiIterator pointing to the const first element in every dimension.


traverser traverser_begin   [inline]

 

returns the N-dimensional MultiIterator pointing to the first element in every dimension.


const_traverser traverser_end   const [inline]

 

returns the N-dimensional const MultiIterator pointing beyond the last element in dimension N, and to the first element in every other dimension.


traverser traverser_end   [inline]

 

returns the N-dimensional MultiIterator pointing beyond the last element in dimension N, and to the first element in every other dimension.


Member Data Documentation


pointer m_ptr [protected]

 

pointer to the image.


difference_type m_shape [protected]

 

the shape of the image pointed to is stored here.


difference_type m_stride [protected]

 

the strides (offset of a sample to the next) for every dimension are stored here.


The documentation for this class was generated from the following file:

© Ullrich Köthe (koethe@informatik.uni-hamburg.de)
Cognitive Systems Group, University of Hamburg, Germany

html generated using doxygen and Python
VIGRA 1.2.0 (7 Aug 2003)