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