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

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

Public Member Functions

void clear ()
unsigned delta () const
const mln::dpoint1ddp (unsigned i) const
const mln::util::set
< mln::dpoint1d > & 
dps_hook_ () const
bool has (const mln::dpoint1d &dp) const
window< mln::dpoint1d > & insert (const mln::dpoint1d &dp)
window< mln::dpoint1d > & 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::dpoint1d > & 
std_vector () const
void sym ()
window< mln::dpoint1d > & insert (const typename mln::dpoint1d::coord &dind)
window< mln::dpoint1d > & insert (const typename mln::dpoint1d::coord &drow, const typename mln::dpoint1d::coord &dcol)
window< mln::dpoint1d > & insert (const typename mln::dpoint1d::coord &dsli, const typename mln::dpoint1d::coord &drow, const typename mln::dpoint1d::coord &dcol)

Public Types

typedef dpsites_bkd_piter
< window< mln::dpoint1d > > 
bkd_qiter
typedef Window< void > category
typedef psite center_t
typedef mln::dpoint1d dpsite
typedef window< mln::dpoint1dexact_t
typedef dpsites_fwd_piter
< window< mln::dpoint1d > > 
fwd_qiter
typedef mln::dpoint1d::psite psite
typedef fwd_qiter qiter
typedef window< mln::dpoint1dregular
typedef mln::dpoint1d::site site

Detailed Description

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

Common 1D windows are predefined and can be used directly. See section 1D windows.

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

window1d win;
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:

window1d win;
mln_qiter(window1d) q(win, p);
for_all(q)
// q is a point1d, neighbor of p.
std::cout << q << std::endl;

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

image1d<bool> ima(4);
window1d win;
mln_piter(image1d<bool>) p(ima.domain());
mln_qiter(window1d) q(win, p);
for_all(p)
for_all(q)
// q is a point1d, neighbor of the current p.
std::cout << q << std::endl;
See Also
dpoint1d, neighb1d

Definition at line 6 of file window1d.dox.

Member Function Documentation

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

Clear the window.

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

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

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

Give the i-th delta-point.

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

INTERNAL_API

Hook to the set of D.

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

Test if dp is in this window definition.

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

Insert a delta-point dp.

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

Insert another window win.

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

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

window<mln::dpoint1d >& mln::window< mln::dpoint1d >::insert ( const typename mln::dpoint1d ::coord drow,
const typename mln::dpoint1d ::coord dcol 
)
inherited
window<mln::dpoint1d >& mln::window< mln::dpoint1d >::insert ( const typename mln::dpoint1d ::coord dsli,
const typename mln::dpoint1d ::coord drow,
const typename mln::dpoint1d ::coord dcol 
)
inherited
bool mln::window< mln::dpoint1d >::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::dpoint1d >::is_empty ( ) const
inherited

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

bool mln::window< mln::dpoint1d >::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::dpoint1d , window< mln::dpoint1d > >::is_valid ( ) const
inherited

return true by default.

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

Print the window definition into ostr.

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

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

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

Give the std vector of delta-points.

void mln::window< mln::dpoint1d >::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::dpoint1d > >::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::dpoint1d >::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.