Commit c5e09221 authored by Thierry Geraud's avatar Thierry Geraud
Browse files

Clean-up and update pixel related material.

	* tests/README: New.
	* mln/core/trait: New.
	* mln/core/trait/pixter.hh: New.
	* mln/core/internal/pixel_impl.hh: New.
	* mln/core/internal/fixme.hh: New.
	* mln/core/concept/fast_image.hh: New.
	* mln/core/concept/doc/fast_iterator.hh: Rename as...
	* mln/core/concept/doc/pixel_iterator.hh: ...this new file.
	Update.
	* mln/core/concept/doc/fast_image.hh: New.
	* mln/core/concept/doc/genpixel.hh: New.
	* mln/core/tags.hh: New.
	* mln/metal: New.
	* mln/metal/none.hh: New.
	* mln/core/internal/lineary_pixel_iterator_base.hh: Remove.

	* mln/core/dpoints_piter.hh,
	* mln/core/box_piter.hh,
	* mln/core/internal/image_base.hh,
	* mln/core/internal/piter_adaptor.hh,
	* mln/core/concept/genpoint.hh,
	* mln/core/concept/psite.hh,
	* mln/core/concept/point.hh,
	* mln/core/concept/doc/genpoint.hh (pointer): Rename as...
	(pointer_): ...this.
	
	* tests/window2d.cc: Cosmetic change.
	* TODO: Update.
	* mln/core/macros.hh (mln_ima): Remove.
	(*ixter): Update.
	(mln_piter, mln_qiter, mln_niter): Update.
	* mln/core/psubset.hh (bkd_piter): Use fixme.
	(npoints): Update.
	* mln/core/box.hh (piter): Remove.
	* mln/core/rectangle2d.hh (bkd_piter): Use fixme.
	* mln/core/pixter2d_b.hh: Clean-up and update.
	* mln/core/window.hh (bkd_piter): Use fixme.
	* mln/core/dpoints_pixter.hh: Clean-up and update.
	* mln/core/internal/pixel_iterator_base.hh: Clean-up and update.
	* mln/core/internal/box_impl.hh: Touch doc.
	* mln/core/internal/image_base.hh (dpoint, coord): New.
	(pointer): Update.
	* mln/core/pixel.hh: Clean-up and update.
	* mln/core/hline2d.hh (bkd_piter): Use fixme.
	* mln/core/concept/image.hh (piter): Remove.
	(dpoint, coord): New.
	* mln/core/concept/pixel_iterator.hh: Update.
	* mln/core/concept/point_set.hh (piter): Remove.
	* mln/core/concept/object.hh: New include.
	* mln/core/concept/doc/image.hh: Update.
	* mln/core/concept/doc/point_set.hh: Update.
	* mln/core/concept/genpixel.hh: Clean-up and update.
	* mln/core/vline2d.hh (bkd_piter): Use fixme.
	* mln/core/image2d_b.hh: Clean-up and update.
	(buffer): New.
	(offset, point_at_offset): Fix.
	* mln/level/fast_median.hh: Update.
	* mln/level/median.hh: Prefer mln_coord to int.
	* mln/canvas/sbrowsing.hh: Update doc.
	* tests/fast_median.cc,
	* tests/pixter_point2d.cc,
	* tests/pixter_dpoint2d.cc,
	* tests/pixel.cc: Update.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@1025 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 3e4eedae
2007-07-20 Thierry Geraud <thierry.geraud@lrde.epita.fr>
Clean-up and update pixel related material.
* tests/README: New.
* mln/core/trait: New.
* mln/core/trait/pixter.hh: New.
* mln/core/internal/pixel_impl.hh: New.
* mln/core/internal/fixme.hh: New.
* mln/core/concept/fast_image.hh: New.
* mln/core/concept/doc/fast_iterator.hh: Rename as...
* mln/core/concept/doc/pixel_iterator.hh: ...this new file.
Update.
* mln/core/concept/doc/fast_image.hh: New.
* mln/core/concept/doc/genpixel.hh: New.
* mln/core/tags.hh: New.
* mln/metal: New.
* mln/metal/none.hh: New.
* mln/core/internal/lineary_pixel_iterator_base.hh: Remove.
* mln/core/dpoints_piter.hh,
* mln/core/box_piter.hh,
* mln/core/internal/image_base.hh,
* mln/core/internal/piter_adaptor.hh,
* mln/core/concept/genpoint.hh,
* mln/core/concept/psite.hh,
* mln/core/concept/point.hh,
* mln/core/concept/doc/genpoint.hh (pointer): Rename as...
(pointer_): ...this.
* tests/window2d.cc: Cosmetic change.
* TODO: Update.
* mln/core/macros.hh (mln_ima): Remove.
(*ixter): Update.
(mln_piter, mln_qiter, mln_niter): Update.
* mln/core/psubset.hh (bkd_piter): Use fixme.
(npoints): Update.
* mln/core/box.hh (piter): Remove.
* mln/core/rectangle2d.hh (bkd_piter): Use fixme.
* mln/core/pixter2d_b.hh: Clean-up and update.
* mln/core/window.hh (bkd_piter): Use fixme.
* mln/core/dpoints_pixter.hh: Clean-up and update.
* mln/core/internal/pixel_iterator_base.hh: Clean-up and update.
* mln/core/internal/box_impl.hh: Touch doc.
* mln/core/internal/image_base.hh (dpoint, coord): New.
(pointer): Update.
* mln/core/pixel.hh: Clean-up and update.
* mln/core/hline2d.hh (bkd_piter): Use fixme.
* mln/core/concept/image.hh (piter): Remove.
(dpoint, coord): New.
* mln/core/concept/pixel_iterator.hh: Update.
* mln/core/concept/point_set.hh (piter): Remove.
* mln/core/concept/object.hh: New include.
* mln/core/concept/doc/image.hh: Update.
* mln/core/concept/doc/point_set.hh: Update.
* mln/core/concept/genpixel.hh: Clean-up and update.
* mln/core/vline2d.hh (bkd_piter): Use fixme.
* mln/core/image2d_b.hh: Clean-up and update.
(buffer): New.
(offset, point_at_offset): Fix.
* mln/level/fast_median.hh: Update.
* mln/level/median.hh: Prefer mln_coord to int.
* mln/canvas/sbrowsing.hh: Update doc.
* tests/fast_median.cc,
* tests/pixter_point2d.cc,
* tests/pixter_dpoint2d.cc,
* tests/pixel.cc: Update.
2007-07-19 Nicolas Ballas <ballas@lrde.epita.fr>
Repair lineary pixel iterator.
......
-*- outline -*-
* compilation
* large changes
g++-4.1 -I.. int_u8.cc -Wall -Wextra -Wconversion
introduce grids
* value
* adds-on
Value_Set
props { ... }
notion of lowq
+ values() : vset dans Image ?
** abstractions
Function_i2i
Weighted_Window
* function
** types
Function_p2v
Function_p2b
Function_v2w
value::proxy to dispatch read/write + the corresponding image type
a mean_value object { sum; count } and operator+
value_cast<T>(image)
t_image to "transpose" the 0 and the i-th coordinates
image defined by f/pset
F apply(I, F)
O transform(I, F)
** extensions
in Fast_Image: memcpy and memset-like methods (?)
.offset() into GenPixel
notion of low-quantization
vset and .values() in Image
built-in op objects -> reverse lhs/rhs
* renaming
GenPixel, GenPoint, Psite, Piter: longer name (?)
mlc into metal
point-wise material: pw::value_of, pw::constant, and pw::variable
kind-related: mln_value_kind(I) and mln_kind(V)
* clean-up
accu::histo and median: remove inheritance
* processing routines
reconstructions + their canvases
fast versions of level::fill and level::paste
histogram class
sorting points w.r.t. their value (array of offsets, psites, points)
border::* and no-op versions if not fast image
arith::inplace_plus et al.
linear:: for convolutions
......@@ -45,12 +45,18 @@ namespace mln
/*! FIXME: Doc!
*
*
* F should be
* {
* input; p; --- attributes
* void init();
* void down(); void fwd(); void bkd(); --- methods
* }
* F shall feature: \n
* { \n
* --- as attributes: \n
* input; \n
* p; \n
* --- as methods: \n
* void init(); \n
* void down(); \n
* void fwd(); \n
* void bkd(); \n
* } \n
*
*/
template <typename F>
void sbrowsing(F& f);
......
......@@ -70,10 +70,6 @@ namespace mln
*/
typedef box_bkd_piter_<P> bkd_piter;
/*! \brief Piter associated type.
*/
typedef fwd_piter piter;
/*! \brief Minimum point.
*/
P pmin() const;
......
......@@ -76,7 +76,7 @@ namespace mln
operator P() const;
/// Address of the point.
const P* pointer() const;
const P* pointer_() const;
/// Give the i-th coordinate.
coord operator[](unsigned i) const;
......@@ -136,7 +136,7 @@ namespace mln
operator P() const;
/// Address of the point.
const P* pointer() const;
const P* pointer_() const;
/// Give the i-th coordinate.
coord operator[](unsigned i) const;
......@@ -183,7 +183,7 @@ namespace mln
template <typename P>
const P*
box_fwd_piter_<P>::pointer() const
box_fwd_piter_<P>::pointer_() const
{
return & p_;
}
......@@ -254,7 +254,7 @@ namespace mln
template <typename P>
const P*
box_bkd_piter_<P>::pointer() const
box_bkd_piter_<P>::pointer_() const
{
return & p_;
}
......
// Copyright (C) 2007 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License version 2 as published by the
// Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING. If not, write to
// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
// Boston, MA 02111-1307, USA.
//
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
/*! \file mln/core/concept/doc/fast_image.hh
* \brief This file documents the concept of mln::Fast_Image.
*/
namespace mln
{
namespace doc
{
/*! \brief Documentation class for mln::Fast_Image.
* \see mln::Fast_Image
*/
template <typename E>
struct Fast_Image : public Image<E>
{
/*! \brief Give the border thickness.
*
* \pre The image has to be initialized.
*/
unsigned border();
/*! \brief Give the offset corresponding to the delta-point \p
* dp.
*
* \param[in] p A delta-point.
*
* \pre The image has to be initialized.
*/
int offset(const dpoint& dp);
/*! \brief Give the offset of the point \p p.
*
* \param[in] p A point.
*
* \pre The image has to own the point \p p.
*/
unsigned offset(const point& p);
/*! \brief Give the point at offset \p o.
*
* \param[in] p An offset.
*
* \pre The image has to be initialized.
* \pre o < ncells()
*/
point point_at_offset(unsigned o) const;
/*! \brief Give a hook to the value buffer.
*
* \internal
*
* \pre The image has to be initialized.
*/
const value* buffer() const;
};
} // end of namespace mln::doc
} // end of namespace mln
// Copyright (C) 2007 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License version 2 as published by the
// Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING. If not, write to
// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
// Boston, MA 02111-1307, USA.
//
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef MLN_CORE_CONCEPT_DOC_GENPIXEL_HH
# define MLN_CORE_CONCEPT_DOC_GENPIXEL_HH
/*! \file mln/core/concept/doc/genpixel.hh
* \brief This file documents the concept of mln::GenPixel.
*/
namespace mln
{
namespace doc
{
/*! \brief Documentation class for mln::GenPixel.
*
* \see mln::GenPixel
*/
template <typename E>
struct GenPixel
{
/// Value associated type.
typedef void value;
/// Read-only value associated type.
typedef void rvalue;
/*! \brief Give the value of this generalized pixel.
*
* \return A read-only value.
*/
rvalue operator*() const;
/*! \brief Give a hook to the value address.
*
* This method allows for iterators to refer to a generalized
* pixel.
*
* \return A pointer to the value address.
*/
value** address_() const;
protected:
GenPixel();
};
} // end of namespace mln::doc
} // end of namespace mln
......@@ -79,7 +79,7 @@ namespace mln
*
* \return A point address.
*/
const point* pointer() const;
const point* pointer_() const;
/*! \brief Read-only access to the \p i-th coordinate value.
*
......
......@@ -121,10 +121,16 @@ namespace mln
*/
typedef void psite;
/*! \brief Piter associated type.
* \invariant This type has to derive from mln::Piter.
/*! \brief Coordinate associated type.
*/
typedef void piter;
typedef void coord;
/*! \brief Dpoint associated type.
* \invariant This type has to derive from mln::Dpoint.
*/
typedef void dpoint;
/*! \brief Forward point iterator associated type.
* \invariant This type has to derive from mln::Piter.
......@@ -136,6 +142,7 @@ namespace mln
*/
typedef void bkd_piter;
/*! \brief Test if \p p belongs to the image domain.
*
* \param[in] p A point site.
......@@ -162,10 +169,6 @@ namespace mln
std::size_t npoints() const;
};
template <typename E>
struct Fast_Image : public Image<E>
{
};
} // end of namespace mln::doc
......
......@@ -25,8 +25,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
/*! \file mln/core/concept/doc/fast_iterator.hh
* \brief This file documents the concept of mln::Fast_Iterator.
/*! \file mln/core/concept/doc/pixel_iterator.hh
*
* \brief This file documents the concept of mln::Pixel_Iterator.
*/
namespace mln
......@@ -34,24 +35,29 @@ namespace mln
namespace doc
{
/*! \brief Documentation class for mln::Iterator.
* \see mln::Fast_Iterator
* \see mln::Pixel_Iterator
*/
template <typename E>
struct Fast_Iterator : public Iterator<E>
struct Pixel_Iterator : public Iterator<E>,
public GenPixel<E>
{
/*! \brief Dereference operator.
* return the current pixel
/*! \brief Type returned by the read-write dereference operator.
*/
rvalue operator* ();
typedef void lvalue;
/*! \brief Dereference operator.
* return the current pixel
*
* \return The current pixel value; this value cannot be
* modified.
*/
lvalue operator* () const;
lvalue operator*() const;
protected:
Fast_Iterator();
Pixel_Iterator();
};
} // end of namespace doc
} // end of namespace mln
......@@ -50,10 +50,6 @@ namespace mln
*/
typedef void psite;
/*! \brief Piter associated type.
*/
typedef void piter;
/*! \brief Forward Piter associated type.
*/
typedef void fwd_piter;
......
// Copyright (C) 2007 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License version 2 as published by the
// Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING. If not, write to
// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
// Boston, MA 02111-1307, USA.
//
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef MLN_CORE_CONCEPT_FAST_IMAGE_HH
# define MLN_CORE_CONCEPT_FAST_IMAGE_HH
/*! \file mln/core/concept/fast_image.hh
* \brief Definition of the concept of mln::Fast_Image.
*/
# include <mln/core/concept/image.hh>
# include <mln/core/trait/pixter.hh>
namespace mln
{
/*! \brief Base class for implementation of fast image classes.
*
* \see mln::doc::Fast_Image for a complete documentation of this
* class contents.
*/
template <typename E>
struct Fast_Image : public Image<E>
{
/*
unsigned border();
int offset(const dpoint& dp);
unsigned offset(const point& p);
point point_at_offset(unsigned o) const;
const value* buffer() const;
*/
protected:
Fast_Image();
};
# ifndef MLN_INCLUDE_ONLY
template <typename E>
Fast_Image<E>::Fast_Image()
{
typedef mln_point(E) point;
typedef mln_dpoint(E) dpoint;
typedef mln_value(E) value;
typedef mln_fwd_pixter(E) fwd_pixter;
typedef mln_bkd_pixter(E) bkd_pixter;
int (E::*m1)(const dpoint&) = & E::offset;
m1 = 0;
unsigned (E::*m2)(const point&) = & E::offset;
m2 = 0;
point (E::*m3)(unsigned) const = & E::point_at_offset;
m3 = 0;
const value* (E::*m4)() const = & E::buffer;
m4 = 0;
unsigned (E::*m5)() const = & E::border;
m5 = 0;
// FIXME: how to check that qixter are defined when W is unknown!
}
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
#endif // ! MLN_CORE_CONCEPT_FAST_IMAGE_HH
......@@ -29,13 +29,11 @@
# define MLN_CORE_CONCEPT_GENPIXEL_HH
/*! \file mln/core/concept/genpixel.hh
*
* \brief Definition of the concept of mln::Genpixel.
*/
# include <mln/core/concept/object.hh>
# include <mln/core/macros.hh>
# include <mln/core/contract.hh>
# include <mln/core/internal/force_exact.hh>
......@@ -58,75 +56,29 @@ namespace mln
template <typename E>
struct GenPixel
{
/*
typedef value;
typedef rvalue;
typedef value;
// FIXME: lvalue?
// FIXME: Inactivated:
// typedef ima; // not const!
// typedef psite;
// const ima& image() const;
// const psite& site() const; // FIXME ou cpy
// value* address();
rvalue operator*() const;
lvalue operator*();
const value*& address() const;
value** address_() const;
*/
protected:
GenPixel();