oln::w_window2d< T > Class Template Reference

Window 2 dimensions with weight. More...

#include <w_window2d.hh>

Inheritance diagram for oln::w_window2d< T >:

Inheritance graph
[legend]
Collaboration diagram for oln::w_window2d< T >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef w_window2d< T > self_type
 The self type.

typedef struct_elt_traits<
self_type >::iter_type 
iter_type
 The associate image's type of iterator.

typedef struct_elt_traits<
self_type >::neighb_type 
neighb_type
 Type of neighbor.

typedef struct_elt_traits<
self_type >::dpoint_type 
dpoint_type
 The associate image's type of dpoint (move point).

typedef struct_elt_traits<
self_type >::weight_type 
weight_type
 Type of weight.


Public Member Functions

 w_window2d ()
 Construct a w_window of 2 dimensions.

 w_window2d (unsigned size)
 Construct a w_window of 2 dimensions.
  • size The number of element.


template<class I, class T2>  w_window2d (const mlc::array2d< I, T2 > &arr)
 Construct a w_window of 2 dimensions from an array of elements.
  • arr The array of elements.


w_window2d< T > & add (coord row, coord col, const weight_type &weight)
 Add a point by coordinates to the w_window.
  • row The coordinate (row) of the new point (2 dimensions).
  • col The coordinate (col) of the new point (2 dimensions).
  • weight The weight of the new point.


w_window2d< T > & add (const dpoint_type &dp, const weight_type &w)
 Add a dpoint (move point) to the w_window.
  • dp The new point.
  • w The weight of the new point.


const weight_typeset (const dpoint_type &dp, const weight_type &weight)
 Set the weight of a point.
  • dp The point to set the weight.
  • weight The weight of the point.


const weight_typeset (coord row, coord col, const weight_type &weight)
 Set the weight of a point by coordinates.
  • row The coordinates (row) of the point.
  • col The coordinates (col) of the point.
  • weight The weight of the point.



Static Public Member Functions

std::string name ()
 Return the name of the type.


Protected Member Functions

coord delta_update_ (const dpoint_type &dp)
 Update delta.
  • dp a move point.



Friends

class abstract::window_base< abstract::w_window< w_window2d >, w_window2d >

Detailed Description

template<class T>
class oln::w_window2d< T >

Window 2 dimensions with weight.

A window is a set of points. This class defines how to deal with. These points have 2 dimensions.

Definition at line 68 of file w_window2d.hh.


Member Typedef Documentation

template<class T>
typedef struct_elt_traits< self_type >::dpoint_type oln::w_window2d< T >::dpoint_type
 

The associate image's type of dpoint (move point).

Warning:
Prefer the macros oln_dpoint_type(Pointable) and oln_dpoint_type_(Pointable) (the same without the 'typename' keyword)

Reimplemented from oln::abstract::w_windownd< w_window2d< T > >.

Definition at line 93 of file w_window2d.hh.

Referenced by oln::w_window2d< T2 >::add(), and oln::w_window2d< T2 >::set().

template<class T>
typedef struct_elt_traits< self_type >::iter_type oln::w_window2d< T >::iter_type
 

The associate image's type of iterator.

Warning:
Prefer the macros oln_iter_type(Iterable) and oln_iter_type_(Iterable) (the same without the 'typename' keyword)

Definition at line 83 of file w_window2d.hh.


Constructor & Destructor Documentation

template<class T>
template<class I, class T2>
oln::w_window2d< T >::w_window2d const mlc::array2d< I, T2 > &  arr  )  [inline]
 

Construct a w_window of 2 dimensions from an array of elements.

  • arr The array of elements.

Todo:
FIXME: this constructor is not in w_window1d.hh nor w_window3d.hh. Is it really useful ? This constructor is used to build a chamfer distance.

Definition at line 121 of file w_window2d.hh.

00121                                               :
00122       super_type(I::card)
00123     {
00124       unsigned i = 0;
00125       for (coord row = -I::center_row; row <= I::nrows - I::center_row - 1; ++row)
00126         for (coord col = -I::center_col; col <= I::ncols - I::center_col - 1; ++col)
00127           add(row, col, arr[i++]);
00128     }


Member Function Documentation

template<class T>
w_window2d<T>& oln::w_window2d< T >::add const dpoint_type dp,
const weight_type w
[inline]
 

Add a dpoint (move point) to the w_window.

  • dp The new point.
  • w The weight of the new point.

Add a new member to the w_window. This point must be of 2 dimensions.

Definition at line 155 of file w_window2d.hh.

00156     {
00157       return this->exact().add_(dp, w);
00158     }

template<class T>
w_window2d<T>& oln::w_window2d< T >::add coord  row,
coord  col,
const weight_type weight
[inline]
 

Add a point by coordinates to the w_window.

  • row The coordinate (row) of the new point (2 dimensions).
  • col The coordinate (col) of the new point (2 dimensions).
  • weight The weight of the new point.

Add a new member by its coordinates to the w_window. The coordinates are only the column number because the w_window is of 2 dimensions.

Definition at line 141 of file w_window2d.hh.

Referenced by oln::w_window2d< T2 >::add(), oln::mk_w_win_from_win(), and oln::w_window2d< T2 >::w_window2d().

00142     {
00143       return add(dpoint_type(row, col), weight);
00144     }

template<class T>
coord oln::w_window2d< T >::delta_update_ const dpoint_type dp  )  [inline, protected]
 

Update delta.

  • dp a move point.

Returns:
Delta.
If the point is the biggest element of the w_window, then this point is assigned to delta.

Definition at line 204 of file w_window2d.hh.

00205     {
00206       delta_(abs(dp.row()));
00207       delta_(abs(dp.col()));
00208       return this->delta_;
00209     }

template<class T>
const weight_type& oln::w_window2d< T >::set coord  row,
coord  col,
const weight_type weight
[inline]
 

Set the weight of a point by coordinates.

  • row The coordinates (row) of the point.
  • col The coordinates (col) of the point.
  • weight The weight of the point.

The coordinates are only the column number because the w_window is of 2 dimensions.

Definition at line 181 of file w_window2d.hh.

00182     {
00183       return set(dpoint_type(row, col), weight);
00184     }


The documentation for this class was generated from the following file:
Generated on Thu Apr 15 20:14:32 2004 for Olena by doxygen 1.3.6-20040222