VIGRA - VIGRA: vigra/iteratortraits.hxx Source File

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

# vigra/iteratortraits.hxx

    00001 /************************************************************************/
    00002 /*                                                                      */
    00003 /*               Copyright 1998-2002 by Ullrich Koethe                  */
    00004 /*       Cognitive Systems Group, University of Hamburg, Germany        */
    00005 /*                                                                      */
    00006 /*    This file is part of the VIGRA computer vision library.           */
    00007 /*    ( Version 1.6.0, Aug 13 2008 )                                    */
    00008 /*    The VIGRA Website is                                              */
    00009 /*        http://kogs-www.informatik.uni-hamburg.de/~koethe/vigra/      */
    00010 /*    Please direct questions, bug reports, and contributions to        */
    00011 /*        ullrich.koethe@iwr.uni-heidelberg.de    or                    */
    00012 /*        vigra@informatik.uni-hamburg.de                               */
    00013 /*                                                                      */
    00014 /*    Permission is hereby granted, free of charge, to any person       */
    00015 /*    obtaining a copy of this software and associated documentation    */
    00016 /*    files (the "Software"), to deal in the Software without           */
    00017 /*    restriction, including without limitation the rights to use,      */
    00018 /*    copy, modify, merge, publish, distribute, sublicense, and/or      */
    00019 /*    sell copies of the Software, and to permit persons to whom the    */
    00020 /*    Software is furnished to do so, subject to the following          */
    00021 /*    conditions:                                                       */
    00022 /*                                                                      */
    00023 /*    The above copyright notice and this permission notice shall be    */
    00024 /*    included in all copies or substantial portions of the             */
    00025 /*    Software.                                                         */
    00026 /*                                                                      */
    00027 /*    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND    */
    00028 /*    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES   */
    00029 /*    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND          */
    00030 /*    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT       */
    00031 /*    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,      */
    00032 /*    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING      */
    00033 /*    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR     */
    00034 /*    OTHER DEALINGS IN THE SOFTWARE.                                   */
    00035 /*                                                                      */
    00036 /************************************************************************/
    00037
    00038
    00039 #ifndef VIGRA_ITERATORTRAITS_HXX
    00040 #define VIGRA_ITERATORTRAITS_HXX
    00041
    00042 #include "accessor.hxx"
    00043 #include "imageiteratoradapter.hxx"
    00044
    00045 namespace vigra {
    00046
    00047 /** \addtogroup ImageIterators
    00048 */
    00049 //@{
    00050 /** \brief Export associated information for each image iterator.
    00051
    00052     The IteratorTraits class contains the following fields:
    00053
    00054     \code
    00055     template <class T>
    00056     struct IteratorTraits
    00057     {
    00058         typedef T                                     Iterator;
    00059         typedef Iterator                              iterator;
    00060         typedef typename iterator::iterator_category  iterator_category;
    00061         typedef typename iterator::value_type         value_type;
    00062         typedef typename iterator::reference          reference;
    00063         typedef typename iterator::index_reference    index_reference;
    00064         typedef typename iterator::pointer            pointer;
    00065         typedef typename iterator::difference_type    difference_type;
    00066         typedef typename iterator::row_iterator       row_iterator;
    00067         typedef typename iterator::column_iterator    column_iterator;
    00068         typedef typename
    00069          AccessorTraits<value_type>::default_accessor DefaultAccessor;
    00070         typedef DefaultAccessor                       default_accessor;
    00071
    00072         typedef VigraTrueType/VigraFalseType          hasConstantStrides;
    00073     };
    00074     \endcode
    00075
    00076     By (partially) specializing this template for an iterator class
    00077     the defaults given above can be changed as appropriate. For example, iterators
    00078     for rgb images are associated with <TT>RGBAccessor<value_type></TT>
    00079     instead of <TT>StandardAccessor<value_type></TT>. To get the accessor
    00080     associated with a given iterator, use code like this:
    00081
    00082     \code
    00083     template <class Iterator>
    00084     void foo(Iterator i)
    00085     {
    00086         typedef typename IteratorTraits<Iterator>::DefaultAccessor Accessor;
    00087         Accessor a;
    00088         ...
    00089     }
    00090     \endcode
    00091
    00092     This technique is, for example, used by the
    00093     \ref IteratorBasedArgumentObjectFactories. The possibility to retrieve the default accessor by means of a traits
    00094     class is especially important since this information is not
    00095     contained in the iterator directly.
    00096
    00097     The member <tt>hasConstantStrides</tt> is useful for certain
    00098     optimizations: it helps to decide whether we can replace iterator
    00099     operations such as <tt>iter++</tt> or <tt>iter += n</tt> with
    00100     corresponding pointer operations (which may be faster), where
    00101     the pointer is obtained as the address of iterator's pointee
    00102     (the object the iterator currently  refers to).
    00103     This flag would be <tt>VigraFalseType</tt> for a
    00104     <tt>std::list<int>::iterator</tt>, but is <tt>VigraTrueType</tt>
    00105     for most VIGRA iterators.
    00106
    00107     <b>\#include</b> <<a href="iteratortraits_8hxx-source.html">vigra/iteratortraits.hxx</a>>
    00108     Namespace: vigra
    00109 */
    00110 template <class T>
    00111 struct IteratorTraits
    00112 {
    00113     typedef T                                          Iterator;
    00114     typedef Iterator                                   iterator;
    00115     typedef typename iterator::iterator_category       iterator_category;
    00116     typedef typename iterator::value_type              value_type;
    00117     typedef typename iterator::reference               reference;
    00118     typedef typename iterator::index_reference         index_reference;
    00119     typedef typename iterator::pointer                 pointer;
    00120     typedef typename iterator::difference_type         difference_type;
    00121     typedef typename iterator::row_iterator            row_iterator;
    00122     typedef typename iterator::column_iterator         column_iterator;
    00123     typedef typename
    00124         AccessorTraits<value_type>::default_accessor   DefaultAccessor;
    00125     typedef DefaultAccessor                            default_accessor;
    00126
    00127     // default: disable the constant strides optimization
    00128     typedef VigraFalseType                             hasConstantStrides;
    00129 };
    00130
    00131 template <class T>
    00132 struct IteratorTraitsBase
    00133 {
    00134     typedef T                                     Iterator;
    00135     typedef Iterator                              iterator;
    00136     typedef typename iterator::iterator_category  iterator_category;
    00137     typedef typename iterator::value_type         value_type;
    00138     typedef typename iterator::reference          reference;
    00139     typedef typename iterator::index_reference    index_reference;
    00140     typedef typename iterator::pointer            pointer;
    00141     typedef typename iterator::difference_type    difference_type;
    00142     typedef typename iterator::row_iterator       row_iterator;
    00143     typedef typename iterator::column_iterator    column_iterator;
    00144 };
    00145
    00146
    00147 //@}
    00148
    00149
    00150 /***********************************************************/
    00151
    00152 /** \page ArgumentObjectFactories Argument Object Factories
    00153
    00154     Factory functions to create argument objects which simplify long argument lists.
    00155
    00156     <UL style="list-style-image:url(documents/bullet.gif)">
    00157     <LI> \ref ImageBasedArgumentObjectFactories
    00158     <LI> \ref MultiArrayBasedArgumentObjectFactories
    00159     <LI> \ref IteratorBasedArgumentObjectFactories
    00160     </UL>
    00161
    00162     Long argument lists provide for greater flexibility of functions,
    00163     but they are also tedious and error prone, when we don't need
    00164     the flexibility. Thus, we define argument objects which
    00165     automatically provide reasonable defaults for those arguments that we
    00166     didn't specify explicitly.
    00167
    00168     The argument objects are created via a number of factory functions.
    00169     Since these functions have descriptive names, they also serve
    00170     to improve readability: the name of each factory tells te purpose of its
    00171     argument object.
    00172
    00173     Consider the following example. Without argument objects we had to
    00174     write something like this (cf. \ref copyImageIf()):
    00175
    00176     \code
    00177     vigra::BImage img1, img2, img3;
    00178
    00179     // fill img1 and img2 ...
    00180
    00181     vigra::copyImageIf(img1.upperLeft(), img1.lowerRight(), img1.accessor(),
    00182                 img2.upperLeft(), img2.accessor(),
    00183                 img3.upperLeft(), img3.accessor());
    00184     \endcode
    00185
    00186     Using the argument object factories, this becomes much shorter and
    00187     more readable:
    00188
    00189     \code
    00190     vigra::copyImageIf(srcImageRange(img1),
    00191                 maskImage(img2),
    00192                 destImage(img3));
    00193     \endcode
    00194
    00195     The names of the factories clearly tell which image is source, mask,
    00196     and destination. In addition, the suffix <TT>Range</TT> must be used
    00197     for those argument objects that need to specify the lower right
    00198     corner of the region of interest. Typically, this is only the first
    00199     source argument, but sometimes the first destiniation argument must
    00200     also contain a range.
    00201
    00202     The factory functions come in two flavours: Iterator based and
    00203     image based factories. Above we have seen the image based variant.
    00204     The iterator based variant would look like this:
    00205
    00206     \code
    00207     vigra::copyImageIf(srcIterRange(img1.upperLeft(), img1.lowerRight()),
    00208                 maskIter(img2.upperLeft()),
    00209                 destIter(img3.upperLeft()));
    00210     \endcode
    00211
    00212     These factory functions contain the word <TT>Iter</TT> instead of the word
    00213     <TT>Image</TT>,  They would normally be used if we couldn't access the
    00214     images (for example, within a function which got passed iterators)
    00215     or if we didn't want to operate on the entire image. The default
    00216     accessor is obtained via \ref vigra::IteratorTraits.
    00217
    00218     All factory functions also allow to specify accessors explicitly. This
    00219     is useful if we can't use the default accessor. This variant looks
    00220     like this:
    00221
    00222     \code
    00223     vigra::copyImageIf(srcImageRange(img1),
    00224                 maskImage(img2, MaskPredicateAccessor()),
    00225                 destImage(img3));
    00226     \endcode
    00227
    00228     or
    00229
    00230     \code
    00231     vigra::copyImageIf(srcIterRange(img1.upperLeft(), img1.lowerRight()),
    00232                 maskIter(img2.upperLeft(), MaskPredicateAccessor()),
    00233                 destIter(img3.upperLeft()));
    00234     \endcode
    00235
    00236     All versions can be mixed freely within one explession.
    00237     Technically, the argument objects are simply defined as
    00238     pairs and triples of iterators and accessor so that all algorithms
    00239     should declare a call interface version based on pairs and triples
    00240     (see for example \ref copyImageIf()).
    00241
    00242   \section ImageBasedArgumentObjectFactories Image Based Argument Object Factories
    00243
    00244     <b>Include:</b> automatically included with the image classes<br>
    00245     Namespace: vigra
    00246
    00247     These factories can be used to create argument objects when we
    00248     are given instances or subclasses of \ref vigra::BasicImage (see
    00249     \ref StandardImageTypes for instances defined per default).
    00250     These factory functions access <TT>img.upperLeft()</TT>,
    00251     <TT>img.lowerRight()</TT>, and <TT>img.accessor()</TT> to obtain the iterators
    00252     and accessor for the given image (unless the accessor is
    00253     given explicitly). The following factory functions are provided:
    00254
    00255     <table>
    00256     <tr><th bgcolor="#f0e0c0" colspan=2 align=left>
    00257         <TT>\ref vigra::BasicImage "vigra::BasicImage<SomeType>" img;</TT> or <br>
    00258          <TT>\ref vigra::BasicImageView "vigra::BasicImageView<SomeType>" img;</TT>
    00259         </th>
    00260     </tr>
    00261     <tr><td>
    00262
    00263     <TT>srcImageRange(img)</TT>
    00264     </td><td>
    00265         create argument object containing upper left, lower right, and
    00266         default accessor of source image
    00267
    00268     </td></tr>
    00269     <tr><td>
    00270
    00271     <TT>srcImageRange(img, Rect2D(...))</TT>
    00272     </td><td>
    00273         create argument object containing the ROI specified by <tt>\ref vigra::Rect2D</tt> and
    00274         default accessor of source image
    00275
    00276     </td></tr>
    00277     <tr><td>
    00278
    00279     <TT>srcImageRange(img, SomeAccessor())</TT>
    00280     </td><td>
    00281         create argument object containing upper left, lower right
    00282         of source image, and given accessor
    00283
    00284     </td></tr>
    00285     <tr><td>
    00286
    00287     <TT>srcImageRange(img, Rect2D(...), SomeAccessor())</TT>
    00288     </td><td>
    00289         create argument object containing the ROI specified by <tt>\ref vigra::Rect2D</tt> and
    00290         of source image, and given accessor
    00291
    00292     </td></tr>
    00293     <tr><td>
    00294
    00295     <TT>srcImage(img)</TT>
    00296     </td><td>
    00297         create argument object containing upper left, and
    00298         default accessor of source image
    00299
    00300     </td></tr>
    00301     <tr><td>
    00302
    00303     <TT>srcImage(img, Point2D(...))</TT>
    00304     </td><td>
    00305         create argument object with upper left at point given by <tt>\ref vigra::Point2D</tt>, and
    00306         default accessor of source image
    00307
    00308     </td></tr>
    00309     <tr><td>
    00310
    00311     <TT>srcImage(img, SomeAccessor())</TT>
    00312     </td><td>
    00313         create argument object containing upper left
    00314         of source image, and given accessor
    00315
    00316     </td></tr>
    00317     <tr><td>
    00318
    00319     <TT>srcImage(img, Point2D(...), SomeAccessor())</TT>
    00320     </td><td>
    00321         create argument object with upper left at point given by <tt>\ref vigra::Point2D</tt> of source image,
    00322         and given accessor
    00323
    00324     </td></tr>
    00325     <tr><td>
    00326
    00327     <TT>maskImage(img)</TT>
    00328     </td><td>
    00329         create argument object containing upper left, and
    00330         default accessor of mask image
    00331
    00332     </td></tr>
    00333      <tr><td>
    00334
    00335     <TT>maskImage(img, Point2D(...))</TT>
    00336     </td><td>
    00337         create argument object with upper left at point given by <tt>\ref vigra::Point2D</tt>, and
    00338         default accessor of mask image
    00339
    00340     </td></tr>
    00341    <tr><td>
    00342
    00343     <TT>maskImage(img, SomeAccessor())</TT>
    00344     </td><td>
    00345         create argument object containing upper left
    00346         of mask image, and given accessor
    00347
    00348     </td></tr>
    00349     <tr><td>
    00350
    00351     <TT>maskImage(img, Point2D(...), SomeAccessor())</TT>
    00352     </td><td>
    00353         create argument object with upper left at point given by <tt>\ref vigra::Point2D</tt> of mask image,
    00354         and given accessor
    00355
    00356     </td></tr>
    00357     <tr><td>
    00358
    00359     <TT>destImageRange(img)</TT>
    00360     </td><td>
    00361         create argument object containing upper left, lower right, and
    00362         default accessor of destination image
    00363
    00364     </td></tr>
    00365     <tr><td>
    00366
    00367     <TT>destImageRange(img, Rect2D(...))</TT>
    00368     </td><td>
    00369         create argument object containing the ROI specified by <tt>\ref vigra::Rect2D</tt> and
    00370         default accessor of destination image
    00371
    00372     </td></tr>
    00373     <tr><td>
    00374
    00375     <TT>destImageRange(img, SomeAccessor())</TT>
    00376     </td><td>
    00377         create argument object containing upper left, lower right
    00378         of destination image, and given accessor
    00379
    00380     </td></tr>
    00381     <tr><td>
    00382
    00383     <TT>destImageRange(img, Rect2D(...), SomeAccessor())</TT>
    00384     </td><td>
    00385         create argument object containing the ROI specified by <tt>\ref vigra::Rect2D</tt>
    00386         of destination image, and given accessor
    00387
    00388     </td></tr>
    00389      <tr><td>
    00390
    00391     <TT>destImage(img)</TT>
    00392     </td><td>
    00393         create argument object containing upper left, and
    00394         default accessor of destination image
    00395
    00396     </td></tr>
    00397      <tr><td>
    00398
    00399     <TT>destImage(img, Point2D(...))</TT>
    00400     </td><td>
    00401         create argument object with upper left at point given by <tt>\ref vigra::Point2D</tt>, and
    00402         default accessor of destination image
    00403
    00404     </td></tr>
    00405     <tr><td>
    00406
    00407     <TT>destImage(img, SomeAccessor())</TT>
    00408     </td><td>
    00409         create argument object containing upper left
    00410         of destination image, and given accessor
    00411
    00412     </td></tr>
    00413     <tr><td>
    00414
    00415     <TT>destImage(img, Point2D(...), SomeAccessor())</TT>
    00416     </td><td>
    00417         create argument object with upper left at point given by <tt>\ref vigra::Point2D</tt> of destination image,
    00418         and given accessor
    00419
    00420     </td></tr>
    00421     </table>
    00422
    00423
    00424   \section MultiArrayBasedArgumentObjectFactories MultiArrayView Based Argument Object Factories
    00425
    00426     <b>Include:</b> automatically included with
    00427        <<a href="multi__array_8hxx-source.html">vigra/multi_array.hxx</a>><br>
    00428     Namespace: vigra
    00429
    00430     These factories can be used to create argument objects when we
    00431     are given instances or subclasses of \ref vigra::MultiArrayView.
    00432     These factory functions access <TT>array.traverser_begin()</TT>,
    00433     <TT>array.traverser_end()</TT> to obtain the iterators. If no accessor is
    00434     given, they use the <tt>AccessorTraits<T></tt> to determine the default
    00435     accessor associated with the array's value type <tt>T</tt>.
    00436     The following factory functions are provided:
    00437
    00438     <table>
    00439     <tr><th bgcolor="#f0e0c0" colspan=2 align=left>
    00440         <TT>\ref vigra::MultiArrayView "vigra::MultiArrayView<N, SomeType>" array;</TT>
    00441         </th>
    00442     </tr>
    00443     <tr><td>
    00444
    00445     <TT>srcMultiArrayRange(img)</TT>
    00446     </td><td>
    00447         create argument object containing a \ref vigra::MultiIterator
    00448         marking the begin of the array, a shape object giving the desired
    00449         shape of the array (possibly a subarray) and the default const accessor for
    00450         <tt>SomeType</tt>
    00451
    00452     </td></tr>
    00453     <tr><td>
    00454
    00455     <TT>srcMultiArrayRange(img, SomeAccessor())</TT>
    00456     </td><td>
    00457         create argument object containing a \ref vigra::MultiIterator
    00458         marking the begin of the array, a shape object giving the desired
    00459         shape of the array (possibly a subarray) and the given accessor
    00460
    00461     </td></tr>
    00462     <tr><td>
    00463
    00464     <TT>srcMultiArray(img)</TT>
    00465     </td><td>
    00466         create argument object containing a \ref vigra::MultiIterator
    00467         marking the begin of the array, and the default const accessor for
    00468         <tt>SomeType</tt>
    00469
    00470     </td></tr>
    00471     <tr><td>
    00472
    00473     <TT>srcMultiArray(img, SomeAccessor())</TT>
    00474     </td><td>
    00475         create argument object containing a \ref vigra::MultiIterator
    00476         marking the begin of the array and the given accessor
    00477
    00478     </td></tr>
    00479     <tr><td>
    00480
    00481     <TT>destMultiArrayRange(img)</TT>
    00482     </td><td>
    00483         create argument object containing a \ref vigra::MultiIterator
    00484         marking the begin of the array, a shape object giving the desired
    00485         shape of the array (possibly a subarray) and the default accessor for
    00486         <tt>SomeType</tt>
    00487
    00488     </td></tr>
    00489     <tr><td>
    00490
    00491     <TT>destMultiArrayRange(img, SomeAccessor())</TT>
    00492     </td><td>
    00493         create argument object containing a \ref vigra::MultiIterator's
    00494         marking the begin of the array, a shape object giving the desired
    00495         shape of the array (possibly a subarray) and the given accessor
    00496
    00497     </td></tr>
    00498     <tr><td>
    00499
    00500     <TT>destMultiArray(img)</TT>
    00501     </td><td>
    00502         create argument object containing a \ref vigra::MultiIterator
    00503         marking the begin of the array and the default accessor for
    00504         <tt>SomeType</tt>
    00505
    00506     </td></tr>
    00507     <tr><td>
    00508
    00509     <TT>destMultiArray(img, SomeAccessor())</TT>
    00510     </td><td>
    00511         create argument object containing a \ref vigra::MultiIterator's
    00512         marking the begin of the array and the given accessor
    00513
    00514     </td></tr>
    00515     </table>
    00516
    00517
    00518   \section IteratorBasedArgumentObjectFactories Iterator Based Argument Object Factories
    00519
    00520     <b>\#include</b> <<a href="iteratortraits_8hxx-source.html">vigra/iteratortraits.hxx</a>>
    00521     Namespace: vigra
    00522
    00523     These factories can be used to create argument objects when we
    00524     are given \ref ImageIterators.
    00525     These factory functions use \ref vigra::IteratorTraits to
    00526     get the default accessor for the given iterator unless the
    00527     accessor is given explicitly. The following factory functions
    00528     are provided:
    00529
    00530     <table>
    00531     <tr><th bgcolor="#f0e0c0" colspan=2 align=left>
    00532         <TT>\ref vigra::BasicImage::Iterator "vigra::BasicImage<SomeType>::Iterator" i1, i2;</TT>
    00533         </th>
    00534     </tr>
    00535     <tr><td>
    00536
    00537     <TT>srcIterRange(i1, i2)</TT>
    00538     </td><td>
    00539         create argument object containing the given iterators and
    00540         corresponding default accessor (for source image)
    00541
    00542     </td></tr>
    00543     <tr><td>
    00544
    00545     <TT>srcIterRange(i1, i2, SomeAccessor())</TT>
    00546     </td><td>
    00547         create argument object containing given iterators and
    00548         accessor (for source image)
    00549
    00550     </td></tr>
    00551     <tr><td>
    00552
    00553     <TT>srcIter(i1)</TT>
    00554     </td><td>
    00555         create argument object containing the given iterator and
    00556         corresponding default accessor (for source image)
    00557
    00558     </td></tr>
    00559     <tr><td>
    00560
    00561     <TT>srcIter(i1, SomeAccessor())</TT>
    00562     </td><td>
    00563         create argument object containing given iterator and
    00564         accessor (for source image)
    00565
    00566     </td></tr>
    00567     <tr><td>
    00568
    00569     <TT>maskIter(i1)</TT>
    00570     </td><td>
    00571         create argument object containing the given iterator and
    00572         corresponding default accessor (for mask image)
    00573
    00574     </td></tr>
    00575     <tr><td>
    00576
    00577     <TT>maskIter(i1, SomeAccessor())</TT>
    00578     </td><td>
    00579         create argument object containing given iterator and
    00580         accessor (for mask image)
    00581
    00582     </td></tr>
    00583     <tr><td>
    00584
    00585     <TT>destIterRange(i1, i2)</TT>
    00586     </td><td>
    00587         create argument object containing the given iterators and
    00588         corresponding default accessor (for destination image)
    00589
    00590     </td></tr>
    00591     <tr><td>
    00592
    00593     <TT>destIterRange(i1, i2, SomeAccessor())</TT>
    00594     </td><td>
    00595         create argument object containing given iterators and
    00596         accessor (for destination image)
    00597
    00598     </td></tr>
    00599     <tr><td>
    00600
    00601     <TT>destIter(i1)</TT>
    00602     </td><td>
    00603         create argument object containing the given iterator and
    00604         corresponding default accessor (for destination image)
    00605
    00606     </td></tr>
    00607     <tr><td>
    00608
    00609     <TT>destIter(i1, SomeAccessor())</TT>
    00610     </td><td>
    00611         create argument object containing given iterator and
    00612         accessor (for destination image)
    00613
    00614     </td></tr>
    00615     </table>
    00616 */
    00617
    00618 template <class Iterator, class Accessor>
    00619 inline triple<Iterator, Iterator, Accessor>
    00620 srcIterRange(Iterator const & upperleft, Iterator const & lowerright, Accessor a)
    00621 {
    00622     return triple<Iterator, Iterator, Accessor>(upperleft, lowerright, a);
    00623 }
    00624
    00625 template <class Iterator, class Accessor>
    00626 inline pair<Iterator, Accessor>
    00627 srcIter(Iterator const & upperleft, Accessor a)
    00628 {
    00629     return pair<Iterator, Accessor>(upperleft, a);
    00630 }
    00631
    00632 template <class Iterator, class Accessor>
    00633 inline pair<Iterator, Accessor>
    00634 maskIter(Iterator const & upperleft, Accessor a)
    00635 {
    00636     return pair<Iterator, Accessor>(upperleft, a);
    00637 }
    00638
    00639 template <class Iterator, class Accessor>
    00640 inline pair<Iterator, Accessor>
    00641 destIter(Iterator const & upperleft, Accessor a)
    00642 {
    00643     return pair<Iterator, Accessor>(upperleft, a);
    00644 }
    00645
    00646
    00647 template <class Iterator, class Accessor>
    00648 inline triple<Iterator, Iterator, Accessor>
    00649 destIterRange(Iterator const & upperleft, Iterator const & lowerright, Accessor a)
    00650 {
    00651     return triple<Iterator, Iterator, Accessor>(upperleft, lowerright, a);
    00652 }
    00653
    00654 template <class Iterator>
    00655 inline pair<Iterator, typename IteratorTraits<Iterator>::DefaultAccessor>
    00656 srcIter(Iterator const & upperleft)
    00657 {
    00658     return pair<Iterator, typename IteratorTraits<Iterator>::DefaultAccessor>(
    00659                   upperleft,
    00660                   typename IteratorTraits<Iterator>::DefaultAccessor());
    00661 }
    00662
    00663 template <class Iterator>
    00664 inline triple<Iterator, Iterator, typename IteratorTraits<Iterator>::DefaultAccessor>
    00665 srcIterRange(Iterator const & upperleft, Iterator const & lowerright)
    00666 {
    00667     return triple<Iterator, Iterator,
    00668                   typename IteratorTraits<Iterator>::DefaultAccessor>(
    00669                   upperleft, lowerright,
    00670                   typename IteratorTraits<Iterator>::DefaultAccessor());
    00671 }
    00672
    00673 template <class Iterator>
    00674 inline pair<Iterator, typename IteratorTraits<Iterator>::DefaultAccessor>
    00675 maskIter(Iterator const & upperleft)
    00676 {
    00677     return pair<Iterator, typename IteratorTraits<Iterator>::DefaultAccessor>(
    00678                   upperleft,
    00679                   typename IteratorTraits<Iterator>::DefaultAccessor());
    00680 }
    00681
    00682 template <class Iterator>
    00683 inline pair<Iterator, typename IteratorTraits<Iterator>::DefaultAccessor>
    00684 destIter(Iterator const & upperleft)
    00685 {
    00686     return pair<Iterator, typename IteratorTraits<Iterator>::DefaultAccessor>(
    00687                   upperleft,
    00688                   typename IteratorTraits<Iterator>::DefaultAccessor());
    00689 }
    00690
    00691 template <class Iterator>
    00692 inline triple<Iterator, Iterator, typename IteratorTraits<Iterator>::DefaultAccessor>
    00693 destIterRange(Iterator const & upperleft, Iterator const & lowerright)
    00694 {
    00695     return triple<Iterator, Iterator,
    00696                   typename IteratorTraits<Iterator>::DefaultAccessor>(
    00697                   upperleft, lowerright,
    00698                   typename IteratorTraits<Iterator>::DefaultAccessor());
    00699 }
    00700
    00701 } // namespace vigra
    00702
    00703 #endif // VIGRA_ITERATORTRAITS_HXX

© 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.6.0 (13 Aug 2008)