$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mln::Point_Site< E > Struct Template Reference

#include <mln/core/concept/point_site.hh>

Protected Member Functions

 Point_Site ()

Public Types

typedef Point_Site< void > category
typedef E exact_t

Related Functions

(Note that these are not member functions.)

template<typename L , typename R >
L::dpoint operator- (const Point_Site< L > &lhs, const Point_Site< R > &rhs)
template<typename P >
std::ostream & operator<< (std::ostream &ostr, const Point_Site< P > &p)
template<typename L , typename R >
bool operator== (const Point_Site< L > &lhs, const Point_Site< R > &rhs)
template<typename P , typename D >
P::point operator+ (const Point_Site< P > &p, const Delta_Point_Site< D > &dp)
template<typename P , typename D >
P::point operator- (const Point_Site< P > &p, const Delta_Point_Site< D > &dp)

Detailed Description

template<typename E>
struct mln::Point_Site< E >

Base class for implementation classes of the notion of "point site".

A point site ("psite" for short) is an object that allows an efficient access to data associated with a point. A point site is either a point or designates a point.

When a point site is not really a point, it is automatically convertible to the point it designates.

Let us take the example of a 2D image encoded as an array of runs of values. With a point, a pair (row index, column index), retrieving the corresponding pixel value would mean to browse the array of runs to find the value location. That would not be efficient. Conversely, a point site dedicated to this image structure allows for value access in contant time; precisely the proper point site is a pair (index of run, index within the run).

Definition at line 111 of file point_site.hh.

Constructor & Destructor Documentation

template<typename E>
mln::Point_Site< E >::Point_Site ( )
protected

Friends And Related Function Documentation

template<typename P , typename D >
P::point operator+ ( const Point_Site< P > &  p,
const Delta_Point_Site< D > &  dp 
)
related

Add a delta-point rhs to a point site lhs.

Parameters
[in]pA point site.
[in]dpA delta-point.

The type of dp has to compatible with the type of p.

Returns
A point (temporary object).
See Also
mln::Delta_Point_Site
template<typename L , typename R >
L::dpoint operator- ( const Point_Site< L > &  lhs,
const Point_Site< R > &  rhs 
)
related

Difference between a couple of point site lhs and rhs.

Parameters
[in]lhsA first point site.
[in]rhsA second point site.
Warning
There is no type promotion in Milena so the client has to make sure that both points are defined with the same type of coordinates.
Precondition
Both lhs and rhs have to be defined on the same topology and with the same type of coordinates; otherwise this test does not compile.
Postcondition
The result, dp, is such as lhs == rhs + dp.
Returns
A delta point (temporary object).
\see mln::Delta_Point_Site
template<typename P , typename D >
P::point operator- ( const Point_Site< P > &  p,
const Delta_Point_Site< D > &  dp 
)
related

}

Substract a delta-point dp to a point site p.

Parameters
[in]pA point site.
[in]dpA delta-point.

The type of dp has to compatible with the type of p.

Returns
A point (temporary object).
See Also
mln::Dpoint
mln::Delta_Point_Site
template<typename P >
std::ostream & operator<< ( std::ostream &  ostr,
const Point_Site< P > &  p 
)
related

Print a point site p into the output stream ostr.

Parameters
[in,out]ostrAn output stream.
[in]pA point site.
Returns
The modified output stream ostr.
template<typename L , typename R >
bool operator== ( const Point_Site< L > &  lhs,
const Point_Site< R > &  rhs 
)
related

Equality comparison between a couple of point site lhs and rhs.

Parameters
[in]lhsA first point site.
[in]rhsA second point site.
Precondition
Both lhs and rhs have to be defined on the same topology; otherwise this test does not compile.
Returns
True if both point sites have the same coordinates, otherwise false.

Member Typedef Documentation

template<typename E>
typedef Point_Site<void> mln::Point_Site< E >::category

Definition at line 113 of file point_site.hh.

template<typename E>
typedef E mln::Object< E >::exact_t
inherited

Definition at line 105 of file object.hh.