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

details vigra/iteratortraits.hxx VIGRA

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.5.0, Dec 07 2006 )                                    */
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 /*        koethe@informatik.uni-hamburg.de          or                  */
00012 /*        vigra@kogs1.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 StandardAccessor<value_type>          DefaultAccessor;
00069         typedef StandardAccessor<value_type>          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> ot <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&lt;int&gt;::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 /** \page ArgumentObjectFactories Argument Object Factories
00148 
00149     Factory functions to create argument objects which simplify long argument lists.
00150 
00151     <DL>
00152     <DT>
00153         <IMG BORDER=0 ALT="-" SRC="documents/bullet.gif">
00154         \ref ImageBasedArgumentObjectFactories
00155         <DD>
00156     <DT>
00157         <IMG BORDER=0 ALT="-" SRC="documents/bullet.gif">
00158         \ref MultiArrayBasedArgumentObjectFactories
00159         <DD>
00160     <DT>
00161         <IMG BORDER=0 ALT="-" SRC="documents/bullet.gif">
00162         \ref IteratorBasedArgumentObjectFactories
00163         <DD>
00164     </DL>
00165 
00166     Long argument lists provide for greater flexibility of functions,
00167     but they are also tedious and error prone, when we don't need
00168     the flexibility. Thus, we define argument objects which
00169     automatically provide reasonable defaults for those arguments that we
00170     didn't specify explicitly.
00171 
00172     The argument objects are created via a number of factory functions.
00173     Since these functions have descriptive names, they also serve
00174     to improve readability: the name of each factory tells te purpose of its
00175     argument object.
00176 
00177     Consider the following example. Without argument objects we had to
00178     write something like this (cf. \ref copyImageIf()):
00179 
00180     \code
00181     vigra::BImage img1, img2, img3;
00182 
00183     // fill img1 and img2 ...
00184 
00185     vigra::copyImageIf(img1.upperLeft(), img1.lowerRight(), img1.accessor(),
00186                 img2.upperLeft(), img2.accessor(),
00187                 img3.upperLeft(), img3.accessor());
00188     \endcode
00189 
00190     Using the argument object factories, this becomes much shorter and
00191     more readable:
00192 
00193     \code
00194     vigra::copyImageIf(srcImageRange(img1),
00195                 maskImage(img2),
00196                 destImage(img3));
00197     \endcode
00198 
00199     The names of the factories clearly tell which image is source, mask,
00200     and destination. In addition, the suffix <TT>Range</TT> must be used
00201     for those argument objects that need to specify the lower right
00202     corner of the region of interest. Typically, this is only the first
00203     source argument, but sometimes the first destiniation argument must
00204     also contain a range.
00205 
00206     The factory functions come in two flavours: Iterator based and
00207     image based factories. Above we have seen the image based variant.
00208     The iterator based variant would look like this:
00209 
00210     \code
00211     vigra::copyImageIf(srcIterRange(img1.upperLeft(), img1.lowerRight()),
00212                 maskIter(img2.upperLeft()),
00213                 destIter(img3.upperLeft()));
00214     \endcode
00215 
00216     These factory functions contain the word <TT>Iter</TT> instead of the word
00217     <TT>Image</TT>,  They would normally be used if we couldn't access the
00218     images (for example, within a function which got passed iterators)
00219     or if we didn't want to operate on the entire image. The default
00220     accessor is obtained via \ref vigra::IteratorTraits.
00221 
00222     All factory functions also allow to specify accessors explicitly. This
00223     is useful if we can't use the default accessor. This variant looks
00224     like this:
00225 
00226     \code
00227     vigra::copyImageIf(srcImageRange(img1),
00228                 maskImage(img2, MaskPredicateAccessor()),
00229                 destImage(img3));
00230     \endcode
00231 
00232     or
00233 
00234     \code
00235     vigra::copyImageIf(srcIterRange(img1.upperLeft(), img1.lowerRight()),
00236                 maskIter(img2.upperLeft(), MaskPredicateAccessor()),
00237                 destIter(img3.upperLeft()));
00238     \endcode
00239 
00240     All versions can be mixed freely within one explession.
00241     Technically, the argument objects are simply defined as
00242     pairs and triples of iterators and accessor so that all algorithms
00243     should declare a call interface version based on pairs and triples
00244     (see for example \ref copyImageIf()).
00245 
00246   \section ImageBasedArgumentObjectFactories Image Based Argument Object Factories
00247 
00248     <b>Include:</b> automatically included with the image classes<br>
00249     Namespace: vigra
00250 
00251     These factories can be used to create argument objects when we
00252     are given instances or subclasses of \ref vigra::BasicImage (see
00253     \ref StandardImageTypes for instances defined per default).
00254     These factory functions access <TT>img.upperLeft()</TT>,
00255     <TT>img.lowerRight()</TT>, and <TT>img.accessor()</TT> to obtain the iterators
00256     and accessor for the given image (unless the accessor is
00257     given explicitly). The following factory functions are provided:
00258 
00259     <table>
00260     <tr><td>
00261         \htmlonly
00262         <th bgcolor="#f0e0c0" colspan=2 align=left>
00263         \endhtmlonly
00264         <TT>\ref vigra::BasicImage "vigra::BasicImage<SomeType>" img;</TT> or <br>
00265          <TT>\ref vigra::BasicImageView "vigra::BasicImageView<SomeType>" img;</TT>
00266          \htmlonly
00267         </th>
00268         \endhtmlonly
00269     </td></tr>
00270     <tr><td>
00271 
00272     <TT>srcImageRange(img)</TT>
00273     </td><td>
00274         create argument object containing upper left, lower right, and
00275         default accessor of source image
00276 
00277     </td></tr>
00278     <tr><td>
00279 
00280     <TT>srcImageRange(img, Rect2D(...))</TT>
00281     </td><td>
00282         create argument object containing the ROI specified by <tt>\ref vigra::Rect2D</tt> and
00283         default accessor of source image
00284 
00285     </td></tr>
00286     <tr><td>
00287 
00288     <TT>srcImageRange(img, SomeAccessor())</TT>
00289     </td><td>
00290         create argument object containing upper left, lower right
00291         of source image, and given accessor
00292 
00293     </td></tr>
00294     <tr><td>
00295 
00296     <TT>srcImageRange(img, Rect2D(...), SomeAccessor())</TT>
00297     </td><td>
00298         create argument object containing the ROI specified by <tt>\ref vigra::Rect2D</tt> and
00299         of source image, and given accessor
00300 
00301     </td></tr>
00302     <tr><td>
00303 
00304     <TT>srcImage(img)</TT>
00305     </td><td>
00306         create argument object containing upper left, and
00307         default accessor of source image
00308 
00309     </td></tr>
00310     <tr><td>
00311 
00312     <TT>srcImage(img, Point2D(...))</TT>
00313     </td><td>
00314         create argument object with upper left at point given by <tt>\ref vigra::Point2D</tt>, and
00315         default accessor of source image
00316 
00317     </td></tr>
00318     <tr><td>
00319 
00320     <TT>srcImage(img, SomeAccessor())</TT>
00321     </td><td>
00322         create argument object containing upper left
00323         of source image, and given accessor
00324 
00325     </td></tr>
00326     <tr><td>
00327 
00328     <TT>srcImage(img, Point2D(...), SomeAccessor())</TT>
00329     </td><td>
00330         create argument object with upper left at point given by <tt>\ref vigra::Point2D</tt> of source image,
00331         and given accessor
00332 
00333     </td></tr>
00334     <tr><td>
00335 
00336     <TT>maskImage(img)</TT>
00337     </td><td>
00338         create argument object containing upper left, and
00339         default accessor of mask image
00340 
00341     </td></tr>
00342      <tr><td>
00343 
00344     <TT>maskImage(img, Point2D(...))</TT>
00345     </td><td>
00346         create argument object with upper left at point given by <tt>\ref vigra::Point2D</tt>, and
00347         default accessor of mask image
00348 
00349     </td></tr>
00350    <tr><td>
00351 
00352     <TT>maskImage(img, SomeAccessor())</TT>
00353     </td><td>
00354         create argument object containing upper left
00355         of mask image, and given accessor
00356 
00357     </td></tr>
00358     <tr><td>
00359 
00360     <TT>maskImage(img, Point2D(...), SomeAccessor())</TT>
00361     </td><td>
00362         create argument object with upper left at point given by <tt>\ref vigra::Point2D</tt> of mask image,
00363         and given accessor
00364 
00365     </td></tr>
00366     <tr><td>
00367 
00368     <TT>destImageRange(img)</TT>
00369     </td><td>
00370         create argument object containing upper left, lower right, and
00371         default accessor of destination image
00372 
00373     </td></tr>
00374     <tr><td>
00375 
00376     <TT>destImageRange(img, Rect2D(...))</TT>
00377     </td><td>
00378         create argument object containing the ROI specified by <tt>\ref vigra::Rect2D</tt> and
00379         default accessor of destination image
00380 
00381     </td></tr>
00382     <tr><td>
00383 
00384     <TT>destImageRange(img, SomeAccessor())</TT>
00385     </td><td>
00386         create argument object containing upper left, lower right
00387         of destination image, and given accessor
00388 
00389     </td></tr>
00390     <tr><td>
00391 
00392     <TT>destImageRange(img, Rect2D(...), SomeAccessor())</TT>
00393     </td><td>
00394         create argument object containing the ROI specified by <tt>\ref vigra::Rect2D</tt>
00395         of destination image, and given accessor
00396 
00397     </td></tr>
00398      <tr><td>
00399 
00400     <TT>destImage(img)</TT>
00401     </td><td>
00402         create argument object containing upper left, and
00403         default accessor of destination image
00404 
00405     </td></tr>
00406      <tr><td>
00407 
00408     <TT>destImage(img, Point2D(...))</TT>
00409     </td><td>
00410         create argument object with upper left at point given by <tt>\ref vigra::Point2D</tt>, and
00411         default accessor of destination image
00412 
00413     </td></tr>
00414     <tr><td>
00415 
00416     <TT>destImage(img, SomeAccessor())</TT>
00417     </td><td>
00418         create argument object containing upper left
00419         of destination image, and given accessor
00420 
00421     </td></tr>
00422     <tr><td>
00423 
00424     <TT>destImage(img, Point2D(...), SomeAccessor())</TT>
00425     </td><td>
00426         create argument object with upper left at point given by <tt>\ref vigra::Point2D</tt> of destination image,
00427         and given accessor
00428 
00429     </td></tr>
00430     </table>
00431 
00432 
00433   \section MultiArrayBasedArgumentObjectFactories MultiArrayView Based Argument Object Factories
00434 
00435     <b>Include:</b> automatically included with 
00436        "<a href="multi__array_8hxx-source.html">vigra/multi_array.hxx</a>"<br>
00437     Namespace: vigra
00438 
00439     These factories can be used to create argument objects when we
00440     are given instances or subclasses of \ref vigra::MultiArrayView.
00441     These factory functions access <TT>array.traverser_begin()</TT>,
00442     <TT>array.traverser_end()</TT> to obtain the iterators. If no accessor is
00443     given, they use the <tt>AccessorTraits<T></tt> to determine the default 
00444     accessor associated with the array's value type <tt>T</tt>.
00445     The following factory functions are provided:
00446 
00447     <table>
00448     <tr><td>
00449         \htmlonly
00450         <th bgcolor="#f0e0c0" colspan=2 align=left>
00451         \endhtmlonly
00452         <TT>\ref vigra::MultiArrayView "vigra::MultiArrayView<N, SomeType>" array;</TT>
00453         \htmlonly
00454         </th>
00455         \endhtmlonly
00456     </td></tr>
00457     <tr><td>
00458 
00459     <TT>srcMultiArrayRange(img)</TT>
00460     </td><td>
00461         create argument object containing a \ref vigra::MultiIterator 
00462         marking the begin of the array, a shape object giving the desired
00463         shape of the array (possibly a subarray) and the default const accessor for
00464         <tt>SomeType</tt>
00465 
00466     </td></tr>
00467     <tr><td>
00468 
00469     <TT>srcMultiArrayRange(img, SomeAccessor())</TT>
00470     </td><td>
00471         create argument object containing a \ref vigra::MultiIterator 
00472         marking the begin of the array, a shape object giving the desired
00473         shape of the array (possibly a subarray) and the given accessor
00474 
00475     </td></tr>
00476     <tr><td>
00477 
00478     <TT>srcMultiArray(img)</TT>
00479     </td><td>
00480         create argument object containing a \ref vigra::MultiIterator
00481         marking the begin of the array, and the default const accessor for
00482         <tt>SomeType</tt>
00483 
00484     </td></tr>
00485     <tr><td>
00486 
00487     <TT>srcMultiArray(img, SomeAccessor())</TT>
00488     </td><td>
00489         create argument object containing a \ref vigra::MultiIterator 
00490         marking the begin of the array and the given accessor
00491 
00492     </td></tr>
00493     <tr><td>
00494 
00495     <TT>destMultiArrayRange(img)</TT>
00496     </td><td>
00497         create argument object containing a \ref vigra::MultiIterator 
00498         marking the begin of the array, a shape object giving the desired
00499         shape of the array (possibly a subarray) and the default accessor for
00500         <tt>SomeType</tt>
00501 
00502     </td></tr>
00503     <tr><td>
00504 
00505     <TT>destMultiArrayRange(img, SomeAccessor())</TT>
00506     </td><td>
00507         create argument object containing a \ref vigra::MultiIterator's 
00508         marking the begin of the array, a shape object giving the desired
00509         shape of the array (possibly a subarray) and the given accessor
00510 
00511     </td></tr>
00512     <tr><td>
00513 
00514     <TT>destMultiArray(img)</TT>
00515     </td><td>
00516         create argument object containing a \ref vigra::MultiIterator 
00517         marking the begin of the array and the default accessor for
00518         <tt>SomeType</tt>
00519 
00520     </td></tr>
00521     <tr><td>
00522 
00523     <TT>destMultiArray(img, SomeAccessor())</TT>
00524     </td><td>
00525         create argument object containing a \ref vigra::MultiIterator's 
00526         marking the begin of the array and the given accessor
00527 
00528     </td></tr>
00529     </table>
00530 
00531 
00532   \section IteratorBasedArgumentObjectFactories Iterator Based Argument Object Factories
00533 
00534     <b>\#include</b> "<a href="iteratortraits_8hxx-source.html">vigra/iteratortraits.hxx</a>"
00535     Namespace: vigra
00536 
00537     These factories can be used to create argument objects when we
00538     are given \ref ImageIterators.
00539     These factory functions use \ref vigra::IteratorTraits to
00540     get the default accessor for the given iterator unless the
00541     accessor is given explicitly. The following factory functions
00542     are provided:
00543 
00544     <table>
00545     <tr><td>
00546         \htmlonly
00547         <th bgcolor="#f0e0c0" colspan=2 align=left>
00548         \endhtmlonly
00549         <TT>\ref vigra::BasicImage::Iterator "vigra::BasicImage<SomeType>::Iterator" i1, i2;</TT>
00550         \htmlonly
00551         </th>
00552         \endhtmlonly
00553     </td></tr>
00554     <tr><td>
00555 
00556     <TT>srcIterRange(i1, i2)</TT>
00557     </td><td>
00558         create argument object containing the given iterators and
00559         corresponding default accessor (for source image)
00560 
00561     </td></tr>
00562     <tr><td>
00563 
00564     <TT>srcIterRange(i1, i2, SomeAccessor())</TT>
00565     </td><td>
00566         create argument object containing given iterators and
00567         accessor (for source image)
00568 
00569     </td></tr>
00570     <tr><td>
00571 
00572     <TT>srcIter(i1)</TT>
00573     </td><td>
00574         create argument object containing the given iterator and
00575         corresponding default accessor (for source image)
00576 
00577     </td></tr>
00578     <tr><td>
00579 
00580     <TT>srcIter(i1, SomeAccessor())</TT>
00581     </td><td>
00582         create argument object containing given iterator and
00583         accessor (for source image)
00584 
00585     </td></tr>
00586     <tr><td>
00587 
00588     <TT>maskIter(i1)</TT>
00589     </td><td>
00590         create argument object containing the given iterator and
00591         corresponding default accessor (for mask image)
00592 
00593     </td></tr>
00594     <tr><td>
00595 
00596     <TT>maskIter(i1, SomeAccessor())</TT>
00597     </td><td>
00598         create argument object containing given iterator and
00599         accessor (for mask image)
00600 
00601     </td></tr>
00602     <tr><td>
00603 
00604     <TT>destIterRange(i1, i2)</TT>
00605     </td><td>
00606         create argument object containing the given iterators and
00607         corresponding default accessor (for destination image)
00608 
00609     </td></tr>
00610     <tr><td>
00611 
00612     <TT>destIterRange(i1, i2, SomeAccessor())</TT>
00613     </td><td>
00614         create argument object containing given iterators and
00615         accessor (for destination image)
00616 
00617     </td></tr>
00618     <tr><td>
00619 
00620     <TT>destIter(i1)</TT>
00621     </td><td>
00622         create argument object containing the given iterator and
00623         corresponding default accessor (for destination image)
00624 
00625     </td></tr>
00626     <tr><td>
00627 
00628     <TT>destIter(i1, SomeAccessor())</TT>
00629     </td><td>
00630         create argument object containing given iterator and
00631         accessor (for destination image)
00632 
00633     </td></tr>
00634     </table>
00635 */
00636 
00637 template <class Iterator, class Accessor>
00638 inline triple<Iterator, Iterator, Accessor>
00639 srcIterRange(Iterator const & upperleft, Iterator const & lowerright, Accessor a)
00640 {
00641     return triple<Iterator, Iterator, Accessor>(upperleft, lowerright, a);
00642 }
00643 
00644 template <class Iterator, class Accessor>
00645 inline pair<Iterator, Accessor>
00646 srcIter(Iterator const & upperleft, Accessor a)
00647 {
00648     return pair<Iterator, Accessor>(upperleft, a);
00649 }
00650 
00651 template <class Iterator, class Accessor>
00652 inline pair<Iterator, Accessor>
00653 maskIter(Iterator const & upperleft, Accessor a)
00654 {
00655     return pair<Iterator, Accessor>(upperleft, a);
00656 }
00657 
00658 template <class Iterator, class Accessor>
00659 inline pair<Iterator, Accessor>
00660 destIter(Iterator const & upperleft, Accessor a)
00661 {
00662     return pair<Iterator, Accessor>(upperleft, a);
00663 }
00664 
00665 
00666 template <class Iterator, class Accessor>
00667 inline triple<Iterator, Iterator, Accessor>
00668 destIterRange(Iterator const & upperleft, Iterator const & lowerright, Accessor a)
00669 {
00670     return triple<Iterator, Iterator, Accessor>(upperleft, lowerright, a);
00671 }
00672 
00673 template <class Iterator>
00674 inline pair<Iterator, typename IteratorTraits<Iterator>::DefaultAccessor>
00675 srcIter(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 triple<Iterator, Iterator, typename IteratorTraits<Iterator>::DefaultAccessor>
00684 srcIterRange(Iterator const & upperleft, Iterator const & lowerright)
00685 {
00686     return triple<Iterator, Iterator,
00687                   typename IteratorTraits<Iterator>::DefaultAccessor>(
00688                   upperleft, lowerright,
00689                   typename IteratorTraits<Iterator>::DefaultAccessor());
00690 }
00691 
00692 template <class Iterator>
00693 inline pair<Iterator, typename IteratorTraits<Iterator>::DefaultAccessor>
00694 maskIter(Iterator const & upperleft)
00695 {
00696     return pair<Iterator, typename IteratorTraits<Iterator>::DefaultAccessor>(
00697                   upperleft,
00698                   typename IteratorTraits<Iterator>::DefaultAccessor());
00699 }
00700 
00701 template <class Iterator>
00702 inline pair<Iterator, typename IteratorTraits<Iterator>::DefaultAccessor>
00703 destIter(Iterator const & upperleft)
00704 {
00705     return pair<Iterator, typename IteratorTraits<Iterator>::DefaultAccessor>(
00706                   upperleft,
00707                   typename IteratorTraits<Iterator>::DefaultAccessor());
00708 }
00709 
00710 template <class Iterator>
00711 inline triple<Iterator, Iterator, typename IteratorTraits<Iterator>::DefaultAccessor>
00712 destIterRange(Iterator const & upperleft, Iterator const & lowerright)
00713 {
00714     return triple<Iterator, Iterator,
00715                   typename IteratorTraits<Iterator>::DefaultAccessor>(
00716                   upperleft, lowerright,
00717                   typename IteratorTraits<Iterator>::DefaultAccessor());
00718 }
00719 
00720 //@}
00721 
00722 } // namespace vigra
00723 
00724 #endif // VIGRA_ITERATORTRAITS_HXX

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

html generated using doxygen and Python
VIGRA 1.5.0 (7 Dec 2006)