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

#include <mln/core/site_set/box.hh>

Public Member Functions

 box ()
 box (const site &pmin, const site &pmax)
const box< P > & bbox () const
void crop_wrt (const box< P > &b)
void enlarge (unsigned b)
void enlarge (unsigned dim, unsigned b)
bool has (const P &p) const
bool is_empty () const
bool is_valid () const
unsigned len (unsigned i) const
std::size_t memory_size () const
void merge (const box< P > &b)
unsigned nsites () const
pcenter () const
pmax () const
P & pmax ()
pmin () const
P & pmin ()
box< P > to_larger (unsigned b) const
 box (typename P::coord ninds)
 box (typename P::coord nrows, typename P::coord ncols)
 box (typename P::coord nslis, typename P::coord nrows, typename P::coord ncols)

Protected Attributes

pmax_
pmin_

Public Types

enum  { dim = P::dim }
typedef box_bkd_piter_< P > bkd_piter
typedef Site_Set< void > category
typedef P element
typedef box< P > exact_t
typedef box_fwd_piter_< P > fwd_piter
typedef fwd_piter piter
typedef P psite
typedef const box< P > & q_box
typedef P site

Related Functions

(Note that these are not member functions.)

template<typename P >
box< P > larger_than (const box< P > a, const box< P > b)
template<typename P >
std::ostream & operator<< (std::ostream &ostr, const box< P > &b)

Detailed Description

template<typename P>
class mln::box< P >

Generic box class: site set containing points of a regular grid.

Parameter P is the corresponding type of point.

Definition at line 81 of file core/site_set/box.hh.

Constructor & Destructor Documentation

template<typename P>
mln::box< P >::box ( )

Constructor without argument.

template<typename P>
mln::box< P >::box ( const site pmin,
const site pmax 
)

Constructor of a box going from pmin to pmax.

template<typename P>
mln::box< P >::box ( typename P::coord  ninds)
explicit

Constructors with different numbers of arguments (sizes) w.r.t. the dimension.

template<typename P>
mln::box< P >::box ( typename P::coord  nrows,
typename P::coord  ncols 
)
template<typename P>
mln::box< P >::box ( typename P::coord  nslis,
typename P::coord  nrows,
typename P::coord  ncols 
)

Member Function Documentation

const box< P > & mln::Box< box< P > >::bbox ( ) const
inherited

Give the bounding box of this site set.

Return the bounding box of this site set, so that is itself. This method is declared by the mln::Site_Set concept.

Warning
This method is final for all box classes.
template<typename P>
void mln::box< P >::crop_wrt ( const box< P > &  b)

Crop this bbox in order to fit in the reference box b.

template<typename P>
void mln::box< P >::enlarge ( unsigned  b)

Enlarge the box with a border b.

template<typename P>
void mln::box< P >::enlarge ( unsigned  dim,
unsigned  b 
)

Enlarge the box with a border b for dimension dim.

template<typename P>
bool mln::box< P >::has ( const P &  p) const

Test if p belongs to the box.

Parameters
[in]pA point site.
bool mln::Box< box< P > >::is_empty ( ) const
inherited

Test if this box is empty.

template<typename P>
bool mln::box< P >::is_valid ( ) const

Test that the box owns valid data, i.e., is initialized and with pmin being 'less-than' pmax.

unsigned mln::Box< box< P > >::len ( unsigned  i) const
inherited

Give the length of the i-th side of the box.

Precondition
i < site::dim
Warning
This method is final for all box classes.
template<typename P>
std::size_t mln::box< P >::memory_size ( ) const

Return the size of this site set in memory.

template<typename P>
void mln::box< P >::merge ( const box< P > &  b)

Merge inplace with another box.

unsigned mln::Box< box< P > >::nsites ( ) const
inherited

Give the number of sites of this box.

Return the number of sites of this box. This method is declared by the mln::Site_Set concept.

Warning
This method is final for all box classes.
template<typename P>
P mln::box< P >::pcenter ( ) const

Return the approximated central site of this box.

template<typename P>
P mln::box< P >::pmax ( ) const

Maximum point.

template<typename P>
P& mln::box< P >::pmax ( )

Reference to the maximum point.

template<typename P>
P mln::box< P >::pmin ( ) const

Minimum point.

template<typename P>
P& mln::box< P >::pmin ( )

Reference to the minimum point.

template<typename P>
box<P> mln::box< P >::to_larger ( unsigned  b) const

Give a larger box.

Friends And Related Function Documentation

template<typename P >
box< P > larger_than ( const box< P >  a,
const box< P >  b 
)
related

Return the minimum box including box a and box b.

template<typename P >
std::ostream & operator<< ( std::ostream &  ostr,
const box< P > &  b 
)
related

Print a generic box b into the output stream ostr.

Parameters
[in,out]ostrAn output stream.
[in]bA generic box.
Returns
The modified output stream ostr.

Member Data Documentation

template<typename P>
P mln::box< P >::pmax_
protected

Definition at line 165 of file core/site_set/box.hh.

template<typename P>
P mln::box< P >::pmin_
protected

Definition at line 165 of file core/site_set/box.hh.

Member Typedef Documentation

template<typename P>
typedef box_bkd_piter_<P> mln::box< P >::bkd_piter

Backward Site_Iterator associated type.

Definition at line 105 of file core/site_set/box.hh.

typedef Site_Set<void> mln::Site_Set< box< P > >::category
inherited

Definition at line 74 of file core/concept/site_set.hh.

template<typename P>
typedef P mln::box< P >::element

Element associated type.

Definition at line 90 of file core/site_set/box.hh.

typedef box< P > mln::Object< box< P > >::exact_t
inherited

Definition at line 105 of file object.hh.

template<typename P>
typedef box_fwd_piter_<P> mln::box< P >::fwd_piter

Forward Site_Iterator associated type.

Definition at line 99 of file core/site_set/box.hh.

template<typename P>
typedef fwd_piter mln::box< P >::piter

Site_Iterator associated type.

Definition at line 102 of file core/site_set/box.hh.

template<typename P>
typedef P mln::box< P >::psite

Psite associated type.

Definition at line 93 of file core/site_set/box.hh.

typedef const box< P > & mln::Box< box< P > >::q_box
inherited

Definition at line 64 of file core/concept/box.hh.

template<typename P>
typedef P mln::box< P >::site

Site associated type.

Definition at line 96 of file core/site_set/box.hh.

Member Enumeration Documentation

template<typename P>
anonymous enum

Dimension.

Enumerator:
dim 

Definition at line 87 of file core/site_set/box.hh.