Index: ChangeLog
from Giovanni Palma <giovanni(a)lrde.epita.fr>
* NEWS: Correct explanations on how to write some doc.
* configure.ac: Work on doc configuration.
Index: doc/ChangeLog
from Giovanni Palma <giovanni(a)lrde.epita.fr>
* ref/out/exdoc.config.in: Move exdoc.config.in to out.
* ref/Makefile.am: Romove useless comments.
Index: olena/ChangeLog
from Giovanni Palma <giovanni(a)lrde.epita.fr>
* tests/morpho/tests/attr_op_cl: Change tests to make them taking
care of new attribute names.
* oln/morpho/attribute_closing_opening_map.hh: Change some function names.
* oln/morpho/attributes.hh: Rename some attributes. Add new ones.
* oln/Makefile.am: Add file references.
* oln/morpho/attribute_union_find.hh: Remove old attribute class.
* oln/morpho/attribute_closing_opening.hh: Add comments.
Index: configure.ac
--- configure.ac Tue, 24 Feb 2004 16:33:38 +0100 palma_g (oln/3_configure.
1.47.1.1.1.1.1.4.1.15.1.14 640)
+++ configure.ac Thu, 04 Mar 2004 17:48:40 +0100 palma_g (oln/3_configure.
1.47.1.1.1.1.1.4.1.15.1.14 640)
@@ -237,9 +237,7 @@
AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen])
## if test -z "$DOXYGEN"; then
## AC_MSG_WARN([`doxygen' not found -- `doxygen' must be installed to generate
the documentation])
-AC_CONFIG_FILES([doc/ref/doxygen.config
- doc/ref/exdoc.config
- doc/ref/exdoc.mk])
+
## fi
### The documentation tree is both a component...
@@ -260,7 +258,10 @@
[oln_cv_build_ref],
[the Olena reference manuals],
[OLN_DOC],
- [doc/ref/Makefile],
+ [doc/ref/Makefile
+ doc/ref/doxygen.config
+ doc/ref/out/exdoc.config
+ doc/ref/exdoc.mk],
[dnl Configuration for the manuals directory.
AC_ARG_VAR([TAR], [the tape archiver program])
@@ -280,6 +281,8 @@
], [ref])dnl End of OLN_COMPONENT([doc/ref])
+
+
### The development manuals directory is a component.
OLN_COMPONENT([doc/dev],
Index: doc/ref/Makefile.am
--- doc/ref/Makefile.am Tue, 24 Feb 2004 16:33:38 +0100 palma_g (oln/d/51_Makefile.a
1.27.1.9 640)
+++ doc/ref/Makefile.am Thu, 04 Mar 2004 18:39:41 +0100 palma_g (oln/d/51_Makefile.a
1.27.1.9 640)
@@ -1,139 +1,38 @@
# ###
# ### General definitions
# ###
-
-# TEXI2PDF = $(TEXI2DVI) --pdf
-# TEXI2PDF_FLAGS = --batch -I $(srcdir)/graphics
-
-# TEXI2DVI_FLAGS = --batch -I $(srcdir)/graphics
-
olnsrc = $(top_srcdir)/olena/oln
-
-# include $(srcdir)/filelists.make
-
-# $(srcdir)/filelists.make: $(srcdir)/gen_filelists.sh
-# $(SHELL) $@ $(olnsrc)
-
-# $(srcdir)/Makefile.in: $(srcdir)/filelists.make
-
-# ###
-# ### Auto-generation of TeX files.
-# ###
-
-# AM_LDFLAGS = $(LDFLAGS) $(ZLIB_LDFLAGS)
-# AM_CXXFLAGS = $(CXXFLAGS) $(ZLIB_CXXFLAGS)
-
-# INCLUDES = -I$(top_srcdir)/olena -I$(top_builddir)/olena
-# COMMONGETDEFSFLAGS = --agarg=-DCXXCOMPILE="$(CXX) -I$(DEFS) $(DEFAULT_INCLUDES)
$(INCLUDES) $(CPPFLAGS) $(AM_CXXFLAGS) $(AM_LDFLAGS)" \
-# --agarg=-DEPSTOPDF="$(EPSTOPDF)" \
-# --agarg=-DCONVERT="$(IMAGEMAGICK_CONVERT)" \
-# --agarg=--templ-dirs=$(srcdir) \
-# --agarg=-DIMGDIR=$(top_srcdir)/olena/img
-# PROCESSINGGETDEFSFLAGS = \
-# --subblock=tpl=type,name,doc \
-# --subblock=arg=type,name,mode,doc \
-# --listattr=exh \
-# --listattr=ns \
-# --template $(srcdir)/processing.tpl \
-# --srcfile
-
-# ref-morpho.tex: $(morpho_files) $(srcdir)/processing.tpl
-# $(GETDEFS) $(COMMONGETDEFSFLAGS) $(PROCESSINGGETDEFSFLAGS) \
-# $(GETDEFSFLAGS) --base-name=ref-morpho $(morpho_files)
-
-# ref-level.tex: $(level_files) $(srcdir)/processing.tpl
-# $(GETDEFS) $(COMMONGETDEFSFLAGS) $(PROCESSINGGETDEFSFLAGS) \
-# $(GETDEFSFLAGS) --base-name=ref-level $(level_files)
-
-# ###
-# ### Rules to build the manuals.
-# ###
-
-# tex_TEX = oln-ref.tex
-
-# built_oln_ref_TEX = ref-morpho.tex ref-level.tex
-# oln_ref_TEX = $(built_oln_ref_TEX) integre-ref.tex
-
-# oln-ref.dvi: $(tex_TEX) $(oln_ref_TEX) $(graphics_DIA)
-# $(TEXI2DVI) $(TEXI2DVI_FLAGS) \
-# `test -f '$(tex_TEX)' || echo '$(srcdir)/'`$(tex_TEX)
-
DOXYGEN = doxygen
EXDOC = $(srcdir)/exdoc.pl
OUT_DIR = "out"
IMG_CONV = $(srcdir)/img_conv.pl
-code:
- $(EXDOC) --config=exdoc.config --output-dir=$(OUT_DIR) --input-dir=$(top_srcdir)
-execute: code
+
+
+doc: html.tar.gz oln-ref.pdf
+
+html: exdoc.config
+ $(EXDOC) --config=$(OUT_DIR)/exdoc.config --output-dir=$(OUT_DIR)
--input-dir=$(top_srcdir)
mkdir -p img
cd $(OUT_DIR) && make -f makefile
-
-images: execute
$(IMG_CONV) $(top_srcdir)/olena/img img
$(IMG_CONV) img img
-
-doxygen: images
$(DOXYGEN) doxygen.config
-html: doxygen
-
-
-doc: html pdf
-
-
-oln-ref.pdf: doxygen
- cd latex && make && cp refman.pdf ../$@
-
-
-# oln-ref.pdf: $(tex_TEX) $(oln_ref_TEX) $(graphics_DIA)
-# $(TEXI2PDF) $(TEXI2PDF_FLAGS) \
-# `test -f '$(tex_TEX)' || echo '$(srcdir)/'`$(tex_TEX)
-
-# # This rule is not activated by default since the generated files cannot
-# # be easily distributed (automake barks loudly when the filenames are
-# # not known at the time Makefile.in is generated)
-
-# # FIXME: uncomment when ready
-# # cp $(srcdir)/graphics/*-html.png html/
-
-# html.tar.gz: $(tex_TEX) $(oln_ref_TEX) $(graphics_DIA)
-# $(HEVEA) -fix -o html/oln-ref.html -I $(srcdir) -I $(srcdir)/graphics `test -f
'$(tex_TEX)' || echo '$(srcdir)/'`$(tex_TEX)
-# cd html && $(HACHA) -tocbis -o index.html oln-ref.html; cd ..
-# $(TAR) -czf $@ html
-
-html.tar.gz: html
+html.tar.gz:
$(TAR) -czf $@ html
-# ###
-# ### What gets distributed.
-# ###
-
-dist_noinst_DATA = oln-ref.pdf html.tar.gz
-
-# EXTRA_DIST = $(tex_TEX) $(oln_ref_TEX) \
-# processing.tpl filelists.make gen_filelists.sh
+oln-ref.pdf: html
+ cd latex && make && cp refman.pdf ../$@
-# bin.tar.gz: oln-ref.pdf oln-ref.dvi
-# $(TAR) -czf $@ `test -f bin/lena256.pdf || echo '$(srcdir)/'`bin
+dist_noinst_DATA = oln-ref.pdf html.tar.gz $(srcdir)/exdoc.pl $(srcdir)/img_conv.pl
-# ###
-# ### What gets cleaned.
-# ###
-# dist-local:
-# rm -f bin/*a.out$(EXEEXT)
dist-local:
rm -f img/*
-# MAINTAINERCLEANFILES = $(built_oln_ref_TEX) $(dist_noinst_DATA) \
-# $(srcdir)/html/* $(srcdir)/bin/* \
-# $(srcdir)/filelists.make
-
MAINTAINERCLEANFILES = $(dist_noinst_DATA) \
./html/* ./img/* $(OUT_DIR)/*
-# CLEANFILES = = *.tmp *.aux *.bbl *blg *.lot *.log *.out *.toc
-
# ###
# ### What gets installed.
# ###
Index: NEWS
--- NEWS Tue, 24 Feb 2004 16:33:38 +0100 palma_g (oln/0_NEWS 1.20 640)
+++ NEWS Mon, 08 Mar 2004 07:55:58 +0100 palma_g (oln/0_NEWS 1.20 640)
@@ -10,12 +10,11 @@
you can include it in the comments with the \image command,
using the same name you used to produce it, but with the png
extension. To make sure your image will not overwrite
- another existing one, you should name it with taking care of
- the name of the file you are writing in: e.g. if you comment the
- file oln/core/behavior.hh, an image should be named
- oln_core_behavior_hh_whatever_you_want.ppm It can be added that
- two macros are provided to make abstraction of input and
- output direcectories, they are named IMG_IN and IMG_OUT.
+ another existing one, you should name it taking care of
+ the namespace you are using: e.g. if you comment the function
+ oln::boo::bar::fun, an image should be named oln_foo_bar_fun.ppm
+ It can be added that two macros are provided to make abstraction
+ of input and output directories, they are named IMG_IN and IMG_OUT.
* Border behavior can be controlled with the behavior hierarchy.
If an algorithm support it, you can choose the way the image
Index: olena/oln/morpho/attribute_closing_opening.hh
--- olena/oln/morpho/attribute_closing_opening.hh Tue, 24 Feb 2004 16:33:38 +0100 palma_g
(oln/q/49_attribute_ 1.15 640)
+++ olena/oln/morpho/attribute_closing_opening.hh Mon, 08 Mar 2004 07:45:26 +0100 palma_g
(oln/q/49_attribute_ 1.15 640)
@@ -1,4 +1,4 @@
-// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory
+// Copyright (C) 2001, 2002, 2003, 2004 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
@@ -51,37 +51,15 @@
*/
namespace internal {
- /*!
- ** \brief perform an attribute closing
- **
- ** FIXME: ONLY A TEST
- ** \code
- ** #include <oln/basics2d.hh>
- ** #include <oln/morpho/attribute_closing_opening.hh>
- ** #include <oln/level/compare.hh>
- ** #include <ntg/all.hh>
- ** #include <iostream>
- ** int main()
- ** {
- ** typedef oln::image2d<ntg::int_u8> im_type;
- **
- ** im_type im1(oln::load(IMG_IN "lena256.pgm"));
- ** im1 = oln::morpho::fast::area_closing(im1, oln::neighb_c4(), 200);
- ** oln::save(im1, IMG_OUT
"olena_attribute_closing_opening_hh_attr_clo.ppm");
- ** return 0;
- ** }
- ** \endcode
- ** \image html lena256.png \image latex lena256.png => \image html
olena_attribute_closing_opening_hh_attr_clo.png \image latex
olena_attribute_closing_opening_hh_attr_clo.png
- **
- */
template<class I, class N, class A>
oln_concrete_type(I)
attr_closing_(const abstract::non_vectorial_image<I>& input,
const abstract::neighborhood<N>& Ng,
- const attr_lambda_type(A) &lambda)
+ const attr_lambda_type(A) &lambda,
+ const attr_env_type(A) &env = attr_env_type(A)())
{
typedef tarjan::tarjan_set<oln_concrete_type(I), A > tarjan_set_type;
- tarjan_set_type attr_closing(input.exact(), attr_env_type(A)());
+ tarjan_set_type attr_closing(input.exact(), env);
return attr_closing.template get_comptute<true>(lambda, Ng);
}
@@ -90,10 +68,11 @@
oln_concrete_type(I)
attr_opening_(const abstract::non_vectorial_image<I>& input,
const abstract::neighborhood<N>& Ng,
- const attr_lambda_type(A) &lambda)
+ const attr_lambda_type(A) &lambda,
+ const attr_env_type(A) &env = attr_env_type(A)())
{
typedef tarjan::tarjan_set<oln_concrete_type(I), A > tarjan_set_type;
- tarjan_set_type attr_opening(input.exact(), attr_env_type(A)());
+ tarjan_set_type attr_opening(input.exact(), env);
return attr_opening.template get_comptute<false>(lambda, Ng);
}
@@ -142,62 +121,185 @@
return tarjan::internal::attr_closing_<I, N, T##_type<I> >(input, Ng,
lambda); \
}
- /*=processing area_closing
- * ns: morpho
- * what: Area closing
- * arg: const abstract::non_vectorial_image<I>&, input, IN, input image
- * arg: const abstract::neighborhood<N>&, se, IN, neighborhood to
consider
- * arg: unsigned int, area, IN, area
- * ret:oln_concrete_type(I)
- * doc:
- * Compute an area closing using union/find algorithm.
- * See A. Meijster and M. Wilkinson. A Comparison of Algorithms For Connected
- * Set Openings and Closings. PAMI 24(2), p484--494
- * see: morpho::simple_geodesic_dilation
- * ex:
- * $ image2d<int_u8> im = load("lena256.pgm");
- * $ save(morpho::tarjan::area_closing(im, neighb_c4(),500), "out.pgm");
- * exi: lena256.pgm
- * exo: out.pgm
- =*/
- xxx_closing_decl(area);
-
- /*=processing area_opening
- * ns: morpho
- * what: Area opening
- * arg: const abstract::non_vectorial_image<I>&, input, IN, input image
- * arg: const abstract::neighborhood<N>&, se, IN, neighborhood to
consider
- * arg: unsigned int, area, IN, area
- * ret:oln_concrete_type(I)
- * doc:
- * Compute an area opening using union/find algorithm.
- * See A. Meijster and M. Wilkinson. A Comparison of Algorithms For Connected
- * Set Openings and Closings. PAMI 24(2), p484--494
- * see: morpho::simple_geodesic_dilation
- * ex:
- * $ image2d<int_u8> im = load("lena256.pgm");
- * $ save(morpho::tarjan::area_opening(im, neighb_c4(),500), "out.pgm");
- * exi: lena256.pgm
- * exo: out.pgm
- =*/
- xxx_opening_decl(area);
+ /*!
+ ** \brief Perform a cardinal closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena256.pgm"));
+ ** im1 = oln::morpho::fast::card_closing(im1, oln::neighb_c4(), 200);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_card_closing.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena256.png
+ ** \image latex lena256.png
+ ** =>
+ ** \image html oln_morpho_fast_card_closing.png
+ ** \image latex oln_morpho_fast_card_closing.png
+ **
+ */
+ xxx_closing_decl(card);
+
+ /*!
+ ** \brief Perform a cardinal opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena256.pgm"));
+ ** im1 = oln::morpho::fast::card_opening(im1, oln::neighb_c4(), 200);
+ ** oln::save(im1, IMG_OUT "oln_morpho_fast_card_opening.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena256.png
+ ** \image latex lena256.png
+ ** =>
+ ** \image html oln_morpho_fast_card_opening.png
+ ** \image latex oln_morpho_fast_card_opening.png
+ **
+ */
+ xxx_opening_decl(card);
+
+ /*!
+ ** \brief Perform an integral closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena256.pgm"));
+ ** im1 = oln::morpho::fast::integral_closing(im1, oln::neighb_c4(), 200);
+ ** oln::save(im1, IMG_OUT
"olena_attribute_closing_opening_hh_integral_clo.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena256.png
+ ** \image latex lena256.png
+ ** =>
+ ** \image html olena_attribute_closing_opening_hh_integral_clo.png
+ ** \image latex olena_attribute_closing_opening_hh_integral_clo.png
+ **
+ */
+ xxx_closing_decl(integral);
+
+ /*!
+ ** \brief Perform an integral opening.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena256.pgm"));
+ ** im1 = oln::morpho::fast::integral_opening(im1, oln::neighb_c4(), 200);
+ ** oln::save(im1, IMG_OUT
"olena_attribute_closing_opening_hh_integral_op.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena256.png
+ ** \image latex lena256.png
+ ** =>
+ ** \image html olena_attribute_closing_opening_hh_integral_op.png
+ ** \image latex olena_attribute_closing_opening_hh_integral_op.png
+ **
+ */
+ xxx_opening_decl(integral);
- xxx_opening_decl(volume);
- xxx_closing_decl(volume);
+ /*!
+ ** \brief Perform a height closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena256.pgm"));
+ ** im1 = oln::morpho::fast::height_opening(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT
"olena_attribute_closing_opening_hh_height_op.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena256.png
+ ** \image latex lena256.png
+ ** =>
+ ** \image html olena_attribute_closing_opening_hh_height_op.png
+ ** \image latex olena_attribute_closing_opening_hh_height_op.png
+ **
+ */
xxx_opening_decl(height);
+
+ /*!
+ ** \brief Perform a height closing.
+ **
+ ** \code
+ ** #include <oln/basics2d.hh>
+ ** #include <oln/morpho/attribute_closing_opening.hh>
+ ** #include <oln/level/compare.hh>
+ ** #include <ntg/all.hh>
+ ** #include <iostream>
+ ** int main()
+ ** {
+ ** typedef oln::image2d<ntg::int_u8> im_type;
+ **
+ ** im_type im1(oln::load(IMG_IN "lena256.pgm"));
+ ** im1 = oln::morpho::fast::height_closing(im1, oln::neighb_c4(), 5);
+ ** oln::save(im1, IMG_OUT
"olena_attribute_closing_opening_hh_height_clo.ppm");
+ ** return 0;
+ ** }
+ ** \endcode
+ ** \image html lena256.png
+ ** \image latex lena256.png
+ ** =>
+ ** \image html olena_attribute_closing_opening_hh_height_clo.png
+ ** \image latex olena_attribute_closing_opening_hh_height_clo.png
+ **
+ */
xxx_closing_decl(height);
xxx_opening_decl(maxvalue);
xxx_closing_decl(maxvalue);
xxx_opening_decl(minvalue);
xxx_closing_decl(minvalue);
- xxx_opening_im_decl(disk);
- xxx_closing_im_decl(disk);
+ xxx_opening_im_decl(ball);
+ xxx_closing_im_decl(ball);
xxx_opening_im_decl(dist);
xxx_closing_im_decl(dist);
- xxx_closing_im_decl(square);
- xxx_opening_im_decl(square);
- xxx_closing_im_decl(rectangle);
- xxx_opening_im_decl(rectangle);
+ xxx_closing_im_decl(cube);
+ xxx_opening_im_decl(cube);
+ xxx_closing_im_decl(box);
+ xxx_opening_im_decl(box);
} // !fast
} // !morpho
Index: olena/oln/morpho/attribute_union_find.hh
--- olena/oln/morpho/attribute_union_find.hh Mon, 16 Feb 2004 19:06:24 +0100 palma_g
(oln/q/50_attribute_ 1.12 640)
+++ olena/oln/morpho/attribute_union_find.hh Mon, 08 Mar 2004 08:03:26 +0100 palma_g
(oln/q/50_attribute_ 1.12 640)
@@ -1,4 +1,4 @@
-// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory
+// Copyright (C) 2001, 2002, 2003, 2004 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
@@ -41,40 +41,7 @@
namespace fast {
namespace tarjan {
- template< class T>
- struct T_attribute
- {
- T_attribute():value(1){}
-
- T_attribute( const T v):value(v){}
-
-
- T_attribute(const T_attribute& rhs){ value = rhs.value;}
-
- T_attribute
- operator+(const T_attribute & rhs) const
- {
- return T_attribute(value + rhs.value);
- }
-
- T_attribute&
- operator=(const T_attribute & rhs)
- {
- value = rhs.value;
- return *this;
- }
-
- const bool
- operator<(const T_attribute & rhs) const
- {
- return value < rhs.value;
- }
-
- T value;
-
- };
-
- template<class T, class ATTRIBUTE, class Env = NullEnv>
+ template<class T, class ATTRIBUTE, class Env = attr_env_type(ATTRIBUTE)>
struct tarjan_set
{
typedef oln_point_type(T) point_type;
Index: olena/oln/Makefile.am
--- olena/oln/Makefile.am Mon, 02 Feb 2004 10:57:28 +0100 van-vl_n (oln/q/47_Makefile.a
1.3.1.1.1.6.1.7.1.1 640)
+++ olena/oln/Makefile.am Wed, 25 Feb 2004 14:30:17 +0100 palma_g (oln/q/47_Makefile.a
1.3.1.1.1.6.1.7.1.1 640)
@@ -39,6 +39,7 @@
convol/fast_gaussian.hxx \
convol/fast_gaussian_coefficient.hh \
core/abstract/binary_image.hh \
+ core/abstract/behavior.hh \
core/abstract/dpoint.hh \
core/abstract/image.hh \
core/abstract/image_size.hh \
@@ -59,6 +60,7 @@
core/abstract/window.hh \
core/abstract/window_base.hh \
core/abstract/windownd.hh \
+ core/behavior.hh \
core/accum.hh \
core/apply.hh \
core/box.hh \
@@ -145,6 +147,9 @@
level/threshold.hh \
math/macros.hh \
morpho/attribute_closing_opening.hh \
+ morpho/attribute_closing_opening_map.hxx \
+ morpho/attribute_closing_opening_map.hh \
+ morpho/attributes.hh \
morpho/attribute_union_find.hh \
morpho/closing.hh \
morpho/closing.inc \
@@ -202,4 +207,5 @@
utils/copy.hh \
utils/histogram.hh \
utils/stat.hh \
+ utils/special_points.hh \
utils/timer.hh
Index: olena/oln/morpho/attributes.hh
--- olena/oln/morpho/attributes.hh Mon, 16 Feb 2004 19:06:24 +0100 palma_g
(oln/j/45_attributes 1.4 644)
+++ olena/oln/morpho/attributes.hh Thu, 04 Mar 2004 19:14:44 +0100 palma_g
(oln/j/45_attributes 1.4 644)
@@ -1,4 +1,4 @@
-// Copyright (C) 2001, 2002, 2003 EPITA Research and Development Laboratory
+// Copyright (C) 2001, 2002, 2003, 2004 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
@@ -35,7 +35,12 @@
# define attr_env_type(T) typename oln::morpho::attr_traits<T>::env_type
# define attr_value_type(T) typename oln::morpho::attr_traits<T>::value_type
-# define attr_type_decl(slef_type) \
+# define attr_lambda_type_(T) oln::morpho::attr_traits<T>::lambda_type
+# define attr_env_type_(T) oln::morpho::attr_traits<T>::env_type
+# define attr_value_type_(T) oln::morpho::attr_traits<T>::value_type
+
+
+# define attr_type_decl(self_type) \
typedef mlc_exact_vt_type(self_type, Exact) exact_type; \
typedef attr_value_type(exact_type) value_type; \
typedef attr_env_type(exact_type) env_type; \
@@ -59,50 +64,119 @@
{
};
- // this env is an empty one
+ /*!
+ ** \brief Useless environment.
+ **
+ ** This environment is an empty one.
+ */
struct NullEnv: public env<NullEnv>
{
};
+ /*!
+ ** \brief Environment containing image.
+ **
+ ** Used for image substitution in other_image attribute.
+ */
+ template <class I>
+ struct OtherImageEnv: public env<OtherImageEnv<I> >
+ {
+ typedef abstract::image<I> im_type;
+
+ OtherImageEnv(const abstract::image<I> &im): im_(im)
+ {};
+
+ const im_type &getImage() const
+ {
+ return im_;
+ }
+
+ protected:
+ const im_type &im_;
+ };
// the traits fwd declaration
template <class T>
struct attr_traits;
+ /*!
+ ** \brief Change the exact type of an attribute.
+ **
+ ** BE CAREFUL, when you use specialization of this traits, you
+ ** say change_exact<In, Exact>::ret IS A In.
+ ** Check this to avoid modeling problems.
+ */
+ template <class In, class Exact>
+ struct change_exact;
+
// the attributes hierarchy
/*------------*
| attribute |
*-----------*/
+ /*!
+ ** \brief Attribute abstract class
+ **
+ ** Top of the attribute hierarchy.
+ */
template <class Exact>
class attribute: public mlc_hierarchy::any<Exact>
{
public:
- typedef attribute<Exact> self_type;
+ typedef attribute<Exact> self_type; /*< Self type of the class.*/
attr_type_decl(self_type);
+ /*!
+ ** \brief += operator
+ **
+ ** This is a static dispatcher for the += operator.
+ ** This method is abstract.
+ */
void operator+=(const exact_type &rhs)
{
mlc_dispatch(pe)(rhs);
};
+ /*!
+ ** \brief >= operator
+ **
+ ** This is a static dispatcher for the >= operator.
+ */
bool operator>=(const lambda_type &lambda) const
{
mlc_dispatch(ge)(lambda);
};
+ /*!
+ ** \brief < operator
+ **
+ ** This is a static dispatcher for the < operator.
+ ** This method is abstract.
+ */
bool operator<(const lambda_type &lambda) const
{
mlc_dispatch(less)(lambda);
};
+ /*!
+ ** \brief != operator
+ **
+ ** This is a static dispatcher for the != operator.
+ ** This method is abstract.
+ */
bool operator!=(const lambda_type &lambda) const
{
mlc_dispatch(ne)(lambda);
};
- // impl
+ /*!
+ ** \brief >= operator implementation.
+ **
+ ** This is an implementation of the >= operator. override this
+ ** method to provide a new implementation of this operator.
+ ** This method SHOULDN'T be called.
+ */
bool ge_impl(const lambda_type &lambda) const
{
return !(*this < lambda);
@@ -114,34 +188,34 @@
};
/*-----------*
- | area |
+ | card |
*-----------*/
template <class T = unsigned, class Exact = mlc::final>
- class area_type:
- public attribute<mlc_2_exact_vt_type(area_type, T, Exact)>
+ class card_type:
+ public attribute<mlc_2_exact_vt_type(card_type, T, Exact)>
{
public:
- typedef area_type<T, Exact> self_type;
+ typedef card_type<T, Exact> self_type;
attr_type_decl(self_type);
- area_type()
+ card_type()
{
};
- area_type(const lambda_type &lambda): value_(lambda)
+ card_type(const lambda_type &lambda): value_(lambda)
{
};
template <class I>
- area_type(const abstract::image<I>&,
+ card_type(const abstract::image<I>&,
const oln_point_type(I)&,
const env_type&):
value_(1)
{
};
- void pe_impl(const area_type &rhs)
+ void pe_impl(const self_type &rhs)
{
value_ += rhs.value_;
};
@@ -164,29 +238,29 @@
/*-----------*
- | volume |
+ | integral |
*-----------*/
template <class T = unsigned, class Exact = mlc::final>
- class volume_type:
- public attribute<mlc_2_exact_vt_type(volume_type, T, Exact)>
+ class integral_type:
+ public attribute<mlc_2_exact_vt_type(integral_type, T, Exact)>
{
public:
- typedef volume_type<T, Exact> self_type;
+ typedef integral_type<T, Exact> self_type;
attr_type_decl(self_type);
// Ctors
- volume_type()
+ integral_type()
{
};
- volume_type(const lambda_type &lambda): value_(lambda)
+ integral_type(const lambda_type &lambda): value_(lambda)
{
};
template <class I>
- volume_type(const abstract::image<I> &input,
+ integral_type(const abstract::image<I> &input,
const oln_point_type(I) &p,
const env_type &) :
reflevel_(input[p]),
@@ -194,6 +268,16 @@
value_(1)
{
};
+ /*
+ template <class I>
+ integral_type(const abstract::image<I> &input,
+ const oln_point_type(I) &p
+ ):
+ reflevel_(input[p]),
+ area_(1),
+ value_(1)
+ {
+ };*/
// interface part
const value_type &getValue() const
{
@@ -226,7 +310,7 @@
return area_;
};
- void pe_impl(const volume_type &rhs)
+ void pe_impl(const self_type &rhs)
{
value_ += rhs.getValue() + area_ * tools::diffabs(reflevel_, rhs.getReflevel());
area_ += rhs.getArea();
@@ -248,6 +332,61 @@
value_type value_;
};
+ /*-------------------*
+ | other image_type |
+ ------------------*/
+ /*!
+ ** \class other_image
+ **
+ ** \brief Metaclass used to change attribute behavior.
+ **
+ ** This class do the same job the its Dad parameter, but force it
+ ** to work on other data.
+ */
+ template <class Dad, class I, class Exact = mlc::final>
+ class other_image:
+ public change_exact<Dad, typename mlc::exact_vt<other_image<Dad, I,
Exact>, Exact>::ret >::ret
+ {
+ public:
+ typedef other_image<Dad, I, Exact> self_type; /*< Self type of the
class.*/
+ typedef typename abstract::image<mlc_exact_type(I)> im_type; /*< Type
of substituted image.*/
+ attr_type_decl(self_type);
+ typedef typename change_exact<Dad,
+ typename mlc::exact_vt<other_image<Dad, I, Exact>,
+ Exact>::ret >::ret super_type; /*< Mother class type.*/
+
+ /*!
+ ** \brief Constructor.
+ **
+ ** Dispatch to Dad constructor.
+ */
+ other_image(): super_type()
+ {
+ };
+
+ /*!
+ ** \brief lambda_type Constructor.
+ **
+ ** Dispatch to Dad constructor.
+ */
+ other_image(const lambda_type &lambda): super_type(lambda)
+ {
+ };
+
+ /*!
+ ** \brief Image Constructor.
+ **
+ ** Dispatch to Dad constructor but substitute image argument with
+ ** the image contained in the environment.
+ */
+ template <typename IM>
+ other_image(const abstract::image<IM> &,
+ const oln_point_type(I) &p,
+ const env_type & e): super_type(e.getImage(), p, e)
+ {
+ };
+ };
+
/*-----------*
| height |
*-----------*/
@@ -443,15 +582,15 @@
/*-----------*
- | disk |
+ | ball |
*-----------*/
template <class I, class Exact = mlc::final>
- class disk_type:
- public attribute<mlc_2_exact_vt_type(disk_type, I, Exact)>
+ class ball_type:
+ public attribute<mlc_2_exact_vt_type(ball_type, I, Exact)>
{
public:
- typedef disk_type<I, Exact> self_type;
+ typedef ball_type<I, Exact> self_type;
attr_type_decl(self_type);
typedef abstract::image<mlc_exact_type(I)> im_type;
typedef oln_point_type(im_type) point_type;
@@ -459,15 +598,16 @@
typedef std::vector<point_type> pts_type;
typedef typename pts_type::const_iterator cst_iter_type;
- disk_type()
+ ball_type()
{
};
- disk_type(const lambda_type &lambda): value_(lambda), pts_()
+ ball_type(const lambda_type &lambda): value_(lambda), pts_()
{
};
- disk_type(const im_type&, const point_type &p, const env_type &) :
+
+ ball_type(const im_type&, const point_type &p, const env_type &) :
value_(ntg_zero_val(value_type)), pts_()
{
@@ -479,6 +619,7 @@
mlc_dispatch(getValue)();
};
+
const pts_type &getPts() const
{
mlc_dispatch(getPts)();
@@ -495,7 +636,7 @@
return pts_;
};
- void pe_impl(const disk_type &rhs)
+ void pe_impl(const ball_type &rhs)
{
value_type last = value_;
std::copy(rhs.getPts().begin(),
@@ -618,15 +759,15 @@
/*-----------*
- | square |
+ | cube |
*-----------*/
template <class I, class Exact = mlc::final>
- class square_type:
- public attribute<mlc_2_exact_vt_type(square_type, I, Exact)>
+ class cube_type:
+ public attribute<mlc_2_exact_vt_type(cube_type, I, Exact)>
{
public:
- typedef square_type<I, Exact> self_type;
+ typedef cube_type<I, Exact> self_type;
attr_type_decl(self_type);
typedef abstract::image<mlc_exact_type(I)> im_type;
typedef oln_point_type(im_type) point_type;
@@ -634,11 +775,11 @@
enum {dim = point_traits<point_type>::dim};
- square_type()
+ cube_type()
{
}
- square_type(const lambda_type &lambda):
+ cube_type(const lambda_type &lambda):
mins_(dim),
maxs_(dim),
value_(lambda)
@@ -650,7 +791,7 @@
}
};
- square_type(const im_type&,
+ cube_type(const im_type&,
const point_type &p,
const env_type &):
mins_(dim), maxs_(dim), value_(ntg_zero_val(value_type))
@@ -682,7 +823,7 @@
return maxs_[i];
};
- void pe_impl(const square_type &rhs)
+ void pe_impl(const cube_type &rhs)
{
for (int i = 0; i < dim; ++i)
{
@@ -713,22 +854,22 @@
- /*-----------*
- | rectangle |
- *-----------*/
+ /*------*
+ | box |
+ *-----*/
template <class I, class Exact = mlc::final>
- class rectangle_type:
- public attribute<mlc_2_exact_vt_type(rectangle_type, I, Exact)>
+ class box_type:
+ public attribute<mlc_2_exact_vt_type(box_type, I, Exact)>
{
public:
- typedef rectangle_type<I, Exact> self_type;
+ typedef box_type<I, Exact> self_type;
attr_type_decl(self_type);
typedef abstract::image<mlc_exact_type(I)> im_type;
typedef oln_point_type(im_type) point_type;
typedef oln_dpoint_type(im_type) dpoint_type;
enum {dim = point_traits<point_type>::dim };
- rectangle_type(const lambda_type &lambda): maxs_(dim), mins_(dim)
+ box_type(const lambda_type &lambda): maxs_(dim), mins_(dim)
{
for (int i = 0; i < dim; ++i)
{
@@ -737,11 +878,11 @@
}
};
- rectangle_type()
+ box_type()
{
}
- rectangle_type(const im_type&, const point_type &p, const env_type &):
maxs_(dim), mins_(dim)
+ box_type(const im_type&, const point_type &p, const env_type &): maxs_(dim),
mins_(dim)
{
for (int i = 0; i < dim; ++i)
mins_[i] = maxs_[i] = p.nth(i);
@@ -770,7 +911,7 @@
return maxs_[i];
};
- void pe_impl(const rectangle_type &rhs)
+ void pe_impl(const box_type &rhs)
{
for (int i = 0; i < dim; ++i)
{
@@ -805,16 +946,16 @@
\------------------------*/
- // volume traits
+ // integral traits
template <class T, class Exact>
- struct attr_traits<volume_type<T, Exact> >
+ struct attr_traits<integral_type<T, Exact> >
{
typedef T value_type;
typedef value_type lambda_type;
typedef NullEnv env_type;
};
- // volume traits
+ // height traits
template <class T, class Exact>
struct attr_traits<height_type<T, Exact> >
{
@@ -823,9 +964,9 @@
typedef NullEnv env_type;
};
- // area traits
+ // card traits
template <class T, class Exact>
- struct attr_traits<area_type<T, Exact> >
+ struct attr_traits<card_type<T, Exact> >
{
typedef T value_type;
typedef value_type lambda_type;
@@ -850,9 +991,9 @@
typedef NullEnv env_type;
};
- // disk traits
+ // ball traits
template <class I, class Exact>
- struct attr_traits<disk_type<I, Exact> >
+ struct attr_traits<ball_type<I, Exact> >
{
typedef unsigned value_type;
typedef value_type lambda_type;
@@ -868,23 +1009,48 @@
typedef NullEnv env_type;
};
- // square traits
+ // cube traits
template <class I, class Exact>
- struct attr_traits<square_type<I, Exact> >
+ struct attr_traits<cube_type<I, Exact> >
{
typedef unsigned value_type;
typedef value_type lambda_type;
typedef NullEnv env_type;
};
- // rectangle traits
+ // box traits
template <class I, class Exact>
- struct attr_traits<rectangle_type<I, Exact> >
+ struct attr_traits<box_type<I, Exact> >
{
typedef unsigned value_type;
typedef ntg::vec<I::dim, value_type, mlc::final> lambda_type;
typedef NullEnv env_type;
};
+
+ // other_image traits
+ template <class Dad, class I, class Exact>
+ struct attr_traits<other_image<Dad, I, Exact> >
+ {
+ //typedef typename change_exact<Dad, other_image<Dad, I, Exact>
>::ret super_type;
+ typedef typename change_exact<Dad,
+ typename mlc::exact_vt<other_image<Dad, I, Exact>,
+ Exact>::ret>::ret super_type;
+ typedef attr_value_type(super_type) value_type;
+ typedef attr_lambda_type(super_type) lambda_type;
+ typedef OtherImageEnv<I> env_type;
+ };
+ // traits for other_image derivation
+
+ /*!
+ ** \brief Change the exact type of an attribute.
+ **
+ ** Traits to change integral_type exact type.
+ */
+ template <class NewExact, class OldExact, class T>
+ struct change_exact<integral_type<T, OldExact>, NewExact>
+ {
+ typedef integral_type<T, NewExact> ret;
+ };
} // !morpho
} //!oln
Index: olena/oln/morpho/attribute_closing_opening_map.hh
--- olena/oln/morpho/attribute_closing_opening_map.hh Mon, 16 Feb 2004 19:06:24 +0100
palma_g (oln/j/49_attribute_ 1.2 600)
+++ olena/oln/morpho/attribute_closing_opening_map.hh Wed, 03 Mar 2004 11:48:52 +0100
palma_g (oln/j/49_attribute_ 1.2 600)
@@ -194,24 +194,24 @@
return tarjan_map<T##_type<I>, I, N>(true, input, ng, lambda,
attr_env_type(T##_type<I>)()); \
}
- xxx_opening_map_decl(area);
- xxx_closing_map_decl(area);
- xxx_opening_map_decl(volume);
- xxx_closing_map_decl(volume);
+ xxx_opening_map_decl(card);
+ xxx_closing_map_decl(card);
+ xxx_opening_map_decl(integral);
+ xxx_closing_map_decl(integral);
xxx_opening_map_decl(height);
xxx_closing_map_decl(height);
xxx_opening_map_decl(maxvalue);
xxx_closing_map_decl(maxvalue);
xxx_opening_map_decl(minvalue);
xxx_closing_map_decl(minvalue);
- xxx_opening_im_map_decl(disk);
- xxx_closing_im_map_decl(disk);
+ xxx_opening_im_map_decl(ball);
+ xxx_closing_im_map_decl(ball);
xxx_opening_im_map_decl(dist);
xxx_closing_im_map_decl(dist);
- xxx_closing_im_map_decl(square);
- xxx_opening_im_map_decl(square);
- xxx_closing_im_map_decl(rectangle);
- xxx_opening_im_map_decl(rectangle);
+ xxx_closing_im_map_decl(cube);
+ xxx_opening_im_map_decl(cube);
+ xxx_closing_im_map_decl(box);
+ xxx_opening_im_map_decl(box);
} // end of namespace slow
Index: olena/tests/morpho/tests/attr_op_cl
--- olena/tests/morpho/tests/attr_op_cl Mon, 16 Feb 2004 19:06:24 +0100 palma_g
(oln/k/0_attr_op_cl 1.1 644)
+++ olena/tests/morpho/tests/attr_op_cl Wed, 03 Mar 2004 11:49:43 +0100 palma_g
(oln/k/0_attr_op_cl 1.1 644)
@@ -37,6 +37,8 @@
if (!fail) \
OK_OR_FAIL \
} \
+ last_fail = last_fail || fail; \
+ fail = false; \
{ \
image2d<T> im2 = oln::morpho::slow::A##_closing(im, neighb_c4(), lambda); \
image2d<T> im1 = oln::morpho::fast::A##_closing(im, neighb_c4(), lambda); \
@@ -59,19 +61,19 @@
{
bool fail = false;
- image2d<int_u8> lena(rdata("lena256.pgm"));
+ image2d<int_u8> lena(rdata("lena.pgm"));
std::cout << std::endl;
- test_op_cl(int_u8, area, lena, 200)
- test_op_cl(int_u8, volume, lena, 200)
- test_op_cl(int_u8, height, lena, 4)
- test_op_cl(int_u8, maxvalue, lena, 100)
- test_op_cl(int_u8, minvalue, lena, 100)
- test_op_cl(int_u8, dist, lena, 100)
- test_op_cl(int_u8, disk, lena, 100)
- test_op_cl(int_u8, square, lena, 50)
+ test_op_cl(int_u8, card, lena, 200);
+ test_op_cl(int_u8, integral, lena, 200);
+ test_op_cl(int_u8, height, lena, 4);
+ test_op_cl(int_u8, maxvalue, lena, 100);
+ test_op_cl(int_u8, minvalue, lena, 100);
+ test_op_cl(int_u8, dist, lena, 100);
+ test_op_cl(int_u8, ball, lena, 100);
+ test_op_cl(int_u8, cube, lena, 50);
ntg::vec<2, unsigned, mlc::final> lambda;
- test_op_cl(int_u8, rectangle, lena, lambda)
+ test_op_cl(int_u8, box, lena, lambda);
return fail;
}
Index: doc/ref/out/exdoc.config.in
--- doc/ref/out/exdoc.config.in Mon, 08 Mar 2004 08:10:52 +0100 palma_g ()
+++ doc/ref/out/exdoc.config.in Wed, 25 Feb 2004 14:35:00 +0100 palma_g
(oln/k/7_exdoc.conf 644)
@@ -0,0 +1,12 @@
+[ENTRY]
+ COMMAND_PREFIX = \\ # In Doxygen, commands begin with a `\'
+ TAG_OPEN = code
+ TAG_CLOSE = endcode
+ CAPTIONS = cxx # We want to run cxx on the extracted files (see line below)
+ ALIAS cxx = @CXX@ # Here, cxx means g++ but you can choose other compilers
+ OPTIONS = @CXXFLAGS@ -I@top_srcdir@/integre -I@top_srcdir@/olena
-I@top_srcdir@/metalic $1 -o $2 -DIMG_OUT=\"../img/\"
-DIMG_IN=\"@top_srcdir@/olena/img/\" # tell how to use the soft, i.e. where to
put input and output arguments (default if not overriden) ($1: input, $2: output) FIXME:
$* should have explicit name, chek flags
+ OUT = out # FIXME: should be obsolete
+ EXT = cc # Extension of generated file
+ STD_OUT_EXT = std # Extension of generated file standard output
+ ERR_OUT_EXT = err # Extension of generated file error output
+ COMMENT_STYLE = \*\* # begining of comment line
Index: doc/ref/exdoc.config.in
--- doc/ref/exdoc.config.in Tue, 24 Feb 2004 16:33:38 +0100 palma_g (oln/k/5_exdoc.conf
1.1 644)
+++ doc/ref/exdoc.config.in Mon, 08 Mar 2004 08:10:52 +0100 palma_g ()
@@ -1,12 +0,0 @@
-[ENTRY]
- COMMAND_PREFIX = \\ # In Doxygen, commands begin with a `\'
- TAG_OPEN = code
- TAG_CLOSE = endcode
- CAPTIONS = cxx # We want to run cxx on the extracted files (see line below)
- ALIAS cxx = @CXX@ # Here, cxx means g++ but you can choose other compilers
- OPTIONS = @CXXFLAGS@ -I@top_srcdir@/integre -I@top_srcdir@/olena
-I@top_srcdir@/metalic $1 -o $2 -DIMG_OUT=\"../img/\"
-DIMG_IN=\"@top_srcdir@/olena/img/\" # tell how to use the soft, i.e. where to
put input and output arguments (default if not overriden) ($1: input, $2: output) FIXME:
$* should have explicit name, chek flags
- OUT = out # FIXME: should be obsolete
- EXT = cc # Extension of generated file
- STD_OUT_EXT = std # Extension of generated file standard output
- ERR_OUT_EXT = err # Extension of generated file error output
- COMMENT_STYLE = \*\* # begining of comment line
--
Giovanni Palma
EPITA - promo 2005 - membre d'EpX - LRDE
Mob. : +33 (0)6 60 97 31 74