Commit 53c60f14 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Add more window aliases.

	* mln/core/alias/neighb3d.hh: add c8_3d.

	* mln/core/alias/window2d.hh: add win_c8p.

	* mln/core/alias/window3d.hh: add win_c4p_3d and win_c8p_3d.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3456 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 6e407cc7
2009-03-02 Guillaume Lazzara <lazzara@lrde.epita.fr>
Add more window aliases.
* mln/core/alias/neighb3d.hh: add c8_3d.
* mln/core/alias/window2d.hh: add win_c8p.
* mln/core/alias/window3d.hh: add win_c4p_3d and win_c8p_3d.
2009-03-02 Guillaume Lazzara <lazzara@lrde.epita.fr>
 
Add missing traces in basic routines in geom/* (ticket #49).
......@@ -68,6 +68,25 @@ namespace mln
///
const neighb3d& c4_3d();
/// 8-connectivity neighborhood on the 3D grid.
///
/// . . .
/// . . .
/// . . .
///
/// o o o
/// o x o
/// o o o
///
/// . . .
/// . . .
/// . . .
///
/// \return A neighb3d.
///
const neighb3d& c8_3d();
/*! \brief 6-connectivity neighborhood on the 3D grid.
*
* . . .
......@@ -158,6 +177,20 @@ namespace mln
return it;
}
inline
const neighb3d& c8_3d()
{
static neighb3d it;
if (it.size() == 0)
{
static const bool vals[] = { 1, 1, 1,
1, 0, 1,
1, 1, 1 };
convert::from_to(vals, it);
}
return it;
}
inline
const neighb3d& c6()
{
......
......@@ -59,6 +59,16 @@ namespace mln
/// \return A window2d.
const window2d& win_c4p();
/// \brief 8-connectivity window on the 2D grid, including the
/// center.
///
/// o o o
/// o x o
/// o o o
///
/// \return A window2d.
const window2d& win_c8p();
namespace convert
{
......@@ -96,6 +106,26 @@ namespace mln
return it;
}
inline const window2d&
win_c8p()
{
static window2d it;
if (it.size() == 0)
{
it
.insert(-1, -1)
.insert( 0, -1)
.insert(+1, -1)
.insert(-1, 0)
.insert( 0, 0)
.insert(+1, 0)
.insert(-1, +1)
.insert( 0, +1)
.insert(+1, +1);
}
return it;
}
namespace convert
{
......
......@@ -47,6 +47,44 @@ namespace mln
/// the 3D square grid with integer coordinates.
typedef window<mln::dpoint3d> window3d;
/// \brief 4-connectivity window on the 3D grid, including the
/// center.
///
/// - - -
/// - - -
/// - - -
///
/// - o -
/// o x o
/// - o -
///
/// - - -
/// - - -
/// - - -
///
///
/// \return A window3d.
const window3d& win_c4p_3d();
/// \brief 8-connectivity window on the 3D grid, including the
/// center.
///
/// - - -
/// - - -
/// - - -
///
/// o o o
/// o x o
/// o o o
///
/// - - -
/// - - -
/// - - -
///
/// \return A window3d.
const window3d& win_c8p_3d();
namespace convert
{
......@@ -65,6 +103,42 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
inline const window3d&
win_c4p_3d()
{
static window3d it;
if (it.size() == 0)
{
it
.insert( 0, -1)
.insert(-1, 0)
.insert( 0, 0)
.insert(+1, 0)
.insert( 0, +1);
}
return it;
}
inline const window3d&
win_c8p_3d()
{
static window3d it;
if (it.size() == 0)
{
it
.insert(-1, -1)
.insert( 0, -1)
.insert(+1, -1)
.insert(-1, 0)
.insert( 0, 0)
.insert(+1, 0)
.insert(-1, +1)
.insert( 0, +1)
.insert(+1, +1);
}
return it;
}
namespace convert
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment