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

multi_fwd.hxx
1/************************************************************************/
2/* */
3/* Copyright 2011-2014 by Ullrich Koethe */
4/* */
5/* This file is part of the VIGRA computer vision library. */
6/* The VIGRA Website is */
7/* http://hci.iwr.uni-heidelberg.de/vigra/ */
8/* Please direct questions, bug reports, and contributions to */
9/* ullrich.koethe@iwr.uni-heidelberg.de or */
10/* vigra@informatik.uni-hamburg.de */
11/* */
12/* Permission is hereby granted, free of charge, to any person */
13/* obtaining a copy of this software and associated documentation */
14/* files (the "Software"), to deal in the Software without */
15/* restriction, including without limitation the rights to use, */
16/* copy, modify, merge, publish, distribute, sublicense, and/or */
17/* sell copies of the Software, and to permit persons to whom the */
18/* Software is furnished to do so, subject to the following */
19/* conditions: */
20/* */
21/* The above copyright notice and this permission notice shall be */
22/* included in all copies or substantial portions of the */
23/* Software. */
24/* */
25/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND */
26/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES */
27/* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND */
28/* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT */
29/* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, */
30/* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING */
31/* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR */
32/* OTHER DEALINGS IN THE SOFTWARE. */
33/* */
34/************************************************************************/
35
36#ifndef VIGRA_MULTI_FWD_HXX
37#define VIGRA_MULTI_FWD_HXX
38
39#include <memory>
40#include "metaprogramming.hxx"
41#include "tinyvector.hxx"
42
43namespace vigra {
44
45/** \addtogroup MultiIteratorGroup Multi-dimensional Shapes and Array Iterators
46
47 \brief Shape objects and general iterators for arrays of arbitrary dimension.
48*/
49//@{
50
51/********************************************************/
52/* */
53/* shape */
54/* */
55/********************************************************/
56
57 /** Index type for a single dimension of a MultiArrayView or
58 MultiArray.
59 */
60typedef std::ptrdiff_t MultiArrayIndex;
61
62template <unsigned int N>
63class MultiArrayShape;
64
65/********************************************************/
66/* */
67/* memory layout */
68/* */
69/********************************************************/
70
71// the resulting MultiArray has no explicit channel axis
72// (i.e. the number of channels is implicitly one)
73template <class T>
74struct Singleband;
75
76// the last axis is explicitly designated as channel axis
77template <class T>
78struct Multiband;
79
80// the array is organised in chunks
81template <class T>
82struct ChunkedMemory;
83
84// helper classes to map memory layout to actual type
85namespace detail {
86
87template <class T>
88struct ResolveMultiband;
89
90template <class T>
91struct ResolveChunkedMemory;
92
93} // namespace detail
94
95/********************************************************/
96/* */
97/* constructor tag */
98/* */
99/********************************************************/
100
101 /** \brief Initialize a MultiArray in a standard way.
102
103 */
105 LinearSequence ///< Initialize array by a linear sequence in scan order
107
108/********************************************************/
109/* */
110/* element handles */
111/* */
112/********************************************************/
113
114template <class T, class NEXT>
115class CoupledHandle;
116
117template <unsigned int N, class T>
118class SharedChunkHandle;
119
120/********************************************************/
121/* */
122/* array types */
123/* */
124/********************************************************/
125
126template <unsigned int N, class T, class C = StridedArrayTag>
127class MultiArrayView;
128
129template <unsigned int N, class T,
130 class A = std::allocator<typename detail::ResolveMultiband<T>::type> >
131class MultiArray;
132
133template <unsigned int N, class T>
134class ChunkedArrayBase;
135
136template <unsigned int N, class T>
137class ChunkedArray;
138
139/********************************************************/
140/* */
141/* iterators / traversers */
142/* */
143/********************************************************/
144
145// DEPRECATED!
146// hierarchical iterator whose innermost dimension is unstrided
147template <unsigned int N, class T, class REFERENCE = T &, class POINTER = T *>
148class MultiIterator;
149
150// DEPRECATED!
151// hierarchical iterator whose innermost dimension may be strided
152template <unsigned int N, class T, class REFERENCE = T &, class POINTER = T *>
153class StridedMultiIterator;
154
155// multi-dimensional scan-order iteration returning the coordinate of the current element
156template<unsigned int N>
157class MultiCoordinateIterator;
158
159// scan-order iteration returning the current element of a multi-dimensional array
160template <unsigned int N, class V, class REFERENCE, class POINTER>
161class StridedScanOrderIterator;
162
163// simultaneous scan-order iteration over several multi-dimensional arrays
164template <unsigned int N,
165 class HANDLES=CoupledHandle<TinyVector<MultiArrayIndex, N>, void>,
166 int DIMENSION = N-1>
167class CoupledScanOrderIterator;
168
169// scan-order iteration over the chunks of a chunked array
170// returns a MultiArrayView for the current chunk
171template<unsigned int N, class T>
172class ChunkIterator;
173
174/********************************************************/
175/* */
176/* neighborhood types */
177/* */
178/********************************************************/
179
180 /** \brief Choose the neighborhood system in a dimension-independent way.
181
182 DirectNeighborhood corresponds to 4-neighborhood in 2D and 6-neighborhood in 3D, whereas
183 IndirectNeighborhood means 8-neighborhood in 2D and 26-neighborhood in 3D. The general
184 formula for N dimensions are 2*N for direct neighborhood and 3^N-1 for indirect neighborhood.
185 */
187 DirectNeighborhood=0, ///< use only direct neighbors
188 IndirectNeighborhood=1 ///< use direct and indirect neighbors
190
191
192/********************************************************/
193/* */
194/* grid graph */
195/* */
196/********************************************************/
197
198template<unsigned int N, bool BackEdgesOnly=false>
199class GridGraphNeighborIterator;
200
201template<unsigned int N, bool BackEdgesOnly=false>
202class GridGraphEdgeIterator;
203
204template<unsigned int N, bool BackEdgesOnly=false>
205class GridGraphOutEdgeIterator;
206
207template<unsigned int N, bool BackEdgesOnly=false>
208class GridGraphArcIterator;
209
210template<unsigned int N, bool BackEdgesOnly=false>
211class GridGraphOutArcIterator;
212
213template<unsigned int N, bool BackEdgesOnly=false>
214class GridGraphInArcIterator;
215
216template<unsigned int N, class DirectedTag>
217class GridGraph;
218
219//@}
220
221} // namespace vigra
222
223#endif // VIGRA_MULTI_FWD_HXX
Definition multi_shape.hxx:267
MultiArrayInitializationTag
Initialize a MultiArray in a standard way.
Definition multi_fwd.hxx:104
@ LinearSequence
Initialize array by a linear sequence in scan order.
Definition multi_fwd.hxx:105
NeighborhoodType
Choose the neighborhood system in a dimension-independent way.
Definition multi_fwd.hxx:186
@ IndirectNeighborhood
use direct and indirect neighbors
Definition multi_fwd.hxx:188
@ DirectNeighborhood
use only direct neighbors
Definition multi_fwd.hxx:187
std::ptrdiff_t MultiArrayIndex
Definition multi_fwd.hxx:60

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de)
Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany

html generated using doxygen and Python
vigra 1.11.2