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

#include <mln/win/rectangle2d.hh>

Public Member Functions

 rectangle2d (unsigned height, unsigned width)
unsigned area () const
unsigned delta () const
const dpoint2ddp (unsigned i) const
bool has (const dpoint2d &dp) const
unsigned height () const
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< dpoint2d > & std_vector () const
void sym ()
const std::vector< dpoint2d > & vect () const
unsigned width () const

Protected Member Functions

unsigned delta_ () const
void insert (const dpoint2d &d)
void print_ (std::ostream &ostr) const

Protected Attributes

unsigned height_
unsigned width_
mln::window< dpoint2dwin_

Public Types

typedef dpsites_fwd_piter
< rectangle2d
bkd_qiter
typedef Window< void > category
typedef psite center_t
typedef dpoint2d dpsite
typedef rectangle2d exact_t
typedef dpsites_fwd_piter
< rectangle2d
fwd_qiter
typedef dpoint2d::psite psite
typedef fwd_qiter qiter
typedef window< dpoint2dregular
typedef dpoint2d::site site

Detailed Description

Rectangular window defined on the 2D square grid.

A rectangle2d is a 2D window with rectangular shape. It is centered and symmetric.

For instance:

    *  o o o o o
    *  o o x o o
    *  o o o o o
    * 

is defined with height = 3 and width = 5.

Definition at line 65 of file rectangle2d.hh.

Constructor & Destructor Documentation

mln::win::rectangle2d::rectangle2d ( unsigned  height,
unsigned  width 
)

Constructor.

Parameters
[in]heightHeight of the rectangle2d.
[in]widthWidth of the rectangle2d.
Precondition
Height and width are odd.

Member Function Documentation

unsigned mln::win::rectangle2d::area ( ) const

Give the rectangle area.

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

unsigned mln::internal::classical_window_base< dpoint2d , rectangle2d >::delta_ ( ) const
protectedinherited

Give the i-th delta-point.

bool mln::internal::classical_window_base< dpoint2d , rectangle2d >::has ( const dpoint2d dp) const
inherited

Test if the delta-point dp belongs to the window.

unsigned mln::win::rectangle2d::height ( ) const

Give the rectangle height.

void mln::internal::classical_window_base< dpoint2d , rectangle2d >::insert ( const dpoint2d d)
protectedinherited
bool mln::internal::classical_window_base< dpoint2d , rectangle2d >::is_centered ( ) const
inherited

Test if the window is centered; return true.

bool mln::internal::classical_window_base< dpoint2d , rectangle2d >::is_empty ( ) const
inherited

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

bool mln::internal::classical_window_base< dpoint2d , rectangle2d >::is_symmetric ( ) const
inherited

Test if the window is symmetric; return true.

bool mln::internal::window_base< dpoint2d , rectangle2d >::is_valid ( ) const
inherited

return true by default.

void mln::internal::classical_window_base< dpoint2d , rectangle2d >::print ( std::ostream &  ostr) const
inherited

Print into ostr the window definition.

void mln::internal::classical_window_base< dpoint2d , rectangle2d >::print_ ( std::ostream &  ostr) const
protectedinherited

Give the number of delta-points.

const std::vector<dpoint2d>& mln::win::rectangle2d::std_vector ( ) const

Give the std vector of delta-points.

Reimplemented from mln::internal::classical_window_base< dpoint2d, rectangle2d >.

Apply a central symmetry to the target window; a no-op here.

const std::vector<dpoint2d >& mln::internal::classical_window_base< dpoint2d , rectangle2d >::vect ( ) const
inherited

Give the vector of delta-points.

unsigned mln::win::rectangle2d::width ( ) const

Give the rectangle width.

Member Data Documentation

unsigned mln::win::rectangle2d::height_
protected

Definition at line 101 of file rectangle2d.hh.

unsigned mln::win::rectangle2d::width_
protected

Definition at line 101 of file rectangle2d.hh.

Definition at line 119 of file classical_window_base.hh.

Member Typedef Documentation

Backward site iterator associated type.

Definition at line 68 of file classical_window_base.hh.

typedef Window<void> mln::Window< rectangle2d >::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.

typedef rectangle2d mln::Object< rectangle2d >::exact_t
inherited

Definition at line 105 of file object.hh.

Forward site iterator associated type.

Definition at line 65 of file classical_window_base.hh.

Psite associated type.

Definition at line 58 of file window_base.hh.

Site iterator associated type.

Definition at line 71 of file classical_window_base.hh.

Regular window associated type.

Definition at line 61 of file classical_window_base.hh.

Site associated type.

Definition at line 61 of file window_base.hh.