Public Types | Protected Member Functions | Related Functions

mln::Point_Site< E > Struct Template Reference

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

#include <point_site.hh>

Inheritance diagram for mln::Point_Site< E >:
Inheritance graph

List of all members.

Public Types

typedef Point_Site< void > category
typedef E exact_t

Protected Member Functions

 Point_Site ()

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)
 Difference between a couple of point site lhs and rhs.
template<typename P >
std::ostream & operator<< (std::ostream &ostr, const Point_Site< P > &p)
 Print a point site p into the output stream ostr.
template<typename L , typename R >
bool operator== (const Point_Site< L > &lhs, const Point_Site< R > &rhs)
 Equality comparison between a couple of point site lhs and rhs.

template<typename P , typename D >
P::point operator+ (const Point_Site< P > &p, const Delta_Point_Site< D > &dp)
 Add a delta-point rhs to a point site lhs.
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 106 of file point_site.hh.


Member Typedef Documentation

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

Reimplemented from mln::Object< E >.

Definition at line 108 of file point_site.hh.

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

Definition at line 173 of file object.hh.


Constructor & Destructor Documentation

template<typename E >
mln::Point_Site< E >::Point_Site (  )  [inline, protected]

Definition at line 229 of file point_site.hh.


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] p A point site.
[in] dp A 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

Definition at line 282 of file point_site.hh.

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] p A point site.
[in] dp A 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

Definition at line 296 of file point_site.hh.

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] lhs A first point site.
[in] rhs A 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 also:
mln::Delta_Point_Site

Definition at line 267 of file point_site.hh.

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] ostr An output stream.
[in] p A point site.
Returns:
The modified output stream ostr.

Definition at line 311 of file point_site.hh.

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] lhs A first point site.
[in] rhs A 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.

Definition at line 251 of file point_site.hh.