oln::utils::internal::cmp_pt_value< I > Struct Template Reference

Functor to sort compare 2 points using an image. More...

#include <qsort.hh>

Collaboration diagram for oln::utils::internal::cmp_pt_value< I >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef oln::abstract::non_vectorial_image<
I > 
im_type
 Type of the image.
typedef mlc::exact< I >::ret::point_type point_type
 Type of the considered points.

Public Member Functions

 cmp_pt_value (const im_type &im)
 Constructor.
bool operator() (const point_type &i, const point_type &j)
 Main method.

Protected Attributes

const im_typeim_
 Image to use for comparison.

Detailed Description

template<typename I>
struct oln::utils::internal::cmp_pt_value< I >

Functor to sort compare 2 points using an image.

Parameters:
I Exact type of the image.

Definition at line 48 of file qsort.hh.


Constructor & Destructor Documentation

template<typename I>
oln::utils::internal::cmp_pt_value< I >::cmp_pt_value ( const im_type im  )  [inline]

Constructor.

Definition at line 58 of file qsort.hh.

00058                                        : im_(im)
00059         {
00060         }


Member Function Documentation

template<typename I>
bool oln::utils::internal::cmp_pt_value< I >::operator() ( const point_type i,
const point_type j 
) [inline]

Main method.

Definition at line 72 of file qsort.hh.

References oln::utils::internal::cmp_pt_value< I >::im_.

00073         {
00074           if (im_[i] == im_[j])
00075             for (unsigned t(0); t < point_type::dim; ++t)
00076               if (i.nth(t) != j.nth(t))
00077                 return i.nth(t) < j.nth(t);
00078           return im_[j] > im_[i];
00079         }


The documentation for this struct was generated from the following file:
Generated on Tue Feb 20 20:30:09 2007 for Olena by  doxygen 1.5.1