Commit f19b924a authored by Roland Levillain's avatar Roland Levillain
Browse files

* oln/core/abstract/image/dimension/1d.hh

	* oln/core/abstract/image/dimension/2d.hh
	* oln/core/abstract/image/dimension/3d.hh
	* oln/core/abstract/image/dimension/hierarchy.hh
	* oln/core/1d/grid1d.hh, oln/core/2d/grid2d.hh,
	* oln/core/3d/grid3d.hh, oln/core/2d/array2d.hh,
	* oln/core/2d/dpoint2d.hh, oln/core/2d/point2d.hh,
	* tests/image1d.cc, tests/image2d.cc, tests/image3d.cc,
	* tests/image_entry.cc, tests/io_pnm.cc, tests/Makefile.am:
	Aesthetic changes.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@622 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent d6c43300
2006-10-12 Roland Levillain <roland@lrde.epita.fr>
* oln/core/abstract/image/dimension/1d.hh
* oln/core/abstract/image/dimension/2d.hh
* oln/core/abstract/image/dimension/3d.hh
* oln/core/abstract/image/dimension/hierarchy.hh
* oln/core/1d/grid1d.hh, oln/core/2d/grid2d.hh,
* oln/core/3d/grid3d.hh, oln/core/2d/array2d.hh,
* oln/core/2d/dpoint2d.hh, oln/core/2d/point2d.hh,
* tests/image1d.cc, tests/image2d.cc, tests/image3d.cc,
* tests/image_entry.cc, tests/io_pnm.cc, tests/Makefile.am:
Aesthetic changes.
2006-10-12 Roland Levillain <roland@lrde.epita.fr>
Add static assertions to oln::topo_bbox_ and oln::topo_lbbox_.
......
......@@ -48,7 +48,7 @@ namespace oln
typedef mlc::uint_<1> dimvalue_type;
};
/// A 1-dimension grid.
/// A 1D grid.
struct grid1d : public stc_get_supers(grid1d)
{
protected:
......
......@@ -43,9 +43,7 @@ namespace oln
public:
/// Ctor.
array2d(coord_t imin, coord_t jmin,
coord_t imax, coord_t jmax);
array2d(coord_t imin, coord_t jmin, coord_t imax, coord_t jmax);
/// Ctor.
array2d(coord_t ilen, coord_t jlen);
......@@ -53,7 +51,6 @@ namespace oln
~array2d();
value_t operator()(coord_t i, coord_t j) const;
value_t& operator()(coord_t i, coord_t j);
bool has(coord_t i, coord_t j) const;
......@@ -70,13 +67,11 @@ namespace oln
private:
void allocate_();
void deallocate_();
};
# ifndef OLN_INCLUDE_ONLY
template <typename value_t, typename coord_t>
......@@ -94,7 +89,6 @@ namespace oln
}
template <typename value_t, typename coord_t>
/// Ctor.
array2d<value_t, coord_t>::array2d(coord_t ilen, coord_t jlen) :
imin_(0),
jmin_(0),
......@@ -108,7 +102,6 @@ namespace oln
}
template <typename value_t, typename coord_t>
/// Dtor.
array2d<value_t, coord_t>::~array2d()
{
deallocate_();
......
......@@ -91,6 +91,7 @@ namespace oln
};
# ifndef OLN_INCLUDE_ONLY
template <typename C>
......
......@@ -48,7 +48,7 @@ namespace oln
typedef mlc::uint_<2> dimvalue_type;
};
/// A 2-dimension rectangular grid.
/// A 2D rectangular grid.
struct grid2d : public stc_get_supers(grid2d)
{
protected:
......
......@@ -91,7 +91,7 @@ namespace oln
/// Ctor.
point2d_(const xtd::vec<2,C>& v);
///Dtor.
/// Dtor.
~point2d_()
{
}
......@@ -124,11 +124,6 @@ namespace oln
{
}
// template <typename C>
// point2d_<C>::~point2d_()
// {
// }
template <typename C>
C point2d_<C>::row() const { return v_[0]; }
......
......@@ -47,7 +47,7 @@ namespace oln
typedef mlc::uint_<3> dimvalue_type;
};
/// A 3-dimension cubic grid.
/// A 3D cubic grid.
struct grid3d : public stc_get_supers(grid3d)
{
protected:
......
......@@ -37,7 +37,7 @@ namespace oln
namespace abstract
{
/// Class of 1-D images.
/// Class of 1D images.
template <typename E>
struct image1d :
public virtual image<E>,
......
......@@ -37,7 +37,7 @@ namespace oln
namespace abstract
{
/// Class of 2-D images.
/// Class of 2D images.
template <typename E>
struct image2d :
public virtual image<E>,
......
......@@ -37,7 +37,7 @@ namespace oln
namespace abstract
{
/// Class of 3-D images.
/// Class of 3D images.
template <typename E>
struct image3d :
public virtual image<E>,
......
......@@ -91,7 +91,7 @@ namespace oln
class grid2d;
class grid3d;
/// 1-D case.
/// 1D case.
template <typename E>
struct case_< image_hierarchy_wrt_dimension, E, 1 > :
where_< mlc::eq_< oln_type_of(E, grid), oln::grid1d > >
......@@ -99,7 +99,7 @@ namespace oln
typedef abstract::image1d<E> ret;
};
/// 2-D case.
/// 2D case.
template <typename E>
struct case_< image_hierarchy_wrt_dimension, E, 2 > :
where_< mlc::eq_< oln_type_of(E, grid), oln::grid2d > >
......@@ -107,7 +107,7 @@ namespace oln
typedef abstract::image2d<E> ret;
};
/// 3-D case.
/// 3D case.
template <typename E>
struct case_< image_hierarchy_wrt_dimension, E, 3 > :
where_< mlc::eq_< oln_type_of(E, grid), oln::grid3d > >
......
......@@ -46,6 +46,9 @@ image3d_SOURCES = image3d.cc
npoints_SOURCES = npoints.cc
window2d_SOURCES = window2d.cc
# I/O.
io_pnm_SOURCES = io_pnm.cc
# Morphers.
identity_morpher_SOURCES = identity_morpher.cc
add_neighborhood_morpher_SOURCES = add_neighborhood_morpher.cc
......@@ -53,7 +56,6 @@ morphers_SOURCES = morphers.cc
# Algorithms.
fill_SOURCES = fill.cc
io_pnm_SOURCES = io_pnm.cc
TESTS = $(check_PROGRAMS)
......@@ -36,18 +36,18 @@
int
main()
{
// Fill a 1-d image using its iterator.
// Fill a 1D image using its iterator.
oln::image1d<char> ima1(3);
oln_type_of_(oln::image1d<char>, piter) p1(ima1.topo());
for_all(p1)
ima1(p1) = 1;
// Fill a 1-d image using a classic loop.
// Fill a 1D image using a classic loop.
oln::image1d<int> ima2(ima1.topo());
for (unsigned i = 0; i < 3; ++i)
ima2(oln::point1d(i)) = 2;
// Fill a 1-d image using the routine oln::level::fill.
// Fill a 1D image using the routine oln::level::fill.
oln::image1d<long> ima3(ima1.topo());
oln::level::fill(ima3, 3);
......
......@@ -36,19 +36,19 @@
int
main()
{
// Fill a 2-d image using its iterator.
// Fill a 2D image using its iterator.
oln::image2d<char> ima1(3, 3);
oln_type_of_(oln::image2d<char>, piter) p1(ima1.topo());
for_all(p1)
ima1(p1) = 1;
// Fill a 2-d image using a classic loop.
// Fill a 2D image using a classic loop.
oln::image2d<int> ima2(ima1.topo());
for (unsigned i = 0; i < 3; ++i)
for (unsigned j = 0; j < 3; ++j)
ima2(oln::point2d(i, j)) = 2;
// Fill a 2-d image using the routine oln::level::fill.
// Fill a 2D image using the routine oln::level::fill.
oln::image2d<long> ima3(ima1.topo());
oln::level::fill(ima3, 3);
......
......@@ -36,20 +36,20 @@
int
main()
{
// Fill a 3-d image using its iterator.
// Fill a 3D image using its iterator.
oln::image3d<char> ima1(3, 3, 3);
oln_type_of_(oln::image3d<char>, piter) p1(ima1.topo());
for_all(p1)
ima1(p1) = 1;
// Fill a 3-d image using a classic loop.
// Fill a 3D image using a classic loop.
oln::image3d<int> ima2(ima1.topo());
for (unsigned i = 0; i < 3; ++i)
for (unsigned j = 0; j < 3; ++j)
for (unsigned k = 0; k < 3; ++k)
ima2(oln::point3d(i, j, k)) = 2;
// Fill a 3-d image using the routine oln::level::fill.
// Fill a 3D image using the routine oln::level::fill.
oln::image3d<long> ima3(ima1.topo());
oln::level::fill(ima3, 3);
......
......@@ -72,7 +72,7 @@ namespace oln
namespace my
{
// A very simple 1-D image.
// A very simple 1D image.
class image : public oln::get_super_types<my::image>::ret
{
public:
......
......@@ -34,7 +34,6 @@
int
main()
{
// Fill a 2-d image using its iterator.
oln::image2d<bool> ima = oln::io::load_pbm("../img/chien.pbm");
oln::image2d<unsigned char> ima2 = oln::io::load_pgm("../img/lena32.pgm");
}
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