$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mln::window2d Class Reference

#include <mln/core/alias/window2d.hh>

Public Member Functions

void clear ()
unsigned delta () const
const mln::dpoint2ddp (unsigned i) const
const mln::util::set
< mln::dpoint2d > & 
dps_hook_ () const
bool has (const mln::dpoint2d &dp) const
window< mln::dpoint2d > & insert (const mln::dpoint2d &dp)
window< mln::dpoint2d > & insert (const Window< W > &win)
bool is_centered () const
bool is_empty () const
bool is_symmetric () const
bool is_valid () const
void print (std::ostream &ostr) const
unsigned size () const
const std::vector
< mln::dpoint2d > & 
std_vector () const
void sym ()
window< mln::dpoint2d > & insert (const typename mln::dpoint2d::coord &dind)
window< mln::dpoint2d > & insert (const typename mln::dpoint2d::coord &drow, const typename mln::dpoint2d::coord &dcol)
window< mln::dpoint2d > & insert (const typename mln::dpoint2d::coord &dsli, const typename mln::dpoint2d::coord &drow, const typename mln::dpoint2d::coord &dcol)

Public Types

typedef dpsites_bkd_piter
< window< mln::dpoint2d > > 
bkd_qiter
typedef Window< void > category
typedef psite center_t
typedef mln::dpoint2d dpsite
typedef window< mln::dpoint2dexact_t
typedef dpsites_fwd_piter
< window< mln::dpoint2d > > 
fwd_qiter
typedef mln::dpoint2d::psite psite
typedef fwd_qiter qiter
typedef window< mln::dpoint2dregular
typedef mln::dpoint2d::site site

Detailed Description

Type alias for a window with arbitrary shape, defined on the 2D square grid with integer coordinates.

Common 2D windows are predefined and can be used directly: win_c4p(), win_c8p(). See section 2D windows.

The list of dpoint2d included in a window2d is accessible from std_vector() method or simply by iterating over this list:

window2d win = win_c4p();
for (int i = 0; i < win.size(); ++i)
std::cout << win.dp(i) << std::endl;

Iterating over the neighbors of a specific point is performed thanks to q-iterators, as follows:

point2d p(2,2);
window2d win = win_c4p();
mln_qiter(window2d) q(win, p);
for_all(q)
// q is a point2d, neighbor of p.
std::cout << q << std::endl;

It also works while iterating the sites of an image domain:

image2d<bool> ima(4,4);
window2d win = win_c4p();
mln_piter(image2d<bool>) p(ima.domain());
mln_qiter(window2d) q(win, p);
for_all(p)
for_all(q)
// q is a point2d, neighbor of the current p.
std::cout << q << std::endl;
See Also
dpoint2d, neighb2d

Definition at line 6 of file window2d.dox.

Member Function Documentation

void mln::window< mln::dpoint2d >::clear ( )
inherited

Clear the window.

unsigned mln::window< mln::dpoint2d >::delta ( ) const
inherited

Give the maximum coordinate gap between the window center and a window point.

const mln::dpoint2d & mln::window< mln::dpoint2d >::dp ( unsigned  i) const
inherited

Give the i-th delta-point.

const mln::util::set<mln::dpoint2d >& mln::window< mln::dpoint2d >::dps_hook_ ( ) const
inherited

INTERNAL_API

Hook to the set of D.

bool mln::window< mln::dpoint2d >::has ( const mln::dpoint2d dp) const
inherited

Test if dp is in this window definition.

window<mln::dpoint2d >& mln::window< mln::dpoint2d >::insert ( const mln::dpoint2d dp)
inherited

Insert a delta-point dp.

window<mln::dpoint2d >& mln::window< mln::dpoint2d >::insert ( const Window< W > &  win)
inherited

Insert another window win.

window<mln::dpoint2d >& mln::window< mln::dpoint2d >::insert ( const typename mln::dpoint2d ::coord dind)
inherited

Insertion of a delta-point with different numbers of arguments (coordinates) w.r.t. the dimension.

window<mln::dpoint2d >& mln::window< mln::dpoint2d >::insert ( const typename mln::dpoint2d ::coord drow,
const typename mln::dpoint2d ::coord dcol 
)
inherited
window<mln::dpoint2d >& mln::window< mln::dpoint2d >::insert ( const typename mln::dpoint2d ::coord dsli,
const typename mln::dpoint2d ::coord drow,
const typename mln::dpoint2d ::coord dcol 
)
inherited
bool mln::window< mln::dpoint2d >::is_centered ( ) const
inherited

Test if the window is centered.

Returns
True if the delta-point 0 belongs to the window.
bool mln::window< mln::dpoint2d >::is_empty ( ) const
inherited

Test if the window is empty (null size; no delta-point).

bool mln::window< mln::dpoint2d >::is_symmetric ( ) const
inherited

Test if the window is symmetric.

 \return True if for every dp of this window, -dp is also in
 this window.
bool mln::internal::window_base< mln::dpoint2d , window< mln::dpoint2d > >::is_valid ( ) const
inherited

return true by default.

void mln::window< mln::dpoint2d >::print ( std::ostream &  ostr) const
inherited

Print the window definition into ostr.

unsigned mln::window< mln::dpoint2d >::size ( ) const
inherited

Give the window size, i.e., the number of delta-sites.

const std::vector<mln::dpoint2d >& mln::window< mln::dpoint2d >::std_vector ( ) const
inherited

Give the std vector of delta-points.

void mln::window< mln::dpoint2d >::sym ( )
inherited

Apply a central symmetry to the target window.

Member Typedef Documentation

Site_Iterator type to browse the points of a basic window w.r.t. the reverse ordering of delta-points.

Definition at line 126 of file window.hh.

typedef Window<void> mln::Window< window< mln::dpoint2d > >::category
inherited

Definition at line 95 of file concept/window.hh.

Type of the window center.

Definition at line 64 of file window_base.hh.

DPsite associated type.

Definition at line 55 of file window_base.hh.

Definition at line 105 of file object.hh.

Site_Iterator type to browse the points of a basic window w.r.t. the ordering of delta-points.

Definition at line 121 of file window.hh.

Psite associated type.

Definition at line 58 of file window_base.hh.

typedef fwd_qiter mln::window< mln::dpoint2d >::qiter
inherited

Site_Iterator type to browse the points of a basic window whatever the ordering of delta-points.

Definition at line 131 of file window.hh.

Regular window associated type.

Definition at line 92 of file window.hh.

Site associated type.

Definition at line 61 of file window_base.hh.