1264: Make trait naming and directories coherent.

https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Thierry Geraud <thierry.geraud@lrde.epita.fr> Make trait naming and directories coherent. * mln/trait/image_from_mesh.hh: . * mln/trait/image: New directory. * mln/trait/images.hh: Split contents into... * mln/trait/image/props.hh, * mln/trait/image/print.hh, * mln/trait/undef.hh: these new files. * mln/trait/kind.hh: Rename as... * mln/trait/value/kind.hh: ...this. Layout. * mln/trait/value_.hh: New. * mln/trait/value: New. * mln/trait/value/print.hh: New. * mln/trait/value/nature.hh: New. * mln/value/int_u.hh (value_): Add trait. * mln/histo/compute.hh, * mln/debug/iota.hh, * mln/debug/println_with_border.hh, * mln/core/internal/image_if_base.hh, * mln/core/internal/check/image_all.hh, * mln/core/image2d_b.hh, * mln/core/sub_image.hh, * mln/core/concept/value.hh, * mln/core/image1d_b.hh, * mln/core/image3d_b.hh, * mln/metal/mat.hh, * mln/metal/vec.hh, * mln/arith/plus.hh, * mln/arith/min.hh, * mln/arith/revert.hh, * mln/arith/minus.hh, * mln/level/take.hh, * mln/level/assign.hh, * mln/level/apply.hh, * mln/level/fill.hh, * mln/level/memset_.hh, * mln/level/median.hh, * mln/level/paste.spe.hh, * mln/level/paste.hh, * mln/linear/convolve.hh, * mln/linear/local/convolve.hh, * mln/value/graylevel.hh, * mln/value/float01_.hh, * mln/value/int_s.hh, * mln/value/int_u_sat.hh, * mln/value/props.hh, * mln/value/rgb.hh, * mln/value/rgb8_non_templated.hh, * mln/value/float01_f.hh, * mln/value/label.hh, * mln/border/resize.hh, * mln/border/fill.hh, * mln/border/duplicate.hh, * mln/border/mirror.hh, * mln/border/get.hh, * mln/test/predicate.hh, * mln/pw/image.hh, * mln/morpho/min.hh, * mln/morpho/plus.hh, * mln/morpho/minus.hh, * mln/morpho/complementation.hh, * mln/morpho/dilation.hh, * mln/morpho/erosion.hh, * mln/morpho/hit_or_miss.hh, * mln/io/internal/pnm/save.hh, * mln/logical/and.hh, * mln/logical/and_not.hh, * mln/logical/or.hh, * mln/logical/not.hh, * mln/labeling/level.hh: Update trait naming. Misc. * mln/trait/ch_value.hh, * mln/trait/concrete.hh, * tests/trait_images.cc: Fix doc text. * tests/linear_sobel.cc: Rename as... * tests/linear_sobel._cc: ...this; so deactivate for tests. Update. * tests/trait_value.cc: New. mln/arith/min.hh | 20 +- mln/arith/minus.hh | 20 +- mln/arith/plus.hh | 26 +-- mln/arith/revert.hh | 8 - mln/border/duplicate.hh | 2 mln/border/fill.hh | 2 mln/border/get.hh | 4 mln/border/mirror.hh | 2 mln/border/resize.hh | 2 mln/core/concept/value.hh | 1 mln/core/image1d_b.hh | 20 +- mln/core/image2d_b.hh | 20 +- mln/core/image3d_b.hh | 20 +- mln/core/internal/check/image_all.hh | 2 mln/core/internal/image_if_base.hh | 8 - mln/core/sub_image.hh | 4 mln/debug/iota.hh | 4 mln/debug/println_with_border.hh | 2 mln/histo/compute.hh | 4 mln/io/internal/pnm/save.hh | 4 mln/labeling/level.hh | 8 - mln/level/apply.hh | 4 mln/level/assign.hh | 8 - mln/level/fill.hh | 6 mln/level/median.hh | 4 mln/level/memset_.hh | 2 mln/level/paste.hh | 2 mln/level/paste.spe.hh | 8 - mln/level/take.hh | 4 mln/linear/convolve.hh | 8 - mln/linear/local/convolve.hh | 4 mln/logical/and.hh | 12 - mln/logical/and_not.hh | 12 - mln/logical/not.hh | 8 - mln/logical/or.hh | 12 - mln/metal/mat.hh | 2 mln/metal/vec.hh | 2 mln/morpho/complementation.hh | 2 mln/morpho/dilation.hh | 2 mln/morpho/erosion.hh | 2 mln/morpho/hit_or_miss.hh | 2 mln/morpho/min.hh | 4 mln/morpho/minus.hh | 2 mln/morpho/plus.hh | 2 mln/pw/image.hh | 20 +- mln/test/predicate.hh | 4 mln/trait/ch_value.hh | 2 mln/trait/concrete.hh | 2 mln/trait/image/print.hh | 90 ++++++++++++ mln/trait/image/props.hh | 261 +++++++++-------------------------- mln/trait/image_from_mesh.hh | 2 mln/trait/images.hh | 158 +-------------------- mln/trait/undef.hh | 52 ++++++ mln/trait/value/kind.hh | 32 ++-- mln/trait/value/nature.hh | 68 +++++++++ mln/trait/value/print.hh | 80 ++++++++++ mln/trait/value_.hh | 80 ++++++++++ mln/value/float01_.hh | 2 mln/value/float01_f.hh | 2 mln/value/graylevel.hh | 2 mln/value/int_s.hh | 2 mln/value/int_u.hh | 9 + mln/value/int_u_sat.hh | 2 mln/value/label.hh | 2 mln/value/props.hh | 26 +-- mln/value/rgb.hh | 2 mln/value/rgb8_non_templated.hh | 2 tests/trait_images.cc | 10 - tests/trait_value.cc | 42 +++++ 69 files changed, 717 insertions(+), 534 deletions(-) Index: tests/trait_images.cc --- tests/trait_images.cc (revision 1263) +++ tests/trait_images.cc (working copy) @@ -25,9 +25,9 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/*! \file tests/trait_ch_value.cc +/*! \file tests/trait_images.cc * - * \brief Tests on mln::trait::ch_value. + * \brief Tests on mln::trait::images. */ #include <mln/core/image2d_b.hh> @@ -44,13 +44,13 @@ typedef image2d_b<int> I; std::cout << "image2d_b: "; - mln::trait::print<I>(std::cout); + mln::trait::image::print<I>(std::cout); std::cout << std::endl << "sub_image< image2d_b >: "; - mln::trait::print< sub_image<I, box2d> >(std::cout); + mln::trait::image::print< sub_image<I, box2d> >(std::cout); std::cout << std::endl << "image_if< image2d_b >: "; - mln::trait::print< image_if<I, fun::p2b::chess_t> >(std::cout); + mln::trait::image::print< image_if<I, fun::p2b::chess_t> >(std::cout); } Index: tests/trait_value.cc --- tests/trait_value.cc (revision 0) +++ tests/trait_value.cc (revision 0) @@ -0,0 +1,42 @@ +// 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 tests/trait_value.cc + * + * \brief Tests on mln::trait::ch_value. + */ + +#include <mln/value/int_u8.hh> + + +int main() +{ + using namespace mln; + + std::cout << "value::int_u8: "; + mln::trait::value::print< value::int_u8 >(std::cout); +} Index: mln/trait/image_from_mesh.hh --- mln/trait/image_from_mesh.hh (revision 1263) +++ mln/trait/image_from_mesh.hh (working copy) @@ -28,7 +28,7 @@ #ifndef MLN_TRAIT_IMAGE_FROM_MESH_HH # define MLN_TRAIT_IMAGE_FROM_MESH_HH -/*! \file mln/core/trait/image_from_mesh.hh +/*! \file mln/trait/image_from_mesh.hh * * \brief Definition of the "image from mesh" trait. */ Index: mln/trait/image/props.hh --- mln/trait/image/props.hh (revision 0) +++ mln/trait/image/props.hh (working copy) @@ -25,206 +25,149 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef MLN_TRAIT_IMAGES_HH -# define MLN_TRAIT_IMAGES_HH +#ifndef MLN_TRAIT_IMAGE_PROPS_HH +# define MLN_TRAIT_IMAGE_PROPS_HH -/*! \file mln/core/trait/images.hh +/*! \file mln/trait/image/props.hh * - * \brief Forward declarations of all image types. - * - * \todo Split this file into many. + * \brief Properties of image classes. */ -# include <iostream> # include <string> - -# include <mln/value/props.hh> - -# include <mln/metal/bexpr.hh> -# include <mln/metal/equal.hh> -# include <mln/metal/if.hh> -# include <mln/metal/is_const.hh> - - -# define mln_trait_image_category(I) typename mln::trait::image_< I >::category - -# define mln_trait_image_kind(I) typename mln::trait::image_< I >::kind -# define mln_trait_image_quant(I) typename mln::trait::image_< I >::quant -# define mln_trait_image_value(I) typename mln::trait::image_< I >::value - -# define mln_trait_image_access(I) typename mln::trait::image_< I >::access -# define mln_trait_image_space(I) typename mln::trait::image_< I >::space -# define mln_trait_image_size(I) typename mln::trait::image_< I >::size -# define mln_trait_image_support(I) typename mln::trait::image_< I >::support - -# define mln_trait_image_border(I) typename mln::trait::image_< I >::border -# define mln_trait_image_data(I) typename mln::trait::image_< I >::data -# define mln_trait_image_io(I) typename mln::trait::image_< I >::io -# define mln_trait_image_speed(I) typename mln::trait::image_< I >::speed - - -// for io: I const => read_only, otherwise like I -# define mln_trait_image_io_from_(I) \ -mlc_if( mlc_is_const(I), mln::trait::io::read_only, mln_trait_image_io(I) ) - -// for data: if raw or linear => stored, otherwise like I (i.e., either stored or computed) -#define mln_trait_image_data_from_(I) typename \ -mln::metal::if_< mln::metal::or_< mlc_equal( mln_trait_image_data(I), \ - mln::trait::data::raw), \ - mlc_equal( mln_trait_image_data(I), \ - mln::trait::data::linear) >, \ - mln::trait::data::stored, \ - mln_trait_image_data(I) >::ret +# include <mln/trait/value/kind.hh> namespace mln { - // Primitive types. - template <typename T> struct image1d_b; - template <typename T> struct image2d_b; - template <typename T> struct image3d_b; - namespace pw { template <typename F, typename S> struct image; } - template <typename P, typename T> class rle_image; - template <typename P, typename T> class sparse_image; - - // Morphers. - template <typename I, typename F> struct image_if_base; - template <typename I, typename D> class decorated_image; - template <typename I, typename S> class sub_image; - template <typename I> struct t_image; - template <typename I> class safe_image; - template <typename T, typename I> class cast_image_; - namespace value { template <unsigned n, typename I> struct stack_image; } - - - namespace trait { - struct undef { std::string str() const { return "undef"; } }; - - - template <typename I> - struct undefined_image_ + namespace image { - typedef undef category; // primary, domain_morpher, value_morpher, - // or identity_morpher < morpher - // related to I::value - typedef undef kind; // color, gray, binary < logic < label, data - typedef undef quant; // low or high - typedef undef value; // scalar, vectorial, structed, pointer - // FIXME: Make the difference between homogeneous and heterogeneous vectors... + // FIXME: For the record: - // related to I::pset - typedef undef access; // random, browsing - typedef undef space; // one_d, two_d, three_d - typedef undef size; // huge or regular - typedef undef support; // irregular, aligned < regular + // template <typename I> + // struct undefined_image_ + // { + // typedef undef category; // primary, domain_morpher, value_morpher, + // // or identity_morpher < morpher + + // // related to I::value + // typedef undef kind; // color, gray, binary < logic < label, data + // typedef undef quant; // low or high + // typedef undef value; // scalar, vectorial, structed, pointer + // // FIXME: Make the difference between homogeneous and heterogeneous vectors... + + // // related to I::pset + // typedef undef access; // random, browsing + // typedef undef space; // one_d, two_d, three_d + // typedef undef size; // huge or regular + // typedef undef support; // irregular, aligned < regular + + // // global + // typedef undef border; // none, stored, computed + // typedef undef data; // raw < linear < stored, computed + // typedef undef io; // read_only < read, write_only < write, read_write < both read'n write + // typedef undef speed; // slow, fast, or fastest + // }; - // global - typedef undef border; // none, stored, computed - typedef undef data; // raw < linear < stored, computed - typedef undef io; // read_only < read, write_only < write, read_write < both read'n write - typedef undef speed; // slow, fast, or fastest - }; - - - template <typename I> - struct image_ : undefined_image_<I> - { - }; + // FIXME: Add nice pictures of those hierarchies. struct category { struct any {}; - struct primary : any { std::string str() const { return "category::primary"; } }; + struct primary : any { std::string name() const { return "category::primary"; } }; struct morpher : any {}; struct domain_morpher - : morpher { std::string str() const { return "category::domain_morpher"; } }; + : morpher { std::string name() const { return "category::domain_morpher"; } }; struct value_morpher - : morpher { std::string str() const { return "category::value_morpher"; } }; + : morpher { std::string name() const { return "category::value_morpher"; } }; struct identity_morpher - : morpher { std::string str() const { return "category::identity_morpher"; } }; + : morpher { std::string name() const { return "category::identity_morpher"; } }; }; + + typedef mln::trait::value::kind kind; // Fetch the 'kind' structure from value traits. + + struct data { struct any {}; - struct computed : any { std::string str() const { return "data::computed"; } }; - struct stored : any { std::string str() const { return "data::stored"; } }; + struct computed : any { std::string name() const { return "data::computed"; } }; + struct stored : any { std::string name() const { return "data::stored"; } }; struct linear - : stored { std::string str() const { return "data::linear"; } }; + : stored { std::string name() const { return "data::linear"; } }; struct raw - : linear { std::string str() const { return "data::raw"; } }; + : linear { std::string name() const { return "data::raw"; } }; }; struct quant { struct any {}; - struct low : any { std::string str() const { return "quant::low"; } }; - struct high : any { std::string str() const { return "quant::high"; } }; + struct low : any { std::string name() const { return "quant::low"; } }; + struct high : any { std::string name() const { return "quant::high"; } }; }; struct value { struct any {}; - struct scalar : any { std::string str() const { return "value::scalar"; } }; - struct vectorial : any { std::string str() const { return "value::vectorial"; } }; - struct structed : any { std::string str() const { return "value::structed"; } }; - struct pointer : any { std::string str() const { return "value::pointer"; } }; + struct scalar : any { std::string name() const { return "value::scalar"; } }; + struct vectorial : any { std::string name() const { return "value::vectorial"; } }; + struct structed : any { std::string name() const { return "value::structed"; } }; + struct pointer : any { std::string name() const { return "value::pointer"; } }; struct fixme // So FIXME! - : any { std::string str() const { return "space::fixme"; } }; + : any { std::string name() const { return "space::fixme"; } }; }; struct access { struct any {}; - struct random : any { std::string str() const { return "access::random"; } }; - struct browsing : any { std::string str() const { return "access::browsing"; } }; + struct random : any { std::string name() const { return "access::random"; } }; + struct browsing : any { std::string name() const { return "access::browsing"; } }; }; struct space { struct any {}; - struct one_d : any { std::string str() const { return "space::one_d"; } }; - struct two_d : any { std::string str() const { return "space::two_d"; } }; - struct three_d : any { std::string str() const { return "space::three_d"; } }; + struct one_d : any { std::string name() const { return "space::one_d"; } }; + struct two_d : any { std::string name() const { return "space::two_d"; } }; + struct three_d : any { std::string name() const { return "space::three_d"; } }; struct fixme_ // So FIXME! - : any { std::string str() const { return "space::fixme_"; } }; + : any { std::string name() const { return "space::fixme_"; } }; }; struct size { struct any {}; - struct huge : any { std::string str() const { return "size::huge"; } }; - struct regular : any { std::string str() const { return "size::regular"; } }; + struct huge : any { std::string name() const { return "size::huge"; } }; + struct regular : any { std::string name() const { return "size::regular"; } }; }; struct support { struct any {}; - struct irregular : any { std::string str() const { return "support::irregular"; } }; - struct regular : any { std::string str() const { return "support::regular"; } }; + struct irregular : any { std::string name() const { return "support::irregular"; } }; + struct regular : any { std::string name() const { return "support::regular"; } }; struct aligned - : regular { std::string str() const { return "support::aligned"; } }; + : regular { std::string name() const { return "support::aligned"; } }; struct fixme_ // So FIXME! - : any { std::string str() const { return "support::fixme_"; } }; + : any { std::string name() const { return "support::fixme_"; } }; }; struct border { struct any {}; - struct none : any { std::string str() const { return "border::none"; } }; - struct stored : any { std::string str() const { return "border::stored"; } }; - struct computed : any { std::string str() const { return "border::computed"; } }; + struct none : any { std::string name() const { return "border::none"; } }; + struct stored : any { std::string name() const { return "border::stored"; } }; + struct computed : any { std::string name() const { return "border::computed"; } }; }; struct io @@ -233,84 +176,28 @@ struct read : virtual any {}; struct write : virtual any {}; struct read_only - : read { std::string str() const { return "io::read_only"; } }; + : read { std::string name() const { return "io::read_only"; } }; struct write_only - : write { std::string str() const { return "io::write_only"; } }; + : write { std::string name() const { return "io::write_only"; } }; struct read_write - : read, write { std::string str() const { return "io::read_write"; } }; + : read, write { std::string name() const { return "io::read_write"; } }; }; struct speed { struct any {}; - struct slow : any { std::string str() const { return "speed::slow"; } }; - struct fast : any { std::string str() const { return "speed::fast"; } }; + struct slow : any { std::string name() const { return "speed::slow"; } }; + struct fast : any { std::string name() const { return "speed::fast"; } }; struct fastest - : fast { std::string str() const { return "speed::fastest"; } }; + : fast { std::string name() const { return "speed::fastest"; } }; }; - - template <typename I> - void print(std::ostream& ostr) - { - typedef image_<I> the; - ostr << "{ " - << typename the::category().str() << ", " - << typename the::data().str() << ", " - << typename the::kind().str() << ", " - << typename the::quant().str() << ", " - << typename the::value().str() << ", " - << typename the::access().str() << ", " - << typename the::space().str() << ", " - << typename the::size().str() << ", " - << typename the::support().str() << ", " - << typename the::border().str() << ", " - << typename the::io().str() << ", " - << typename the::speed().str() << " }" << std::endl; - } - - - - template <typename T, typename I> - struct default_image_ : undefined_image_<I> - { - private: - typedef metal::bool_<( mln_value_card_(T) = 0 )> is_high_quant_; - public: - typedef mln_value_kind(T) kind; - typedef mlc_if( is_high_quant_, trait::quant::high, trait::quant::low ) quant; - // FIXME: typedef undef value; // scalar, vectorial, structed - - // speed is fast by default (neither "fastest" nor "slow") - typedef trait::speed::fast speed; - }; - - - template <typename D, typename T, typename I> - struct default_image_morpher_ : default_image_<T, I> - { - // value-related => delegation - typedef typename image_<D>::kind kind; - typedef typename image_<D>::quant quant; - typedef typename image_<D>::value value; - - // domain-related => delegation - typedef typename image_<D>::access access; - typedef typename image_<D>::space space; - typedef typename image_<D>::size size; - typedef typename image_<D>::support support; - - // mostly global-related => delegation - typedef typename image_<D>::border border; - typedef typename image_<D>::data data; - typedef typename image_<D>::io io; - }; - + } // end of namespace mln::trait::image } // end of namespace mln::trait } // end of namespace mln -#endif // ! MLN_TRAIT_IMAGES_HH +#endif // ! MLN_TRAIT_IMAGE_PROPS_HH Index: mln/trait/image/print.hh --- mln/trait/image/print.hh (revision 0) +++ mln/trait/image/print.hh (revision 0) @@ -0,0 +1,90 @@ +// 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_TRAIT_IMAGE_PRINT_HH +# define MLN_TRAIT_IMAGE_PRINT_HH + +/*! \file mln/trait/image/print.hh + * + * \brief Print the collection of traits for an image type. + */ + +# include <iostream> +# include <mln/trait/images.hh> +# include <mln/metal/is_a.hh> + + + +namespace mln +{ + + // Fwd decl. + template <typename E> struct Image; + + + namespace trait + { + + namespace image + { + + template <typename I> + void print(std::ostream& ostr); + + +# ifndef MLN_INCLUDE_ONLY + + template <typename I> + void print(std::ostream& ostr) + { + mlc_is_a(I, Image)::check(); + typedef mln::trait::image_<I> the; + ostr << "{ " + << typename the::category().name() << ", " + << typename the::data() .name() << ", " + << typename the::kind() .name() << ", " + << typename the::quant() .name() << ", " + << typename the::value() .name() << ", " + << typename the::access() .name() << ", " + << typename the::space() .name() << ", " + << typename the::size() .name() << ", " + << typename the::support() .name() << ", " + << typename the::border() .name() << ", " + << typename the::io() .name() << ", " + << typename the::speed() .name() << " }" << std::endl; + } + +# endif // ! MLN_INCLUDE_ONLY + + } // end of namespace mln::trait::image + + } // end of namespace mln::trait + +} // end of namespace mln + + +#endif // ! MLN_TRAIT_IMAGE_PRINT_HH Index: mln/trait/ch_value.hh --- mln/trait/ch_value.hh (revision 1263) +++ mln/trait/ch_value.hh (working copy) @@ -28,7 +28,7 @@ #ifndef MLN_TRAIT_CH_VALUE_HH # define MLN_TRAIT_CH_VALUE_HH -/*! \file mln/core/trait/ch_value.hh +/*! \file mln/trait/ch_value.hh * * \brief Definition of the "change value" image trait. */ Index: mln/trait/undef.hh --- mln/trait/undef.hh (revision 0) +++ mln/trait/undef.hh (revision 0) @@ -0,0 +1,52 @@ +// 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_TRAIT_UNDEF_HH +# define MLN_TRAIT_UNDEF_HH + +/*! \file mln/trait/undef.hh + * + * \brief Undefined flag type for a trait. + */ + +# include <string> + + +namespace mln +{ + + namespace trait + { + + struct undef { std::string name() const { return "undef"; } }; + + } // end of namespace mln::trait + +} // end of namespace mln + + +#endif // ! MLN_TRAIT_UNDEF_HH Index: mln/trait/concrete.hh --- mln/trait/concrete.hh (revision 1263) +++ mln/trait/concrete.hh (working copy) @@ -28,7 +28,7 @@ #ifndef MLN_TRAIT_CONCRETE_HH # define MLN_TRAIT_CONCRETE_HH -/*! \file mln/core/trait/concrete.hh +/*! \file mln/trait/concrete.hh * * \brief Definition of the concrete image trait. */ Index: mln/trait/images.hh --- mln/trait/images.hh (revision 1263) +++ mln/trait/images.hh (working copy) @@ -28,7 +28,7 @@ #ifndef MLN_TRAIT_IMAGES_HH # define MLN_TRAIT_IMAGES_HH -/*! \file mln/core/trait/images.hh +/*! \file mln/trait/images.hh * * \brief Forward declarations of all image types. * @@ -38,6 +38,8 @@ # include <iostream> # include <string> +# include <mln/trait/undef.hh> +# include <mln/trait/image/props.hh> # include <mln/value/props.hh> # include <mln/metal/bexpr.hh> @@ -65,15 +67,15 @@ // for io: I const => read_only, otherwise like I # define mln_trait_image_io_from_(I) \ -mlc_if( mlc_is_const(I), mln::trait::io::read_only, mln_trait_image_io(I) ) +mlc_if( mlc_is_const(I), mln::trait::image::io::read_only, mln_trait_image_io(I) ) // for data: if raw or linear => stored, otherwise like I (i.e., either stored or computed) #define mln_trait_image_data_from_(I) typename \ mln::metal::if_< mln::metal::or_< mlc_equal( mln_trait_image_data(I), \ - mln::trait::data::raw), \ + mln::trait::image::data::raw), \ mlc_equal( mln_trait_image_data(I), \ - mln::trait::data::linear) >, \ - mln::trait::data::stored, \ + mln::trait::image::data::linear) >, \ + mln::trait::image::data::stored, \ mln_trait_image_data(I) >::ret @@ -102,8 +104,6 @@ namespace trait { - struct undef { std::string str() const { return "undef"; } }; - template <typename I> struct undefined_image_ @@ -137,141 +137,6 @@ }; - - struct category - { - struct any {}; - struct primary : any { std::string str() const { return "category::primary"; } }; - struct morpher : any {}; - struct domain_morpher - : morpher { std::string str() const { return "category::domain_morpher"; } }; - struct value_morpher - : morpher { std::string str() const { return "category::value_morpher"; } }; - struct identity_morpher - : morpher { std::string str() const { return "category::identity_morpher"; } }; - }; - - struct data - { - struct any {}; - struct computed : any { std::string str() const { return "data::computed"; } }; - struct stored : any { std::string str() const { return "data::stored"; } }; - struct linear - : stored { std::string str() const { return "data::linear"; } }; - struct raw - : linear { std::string str() const { return "data::raw"; } }; - }; - - struct quant - { - struct any {}; - struct low : any { std::string str() const { return "quant::low"; } }; - struct high : any { std::string str() const { return "quant::high"; } }; - }; - - struct value - { - struct any {}; - struct scalar : any { std::string str() const { return "value::scalar"; } }; - struct vectorial : any { std::string str() const { return "value::vectorial"; } }; - struct structed : any { std::string str() const { return "value::structed"; } }; - struct pointer : any { std::string str() const { return "value::pointer"; } }; - - struct fixme // So FIXME! - : any { std::string str() const { return "space::fixme"; } }; - }; - - - struct access - { - struct any {}; - struct random : any { std::string str() const { return "access::random"; } }; - struct browsing : any { std::string str() const { return "access::browsing"; } }; - }; - - struct space - { - struct any {}; - struct one_d : any { std::string str() const { return "space::one_d"; } }; - struct two_d : any { std::string str() const { return "space::two_d"; } }; - struct three_d : any { std::string str() const { return "space::three_d"; } }; - - struct fixme_ // So FIXME! - : any { std::string str() const { return "space::fixme_"; } }; - }; - - struct size - { - struct any {}; - struct huge : any { std::string str() const { return "size::huge"; } }; - struct regular : any { std::string str() const { return "size::regular"; } }; - }; - - struct support - { - struct any {}; - struct irregular : any { std::string str() const { return "support::irregular"; } }; - struct regular : any { std::string str() const { return "support::regular"; } }; - struct aligned - : regular { std::string str() const { return "support::aligned"; } }; - - struct fixme_ // So FIXME! - : any { std::string str() const { return "support::fixme_"; } }; - }; - - struct border - { - struct any {}; - struct none : any { std::string str() const { return "border::none"; } }; - struct stored : any { std::string str() const { return "border::stored"; } }; - struct computed : any { std::string str() const { return "border::computed"; } }; - }; - - struct io - { - struct any {}; - struct read : virtual any {}; - struct write : virtual any {}; - struct read_only - : read { std::string str() const { return "io::read_only"; } }; - struct write_only - : write { std::string str() const { return "io::write_only"; } }; - struct read_write - : read, write { std::string str() const { return "io::read_write"; } }; - }; - - struct speed - { - struct any {}; - struct slow : any { std::string str() const { return "speed::slow"; } }; - struct fast : any { std::string str() const { return "speed::fast"; } }; - struct fastest - : fast { std::string str() const { return "speed::fastest"; } }; - }; - - - - template <typename I> - void print(std::ostream& ostr) - { - typedef image_<I> the; - ostr << "{ " - << typename the::category().str() << ", " - << typename the::data().str() << ", " - << typename the::kind().str() << ", " - << typename the::quant().str() << ", " - << typename the::value().str() << ", " - << typename the::access().str() << ", " - << typename the::space().str() << ", " - << typename the::size().str() << ", " - << typename the::support().str() << ", " - << typename the::border().str() << ", " - << typename the::io().str() << ", " - << typename the::speed().str() << " }" << std::endl; - } - - - template <typename T, typename I> struct default_image_ : undefined_image_<I> { @@ -279,11 +144,13 @@ typedef metal::bool_<( mln_value_card_(T) = 0 )> is_high_quant_; public: typedef mln_value_kind(T) kind; - typedef mlc_if( is_high_quant_, trait::quant::high, trait::quant::low ) quant; + typedef mlc_if( is_high_quant_, + trait::image::quant::high, + trait::image::quant::low ) quant; // FIXME: typedef undef value; // scalar, vectorial, structed // speed is fast by default (neither "fastest" nor "slow") - typedef trait::speed::fast speed; + typedef trait::image::speed::fast speed; }; @@ -313,4 +180,7 @@ } // end of namespace mln +# include <mln/trait/image/print.hh> + + #endif // ! MLN_TRAIT_IMAGES_HH Index: mln/trait/value_.hh --- mln/trait/value_.hh (revision 0) +++ mln/trait/value_.hh (revision 0) @@ -0,0 +1,80 @@ +// 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_TRAIT_VALUE__HH +# define MLN_TRAIT_VALUE__HH + +/*! \file mln/trait/images.hh + * + * \brief Forward declarations of all image types. + * + * \todo Split this file into many. + */ + +# include <iostream> +# include <string> + +# include <mln/trait/undef.hh> + +# include <mln/trait/value/nature.hh> +# include <mln/trait/value/kind.hh> + + +# define mln_trait_value_nature(I) typename mln::trait::value_< V >::nature +# define mln_trait_value_kind(V) typename mln::trait::value_< V >::kind + + +namespace mln +{ + + namespace trait + { + + + template <typename V> + struct undefined_value_ + { + typedef undef nature; + typedef undef kind; + }; + + + template <typename V> + struct value_ : undefined_value_<V> + { + }; + + + } // end of namespace mln::trait + +} // end of namespace mln + + +# include <mln/trait/value/print.hh> + + +#endif // ! MLN_TRAIT_VALUE__HH Index: mln/trait/value/kind.hh --- mln/trait/value/kind.hh (revision 0) +++ mln/trait/value/kind.hh (working copy) @@ -25,15 +25,14 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef MLN_TRAIT_KIND_HH -# define MLN_TRAIT_KIND_HH +#ifndef MLN_TRAIT_VALUE_KIND_HH +# define MLN_TRAIT_VALUE_KIND_HH -/*! \file mln/core/trait/kind.hh +/*! \file mln/trait/value/kind.hh * - * \brief Kind of values in images. + * \brief Kind of values (for use in images). */ -# include <iostream> # include <string> @@ -43,19 +42,28 @@ namespace trait { + namespace value + { + struct kind { - struct color { std::string str() const { return "kind::color"; } }; - struct gray { std::string str() const { return "kind::gray"; } }; - struct label { std::string str() const { return "kind::label"; } }; - struct logic : label { std::string str() const { return "kind::logic"; } }; - struct binary : logic { std::string str() const { return "kind::binary"; } }; - struct data { std::string str() const { return "kind::data"; } }; + struct any { std::string name() const { return "kind::any"; } }; + + struct color : any { std::string name() const { return "kind::color"; } }; + struct gray : any { std::string name() const { return "kind::gray"; } }; + + struct label : any { std::string name() const { return "kind::label"; } }; + struct logic : label { std::string name() const { return "kind::logic"; } }; + struct binary : logic { std::string name() const { return "kind::binary"; } }; + + struct data : any { std::string name() const { return "kind::data"; } }; }; + } // end of namespace mln::trait::kind + } // end of namespace mln::trait } // end of namespace mln -#endif // ! MLN_TRAIT_KIND_HH +#endif // ! MLN_TRAIT_VALUE_KIND_HH Index: mln/trait/value/print.hh --- mln/trait/value/print.hh (revision 0) +++ mln/trait/value/print.hh (revision 0) @@ -0,0 +1,80 @@ +// 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_TRAIT_VALUE_PRINT_HH +# define MLN_TRAIT_VALUE_PRINT_HH + +/*! \file mln/trait/values.hh + * + * \brief Print the collection of traits for an value type. + */ + +# include <iostream> +# include <mln/trait/value_.hh> +# include <mln/metal/is_a.hh> + + + +namespace mln +{ + + // Fwd decl. + template <typename E> struct Value; + + + namespace trait + { + + namespace value + { + + template <typename V> + void print(std::ostream& ostr); + + +# ifndef MLN_INCLUDE_ONLY + + template <typename V> + void print(std::ostream& ostr) + { + mlc_is_a(V, Value)::check(); + typedef mln::trait::value_<V> the; + ostr << "{ " + << typename the::nature().name() << ", " + << typename the::kind() .name() << " }" << std::endl; + } + +# endif // ! MLN_INCLUDE_ONLY + + } // end of namespace mln::trait::value + + } // end of namespace mln::trait + +} // end of namespace mln + + +#endif // ! MLN_TRAIT_VALUE_PRINT_HH Index: mln/trait/value/nature.hh --- mln/trait/value/nature.hh (revision 0) +++ mln/trait/value/nature.hh (revision 0) @@ -0,0 +1,68 @@ +// 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_TRAIT_VALUE_NATURE_HH +# define MLN_TRAIT_VALUE_NATURE_HH + +/*! \file mln/trait/value/nature.hh + * + * \brief Nature of values (for use in images). + */ + +# include <string> + + +namespace mln +{ + + namespace trait + { + + namespace value + { + + struct nature + { + struct any { std::string name() const { return "nature::any"; } }; + + struct scalar : any { std::string name() const { return "nature::scalar"; } }; + struct integer : scalar { std::string name() const { return "nature::integer"; } }; + struct floating : scalar { std::string name() const { return "nature::floating"; } }; + + struct vectorial : any { std::string name() const { return "nature::vectorial"; } }; + struct symbolic : any { std::string name() const { return "nature::symbolic"; } }; + struct structured : any { std::string name() const { return "nature::structured"; } }; + }; + + } // end of namespace mln::trait::value + + } // end of namespace mln::trait + +} // end of namespace mln + + +#endif // ! MLN_TRAIT_VALUE_NATURE_HH Index: mln/histo/compute.hh --- mln/histo/compute.hh (revision 1263) +++ mln/histo/compute.hh (working copy) @@ -54,7 +54,7 @@ { template <typename I> - data<mln_vset(I)> compute(mln::trait::speed::any, const I& input) + data<mln_vset(I)> compute(trait::image::speed::any, const I& input) { data<mln_vset(I)> h(input.values()); mln_piter(I) p(input.domain()); @@ -64,7 +64,7 @@ } template <typename I> - data<mln_vset(I)> compute(mln::trait::speed::fastest, const I& input) + data<mln_vset(I)> compute(trait::image::speed::fastest, const I& input) { data<mln_vset(I)> h(input.values()); mln_pixter(const I) p(input); Index: mln/debug/iota.hh --- mln/debug/iota.hh (revision 1263) +++ mln/debug/iota.hh (working copy) @@ -53,7 +53,7 @@ { template <typename I> - void iota(mln::trait::speed::any, I& input) + void iota(trait::image::speed::any, I& input) { unsigned i = 0; mln_piter(I) p(input.domain()); @@ -62,7 +62,7 @@ } template <typename I> - void iota(mln::trait::speed::fastest, I& input) + void iota(trait::image::speed::fastest, I& input) { unsigned i = 0; mln_pixter(I) p(input); Index: mln/debug/println_with_border.hh --- mln/debug/println_with_border.hh (revision 1263) +++ mln/debug/println_with_border.hh (working copy) @@ -114,7 +114,7 @@ template <typename I> void println_with_border(const Image<I>& input) { - mlc_is(mln_trait_image_speed(I), mln::trait::speed::fastest)::check(); + mlc_is(mln_trait_image_speed(I), trait::image::speed::fastest)::check(); impl::println_with_border(exact(input).bbox(), exact(input)); } Index: mln/core/internal/image_if_base.hh --- mln/core/internal/image_if_base.hh (revision 1263) +++ mln/core/internal/image_if_base.hh (working copy) @@ -72,17 +72,17 @@ { private: typedef mln_trait_image_data(I) I_data_; - typedef mlc_equal(I_data_, trait::data::linear) I_data_are_linear_; + typedef mlc_equal(I_data_, trait::image::data::linear) I_data_are_linear_; public: - typedef trait::category::domain_morpher category; + typedef trait::image::category::domain_morpher category; typedef mlc_if( mlc_is_const(I), - trait::io::read_only, // I const => read_only + trait::image::io::read_only, // I const => read_only mln_trait_image_io(I) ) io; // otherwise like I typedef mlc_if( I_data_are_linear_, - trait::data::stored, // if linear then just stored + trait::image::data::stored, // if linear then just stored I_data_ ) data; // otherwise like I }; Index: mln/core/internal/check/image_all.hh --- mln/core/internal/check/image_all.hh (revision 1263) +++ mln/core/internal/check/image_all.hh (working copy) @@ -53,7 +53,7 @@ struct image_all_ : public image_fastest_< E, typename mlc_equal(mln_trait_image_speed(E), - trait::speed::fastest)::eval > + trait::image::speed::fastest)::eval > // , ... { }; Index: mln/core/image2d_b.hh --- mln/core/image2d_b.hh (revision 1263) +++ mln/core/image2d_b.hh (working copy) @@ -87,17 +87,17 @@ template <typename T> struct image_< image2d_b<T> > : default_image_< T, image2d_b<T> > { - typedef trait::category::primary category; + typedef trait::image::category::primary category; - typedef trait::access::random access; - typedef trait::space::two_d space; - typedef trait::size::regular size; - typedef trait::support::aligned support; - - typedef trait::border::stored border; - typedef trait::data::raw data; - typedef trait::io::read_write io; - typedef trait::speed::fastest speed; + typedef trait::image::access::random access; + typedef trait::image::space::two_d space; + typedef trait::image::size::regular size; + typedef trait::image::support::aligned support; + + typedef trait::image::border::stored border; + typedef trait::image::data::raw data; + typedef trait::image::io::read_write io; + typedef trait::image::speed::fastest speed; }; } // end of namespace mln::trait Index: mln/core/sub_image.hh --- mln/core/sub_image.hh (revision 1263) +++ mln/core/sub_image.hh (working copy) @@ -67,9 +67,9 @@ // typedef mlc_equal(I_data_, trait::data::linear) I_data_are_linear_; // public: - typedef trait::category::domain_morpher category; + typedef trait::image::category::domain_morpher category; - typedef trait::border::none border; // no more accessible border + typedef trait::image::border::none border; // no more accessible border typedef mln_trait_image_io_from_(I) io; // un-write when I const Index: mln/core/concept/value.hh --- mln/core/concept/value.hh (revision 1263) +++ mln/core/concept/value.hh (working copy) @@ -33,6 +33,7 @@ */ # include <mln/core/concept/object.hh> +# include <mln/trait/value_.hh> namespace mln Index: mln/core/image1d_b.hh --- mln/core/image1d_b.hh (revision 1263) +++ mln/core/image1d_b.hh (working copy) @@ -88,17 +88,17 @@ template <typename T> struct image_< image1d_b<T> > : default_image_< T, image1d_b<T> > { - typedef trait::category::primary category; + typedef trait::image::category::primary category; - typedef trait::access::random access; - typedef trait::space::one_d space; - typedef trait::size::regular size; - typedef trait::support::aligned support; - - typedef trait::border::stored border; - typedef trait::data::raw data; - typedef trait::io::read_write io; - typedef trait::speed::fastest speed; + typedef trait::image::access::random access; + typedef trait::image::space::one_d space; + typedef trait::image::size::regular size; + typedef trait::image::support::aligned support; + + typedef trait::image::border::stored border; + typedef trait::image::data::raw data; + typedef trait::image::io::read_write io; + typedef trait::image::speed::fastest speed; }; } // end of namespace mln::trait Index: mln/core/image3d_b.hh --- mln/core/image3d_b.hh (revision 1263) +++ mln/core/image3d_b.hh (working copy) @@ -89,17 +89,17 @@ template <typename T> struct image_< image3d_b<T> > : default_image_< T, image3d_b<T> > { - typedef trait::category::primary category; + typedef trait::image::category::primary category; - typedef trait::access::random access; - typedef trait::space::three_d space; - typedef trait::size::regular size; - typedef trait::support::aligned support; - - typedef trait::border::stored border; - typedef trait::data::raw data; - typedef trait::io::read_write io; - typedef trait::speed::fastest speed; + typedef trait::image::access::random access; + typedef trait::image::space::three_d space; + typedef trait::image::size::regular size; + typedef trait::image::support::aligned support; + + typedef trait::image::border::stored border; + typedef trait::image::data::raw data; + typedef trait::image::io::read_write io; + typedef trait::image::speed::fastest speed; }; } // end of namespace mln::trait Index: mln/metal/mat.hh --- mln/metal/mat.hh (revision 1263) +++ mln/metal/mat.hh (working copy) @@ -150,7 +150,7 @@ template <unsigned n, unsigned m, typename T> struct props< metal::mat<n,m,T> > { - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; static const std::size_t card_ = n * m * mln_card_(T); typedef metal::mat<n,m, mln_value_sum(T)> sum; }; Index: mln/metal/vec.hh --- mln/metal/vec.hh (revision 1263) +++ mln/metal/vec.hh (working copy) @@ -229,7 +229,7 @@ template <unsigned n, typename T> struct props< metal::vec<n,T> > { - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; static const std::size_t card_ = n * mln_card_(T); typedef metal::vec<n, mln_value_sum(T)> sum; }; Index: mln/arith/plus.hh --- mln/arith/plus.hh (revision 1263) +++ mln/arith/plus.hh (working copy) @@ -107,9 +107,9 @@ { template <typename L, typename R, typename O> - void plus_(mln::trait::speed::any, const L& lhs, - mln::trait::speed::any, const R& rhs, - mln::trait::speed::any, O& output) + void plus_(trait::image::speed::any, const L& lhs, + trait::image::speed::any, const R& rhs, + trait::image::speed::any, O& output) { mln_piter(L) p(lhs.domain()); for_all(p) @@ -117,9 +117,9 @@ } template <typename L, typename R, typename O> - void plus_(mln::trait::speed::fastest, const L& lhs, - mln::trait::speed::fastest, const R& rhs, - mln::trait::speed::fastest, O& output) + void plus_(trait::image::speed::fastest, const L& lhs, + trait::image::speed::fastest, const R& rhs, + trait::image::speed::fastest, O& output) { mln_pixter(const L) lp(lhs); mln_pixter(const R) rp(rhs); @@ -129,8 +129,8 @@ } template <typename L, typename R> - void plus_inplace_(mln::trait::speed::any, L& lhs, - mln::trait::speed::any, const R& rhs) + void plus_inplace_(trait::image::speed::any, L& lhs, + trait::image::speed::any, const R& rhs) { mln_piter(R) p(rhs.domain()); for_all(p) @@ -138,8 +138,8 @@ } template <typename L, typename R> - void plus_inplace_(mln::trait::speed::fastest, L& lhs, - mln::trait::speed::fastest, const R& rhs) + void plus_inplace_(trait::image::speed::fastest, L& lhs, + trait::image::speed::fastest, const R& rhs) { mln_pixter(L) lp(lhs); mln_pixter(const R) rp(rhs); @@ -178,9 +178,8 @@ void plus_cst(const Image<I>& input, const V& val, Image<O>& output) { mln_precondition(exact(output).domain() = exact(input).domain()); - trait::speed::any any; impl::plus_(mln_trait_image_speed(I)(), exact(input), - any, pw::cst(val) | exact(input).domain(), + trait::image::speed::any(), pw::cst(val) | exact(input).domain(), mln_trait_image_speed(O)(), exact(output)); // Calls the previous version. } @@ -196,9 +195,8 @@ void plus_cst_inplace(Image<I>& input, const V& val) { mln_precondition(exact(input).has_data()); - trait::speed::any any; plus_inplace(mln_trait_image_speed(I)(), exact(input), - any, pw::cst(val) | exact(input).domain()); + trait::image::speed::any(), pw::cst(val) | exact(input).domain()); // Calls the previous version. } Index: mln/arith/min.hh --- mln/arith/min.hh (revision 1263) +++ mln/arith/min.hh (working copy) @@ -76,9 +76,9 @@ { template <typename L, typename R, typename O> - void min_(mln::trait::speed::any, const L& lhs, - mln::trait::speed::any, const R& rhs, - mln::trait::speed::any, O& output) + void min_(trait::image::speed::any, const L& lhs, + trait::image::speed::any, const R& rhs, + trait::image::speed::any, O& output) { mln_piter(L) p(lhs.domain()); for_all(p) @@ -86,9 +86,9 @@ } template <typename L, typename R, typename O> - void min_(mln::trait::speed::fastest, const L& lhs, - mln::trait::speed::fastest, const R& rhs, - mln::trait::speed::fastest, O& output) + void min_(trait::image::speed::fastest, const L& lhs, + trait::image::speed::fastest, const R& rhs, + trait::image::speed::fastest, O& output) { mln_pixter(const L) lp(lhs); mln_pixter(const R) rp(rhs); @@ -98,8 +98,8 @@ } template <typename L, typename R> - void min_inplace_(mln::trait::speed::any, L& lhs, - mln::trait::speed::any, const R& rhs) + void min_inplace_(trait::image::speed::any, L& lhs, + trait::image::speed::any, const R& rhs) { mln_piter(R) p(rhs.domain()); for_all(p) @@ -108,8 +108,8 @@ } template <typename L, typename R> - void min_inplace_(mln::trait::speed::fastest, L& lhs, - mln::trait::speed::fastest, const R& rhs) + void min_inplace_(trait::image::speed::fastest, L& lhs, + trait::image::speed::fastest, const R& rhs) { mln_pixter(L) lp(lhs); mln_pixter(const R) rp(rhs); Index: mln/arith/revert.hh --- mln/arith/revert.hh (revision 1263) +++ mln/arith/revert.hh (working copy) @@ -78,8 +78,8 @@ { template <typename I, typename O> - void revert_(mln::trait::speed::any, const I& input, - mln::trait::speed::any, O& output) + void revert_(trait::image::speed::any, const I& input, + trait::image::speed::any, O& output) { typedef mln_value(I) V; mln_piter(I) p(input.domain()); @@ -88,8 +88,8 @@ } template <typename I, typename O> - void revert_(mln::trait::speed::fastest, const I& input, - mln::trait::speed::fastest, O& output) + void revert_(trait::image::speed::fastest, const I& input, + trait::image::speed::fastest, O& output) { typedef mln_value(I) V; mln_pixter(const I) ip(input); Index: mln/arith/minus.hh --- mln/arith/minus.hh (revision 1263) +++ mln/arith/minus.hh (working copy) @@ -75,9 +75,9 @@ { template <typename L, typename R, typename O> - void minus_(mln::trait::speed::any, const L& lhs, - mln::trait::speed::any, const R& rhs, - mln::trait::speed::any, O& output) + void minus_(trait::image::speed::any, const L& lhs, + trait::image::speed::any, const R& rhs, + trait::image::speed::any, O& output) { mln_piter(L) p(lhs.domain()); for_all(p) @@ -85,9 +85,9 @@ } template <typename L, typename R, typename O> - void minus_(mln::trait::speed::fastest, const L& lhs, - mln::trait::speed::fastest, const R& rhs, - mln::trait::speed::fastest, O& output) + void minus_(trait::image::speed::fastest, const L& lhs, + trait::image::speed::fastest, const R& rhs, + trait::image::speed::fastest, O& output) { mln_pixter(const L) lp(lhs); mln_pixter(const R) rp(rhs); @@ -97,8 +97,8 @@ } template <typename L, typename R> - void minus_inplace_(mln::trait::speed::any, L& lhs, - mln::trait::speed::any, const R& rhs) + void minus_inplace_(trait::image::speed::any, L& lhs, + trait::image::speed::any, const R& rhs) { mln_piter(R) p(rhs.domain()); for_all(p) @@ -106,8 +106,8 @@ } template <typename L, typename R> - void minus_inplace_(mln::trait::speed::fastest, L& lhs, - mln::trait::speed::fastest, const R& rhs) + void minus_inplace_(trait::image::speed::fastest, L& lhs, + trait::image::speed::fastest, const R& rhs) { mln_pixter(L) lp(lhs); mln_pixter(const R) rp(rhs); Index: mln/level/take.hh --- mln/level/take.hh (revision 1263) +++ mln/level/take.hh (working copy) @@ -63,7 +63,7 @@ { template <typename A, typename I> - void take(mln::trait::speed::any, const I& input, A& a) + void take(trait::image::speed::any, const I& input, A& a) { mln_piter(I) p(input.domain()); for_all(p) @@ -71,7 +71,7 @@ } template <typename A, typename I> - void take(mln::trait::speed::fastest, const I& input, A& a) + void take(trait::image::speed::fastest, const I& input, A& a) { mln_pixter(const I) pxl(input); for_all(pxl) Index: mln/level/assign.hh --- mln/level/assign.hh (revision 1263) +++ mln/level/assign.hh (working copy) @@ -65,8 +65,8 @@ { template <typename L, typename R> - void assign(mln::trait::speed::any, L& target, - mln::trait::speed::any, const R& data) + void assign(trait::image::speed::any, L& target, + trait::image::speed::any, const R& data) { mln_piter(L) p(target.domain()); for_all(p) @@ -74,8 +74,8 @@ } template <typename L, typename R> - void assign(mln::trait::speed::fastest, L& target, - mln::trait::speed::fastest, const R& data) + void assign(trait::image::speed::fastest, L& target, + trait::image::speed::fastest, const R& data) { mln_pixter(L) lhs(target); mln_pixter(const R) rhs(data); Index: mln/level/apply.hh --- mln/level/apply.hh (revision 1263) +++ mln/level/apply.hh (working copy) @@ -67,7 +67,7 @@ { template <typename I, typename F> - void apply_(mln::trait::speed::any, I& input, const F& f) + void apply_(trait::image::speed::any, I& input, const F& f) { mln_piter(I) p(input.domain()); for_all(p) @@ -75,7 +75,7 @@ } template <typename I, typename F> - void apply_(mln::trait::speed::fastest, I& input, const F& f) + void apply_(trait::image::speed::fastest, I& input, const F& f) { mln_pixter(I) pxl(input); for_all(pxl) Index: mln/level/fill.hh --- mln/level/fill.hh (revision 1263) +++ mln/level/fill.hh (working copy) @@ -132,7 +132,7 @@ // fill_with_value template <typename I> - void fill_with_value(mln::trait::speed::any, I& ima, + void fill_with_value(trait::image::speed::any, I& ima, const mln_value(I)& value) { mln_piter(I) p(ima.domain()); @@ -141,7 +141,7 @@ } template <typename I> - void fill_with_value(mln::trait::speed::fastest, I& ima, + void fill_with_value(trait::image::speed::fastest, I& ima, const mln_value(I)& value) { level::memset_(ima, ima.point_at_offset(0), value, ima.ncells()); @@ -157,7 +157,7 @@ template <typename I> void fill(Image<I>& ima, const mln_value(I)& value) { - mlc_is(mln_trait_image_io(I), trait::io::write)::check(); // FIXME: Only the upcoming general facade!!! + mlc_is(mln_trait_image_io(I), trait::image::io::write)::check(); // FIXME: Only the upcoming general facade!!! mln_precondition(exact(ima).has_data()); impl::fill_with_value(mln_trait_image_speed(I)(), exact(ima), value); Index: mln/level/memset_.hh --- mln/level/memset_.hh (revision 1263) +++ mln/level/memset_.hh (working copy) @@ -114,7 +114,7 @@ void memset_(I& input, const mln_point(I)& p, const mln_value(I)& v, std::size_t n) { - mlc_is(mln_trait_image_speed(I), trait::speed::fastest)::check(); + mlc_is(mln_trait_image_speed(I), trait::image::speed::fastest)::check(); mln_precondition(input.has_data()); mln_precondition(input.owns_(p)); Index: mln/level/median.hh --- mln/level/median.hh (revision 1263) +++ mln/level/median.hh (working copy) @@ -283,8 +283,8 @@ { trace::entering("level::median_dir"); - mlc_is(mln_trait_image_io(O), trait::io::write)::check(); - mlc_is(mln_trait_image_support(I), trait::support::aligned)::check(); + mlc_is(mln_trait_image_io(O), trait::image::io::write)::check(); + mlc_is(mln_trait_image_support(I), trait::image::support::aligned)::check(); mlc_converts_to(mln_value(I), mln_value(O))::check(); mln_precondition(exact(output).domain() = exact(input).domain()); Index: mln/level/paste.spe.hh --- mln/level/paste.spe.hh (revision 1263) +++ mln/level/paste.spe.hh (working copy) @@ -79,15 +79,15 @@ // Remember: raw < linear < stored, computed. template <typename I, typename J> - void paste_(mln::trait::data::any, const I& data, - mln::trait::data::any, J& destination) + void paste_(trait::image::data::any, const I& data, + trait::image::data::any, J& destination) { generic::paste_(data, destination); } template <typename I, typename J> - void paste_(mln::trait::data::raw, const I& data, - mln::trait::data::raw, J& destination) + void paste_(trait::image::data::raw, const I& data, + trait::image::data::raw, J& destination) { if (sizeof(mln_value(I)) = sizeof(mln_value(J))) paste_lines_(data, destination); Index: mln/level/paste.hh --- mln/level/paste.hh (revision 1263) +++ mln/level/paste.hh (working copy) @@ -103,7 +103,7 @@ J& destination = exact(destination_); trace::entering("level::paste"); - mlc_is(mln_trait_image_io(J), trait::io::write)::check(); + mlc_is(mln_trait_image_io(J), trait::image::io::write)::check(); mlc_converts_to(mln_value(I), mln_value(J))::check(); mln_precondition(data.domain() <= destination.domain()); Index: mln/linear/convolve.hh --- mln/linear/convolve.hh (revision 1263) +++ mln/linear/convolve.hh (working copy) @@ -67,9 +67,9 @@ { template <typename I, typename W, typename O> - void convolve_(mln::trait::speed::any, const I& input, + void convolve_(trait::image::speed::any, const I& input, const Weighted_Window<W>& w_win_, - mln::trait::speed::any, O& output) + trait::image::speed::any, O& output) { const W& w_win = exact(w_win_); @@ -86,9 +86,9 @@ } template <typename I, typename W, typename O> - void convolve_(mln::trait::speed::fastest, const I& input, + void convolve_(trait::image::speed::fastest, const I& input, const Weighted_Window<W>& w_win_, - mln::trait::speed::fastest, O& output) + trait::image::speed::fastest, O& output) { const W& w_win = exact(w_win_); Index: mln/linear/local/convolve.hh --- mln/linear/local/convolve.hh (revision 1263) +++ mln/linear/local/convolve.hh (working copy) @@ -87,7 +87,7 @@ { template <typename I, typename P, typename W, typename R> - void convolve(mln::trait::speed::any, const I& input, + void convolve(trait::image::speed::any, const I& input, const Generalized_Point<P>& p_, const W& w_win, R& result) @@ -102,7 +102,7 @@ } template <typename I, typename P, typename W, typename R> - void convolve(mln::trait::speed::fastest, const I& input, + void convolve(trait::image::speed::fastest, const I& input, const Generalized_Point<P>& p_, const W& w_win, R& result) Index: mln/value/graylevel.hh --- mln/value/graylevel.hh (revision 1263) +++ mln/value/graylevel.hh (working copy) @@ -90,7 +90,7 @@ static const graylevel<n> min() { return 0; } static const graylevel<n> max() { return card_ - 1; } static const unsigned nbits = n; - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; typedef float sum; typedef int interop; }; Index: mln/value/float01_.hh --- mln/value/float01_.hh (revision 1263) +++ mln/value/float01_.hh (working copy) @@ -118,7 +118,7 @@ static const int min() { return 0; } static const int max() { return 1; } static const unsigned nbits = n; - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; typedef float sum; typedef float interop; }; Index: mln/value/int_s.hh --- mln/value/int_s.hh (revision 1263) +++ mln/value/int_s.hh (working copy) @@ -149,7 +149,7 @@ static const int_s<n> max() { return metal::pow<2, n-1>::value - 1; } static const int_s<n> min() { return - max(); } static const unsigned nbits = n; - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; typedef float sum; }; Index: mln/value/int_u.hh --- mln/value/int_u.hh (revision 1263) +++ mln/value/int_u.hh (working copy) @@ -80,6 +80,13 @@ // FIXME: Is that all? (No!) + template <unsigned n> + struct value_< mln::value::int_u<n> > + { + typedef trait::value::nature::integer nature; + typedef trait::value::kind::data kind; + }; + } // end of namespace mln::trait @@ -142,7 +149,7 @@ static const int_u<n> min() { return 0; } static const int_u<n> max() { return card_ - 1; } static const unsigned nbits = n; - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; typedef float sum; typedef int interop; }; Index: mln/value/int_u_sat.hh --- mln/value/int_u_sat.hh (revision 1263) +++ mln/value/int_u_sat.hh (working copy) @@ -104,7 +104,7 @@ static const int_u_sat<n> min() { return 0; } static const int_u_sat<n> max() { return card_ - 1; } static const unsigned nbits = n; - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; typedef float sum; }; Index: mln/value/props.hh --- mln/value/props.hh (revision 1263) +++ mln/value/props.hh (working copy) @@ -40,7 +40,7 @@ # include <mln/core/macros.hh> # include <mln/metal/bool.hh> -# include <mln/trait/kind.hh> +# include <mln/trait/value/kind.hh> /// Get the minimum value of type \c T. @@ -85,7 +85,7 @@ template <typename T> struct props { - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; static const std::size_t card_ = 0; }; @@ -117,7 +117,7 @@ static const bool min() { return false; } static const bool max() { return true; } static const std::size_t card_ = 2; - typedef trait::kind::binary kind; + typedef trait::value::kind::binary kind; }; @@ -129,7 +129,7 @@ static const unsigned char min() { return 0; } static const unsigned char max() { return 255; } static const std::size_t card_ = 256; - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; typedef float sum; }; @@ -139,7 +139,7 @@ static const signed char min() { return -128; } static const signed char max() { return 127; } static const std::size_t card_ = 256; - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; typedef float sum; }; @@ -149,7 +149,7 @@ static const unsigned short min() { return 0; } static const unsigned short max() { return 65535; } static const std::size_t card_ = 65536; - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; typedef float sum; }; @@ -159,7 +159,7 @@ static const signed short min() { return -32768; } static const signed short max() { return 32767; } static const std::size_t card_ = 65536; - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; typedef float sum; }; @@ -168,7 +168,7 @@ { static const unsigned int min() { return 0; } static const unsigned int max() { return UINT_MAX; } - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; static const std::size_t card_ = 0; typedef float sum; }; @@ -178,7 +178,7 @@ { static const signed int min() { return INT_MIN; } static const signed int max() { return INT_MAX; } - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; static const std::size_t card_ = 0; typedef float sum; }; @@ -188,7 +188,7 @@ { static const unsigned long int min() { return 0; } static const unsigned long int max() { return ULONG_MAX; } - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; static const std::size_t card_ = 0; typedef float sum; }; @@ -198,7 +198,7 @@ { static const signed long int min() { return LONG_MIN; } static const signed long int max() { return LONG_MAX; } - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; static const std::size_t card_ = 0; typedef float sum; }; @@ -212,7 +212,7 @@ static const float min() { return FLT_MIN; } static const float max() { return FLT_MAX; } static const float epsilon() { return 0.00001f; } - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; static const std::size_t card_ = 0; typedef float sum; }; @@ -223,7 +223,7 @@ static const double min() { return DBL_MIN; } static const double max() { return DBL_MAX; } static const double epsilon() { return 0.0000001; } - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; static const std::size_t card_ = 0; typedef double sum; }; Index: mln/value/rgb.hh --- mln/value/rgb.hh (revision 1263) +++ mln/value/rgb.hh (working copy) @@ -134,7 +134,7 @@ { static const unsigned nbits = 24; static const std::size_t card_ = 0; // FIXME: was: metal::pow<2, nbits>::value; - typedef trait::kind::color kind; + typedef trait::value::kind::color kind; typedef float_x3_t sum; typedef uchar_x3_t interop; Index: mln/value/rgb8_non_templated.hh --- mln/value/rgb8_non_templated.hh (revision 1263) +++ mln/value/rgb8_non_templated.hh (working copy) @@ -106,7 +106,7 @@ { static const unsigned nbits = 24; static const std::size_t card_ = metal::pow<2, nbits>::value; - typedef trait::kind::color kind; + typedef trait::value::kind::color kind; typedef float_x3_t sum; typedef uchar_x3_t interop; }; Index: mln/value/float01_f.hh --- mln/value/float01_f.hh (revision 1263) +++ mln/value/float01_f.hh (working copy) @@ -78,7 +78,7 @@ static const float min() { return 0; } static const float max() { return 1; } //static const unsigned nbits = n; - typedef trait::kind::data kind; + typedef trait::value::kind::data kind; typedef float sum; typedef float interop; }; Index: mln/value/label.hh --- mln/value/label.hh (revision 1263) +++ mln/value/label.hh (working copy) @@ -133,7 +133,7 @@ static const label<n> min; // = 0 static const label<n> max; // = card_ - 1 static const unsigned nbits = n; - typedef trait::kind::label kind; + typedef trait::value::kind::label kind; }; Index: mln/border/resize.hh --- mln/border/resize.hh (revision 1263) +++ mln/border/resize.hh (working copy) @@ -65,7 +65,7 @@ template <typename I> void resize(const Image<I>& ima_, unsigned thickness) { - mlc_is(mln_trait_image_speed(I), mln::trait::speed::fastest)::check(); + mlc_is(mln_trait_image_speed(I), trait::image::speed::fastest)::check(); const I& ima = exact(ima_); mln_precondition(ima.has_data()); if (ima.border() >= thickness) Index: mln/border/fill.hh --- mln/border/fill.hh (revision 1263) +++ mln/border/fill.hh (working copy) @@ -111,7 +111,7 @@ typedef mln_point(I) P; const I& ima = exact(ima_); - mlc_is(mln_trait_image_speed(I), mln::trait::speed::fastest)::check(); + mlc_is(mln_trait_image_speed(I), trait::image::speed::fastest)::check(); mln_precondition(ima.has_data()); if (!ima.border ()) return; Index: mln/border/duplicate.hh --- mln/border/duplicate.hh (revision 1263) +++ mln/border/duplicate.hh (working copy) @@ -190,7 +190,7 @@ template <typename I> void duplicate(const Image<I>& ima_) { - mlc_is(mln_trait_image_speed(I), mln::trait::speed::fastest)::check(); + mlc_is(mln_trait_image_speed(I), trait::image::speed::fastest)::check(); const I& ima = exact(ima_); typedef mln_point(I) P; trace::entering("border::duplicate"); Index: mln/border/mirror.hh --- mln/border/mirror.hh (revision 1263) +++ mln/border/mirror.hh (working copy) @@ -63,7 +63,7 @@ { const I& ima = exact(ima_); - mlc_is(mln_trait_image_speed(I), mln::trait::speed::fastest)::check(); + mlc_is(mln_trait_image_speed(I), trait::image::speed::fastest)::check(); mln_precondition(ima.has_data()); mln::internal::fixme(); Index: mln/border/get.hh --- mln/border/get.hh (revision 1263) +++ mln/border/get.hh (working copy) @@ -69,13 +69,13 @@ } template <typename I> - unsigned get_(mln::trait::speed::any, const I& ima) + unsigned get_(trait::image::speed::any, const I& ima) { return border::impl::get__(ima); } template <typename I> - unsigned get_(mln::trait::speed::fastest, const I& ima) + unsigned get_(trait::image::speed::fastest, const I& ima) { return ima.border(); } Index: mln/test/predicate.hh --- mln/test/predicate.hh (revision 1263) +++ mln/test/predicate.hh (working copy) @@ -69,7 +69,7 @@ { template <typename I, typename F> - bool predicate_(mln::trait::speed::any, const I& ima_, const F& f) + bool predicate_(trait::image::speed::any, const I& ima_, const F& f) { const I& ima = exact(ima_); mln_piter(I) p(ima.domain()); @@ -80,7 +80,7 @@ } template <typename I, typename F> - bool predicate_(mln::trait::speed::fastest, const I& ima_, const F& f) + bool predicate_(trait::image::speed::fastest, const I& ima_, const F& f) { const I& ima = exact(ima_); mln_pixter(const I) pxl(ima); Index: mln/pw/image.hh --- mln/pw/image.hh (revision 1263) +++ mln/pw/image.hh (working copy) @@ -81,18 +81,18 @@ struct image_< pw::image<F,S> > : default_image_< mlc_unqualif(mln_result(F)), pw::image<F,S> > { - typedef trait::category::primary category; + typedef trait::image::category::primary category; - typedef trait::value::fixme value; + typedef trait::image::value::fixme value; - typedef trait::access::browsing access; - typedef trait::space::fixme_ space; - typedef trait::size::regular size; - typedef trait::support::fixme_ support; - - typedef trait::border::none border; - typedef trait::data::computed data; - typedef trait::io::read_only io; + typedef trait::image::access::browsing access; + typedef trait::image::space::fixme_ space; + typedef trait::image::size::regular size; + typedef trait::image::support::fixme_ support; + + typedef trait::image::border::none border; + typedef trait::image::data::computed data; + typedef trait::image::io::read_only io; }; } // end of namespace mln::trait Index: mln/morpho/min.hh --- mln/morpho/min.hh (revision 1263) +++ mln/morpho/min.hh (working copy) @@ -60,7 +60,7 @@ { template <typename I, typename J, typename O> - void min_(trait::kind::logic, // binary => morphology on sets + void min_(trait::image::kind::logic, // binary => morphology on sets const Image<I>& lhs, const Image<J>& rhs, Image<O>& output) { @@ -78,7 +78,7 @@ // in place template <typename I, typename J> - void min_inplace_(trait::kind::logic, // binary => morphology on sets + void min_inplace_(trait::image::kind::logic, // binary => morphology on sets Image<I>& lhs, const Image<J>& rhs) { return logical::and_inplace(lhs, rhs); Index: mln/morpho/plus.hh --- mln/morpho/plus.hh (revision 1263) +++ mln/morpho/plus.hh (working copy) @@ -60,7 +60,7 @@ { template <typename I, typename J, typename O> - void plus_(trait::kind::logic, // binary => morphology on sets + void plus_(trait::image::kind::logic, // binary => morphology on sets const Image<I>& lhs, const Image<J>& rhs, Image<O>& output) { Index: mln/morpho/minus.hh --- mln/morpho/minus.hh (revision 1263) +++ mln/morpho/minus.hh (working copy) @@ -60,7 +60,7 @@ { template <typename I, typename J, typename O> - void minus_(trait::kind::logic, // binary => morphology on sets + void minus_(trait::image::kind::logic, // binary => morphology on sets const Image<I>& lhs, const Image<J>& rhs, Image<O>& output) { Index: mln/morpho/complementation.hh --- mln/morpho/complementation.hh (revision 1263) +++ mln/morpho/complementation.hh (working copy) @@ -61,7 +61,7 @@ { template <typename I, typename O> - void complementation_(trait::kind::logic, // binary => morphology on sets + void complementation_(trait::image::kind::logic, // binary => morphology on sets const Image<I>& input, Image<O>& output) { Index: mln/morpho/dilation.hh --- mln/morpho/dilation.hh (revision 1263) +++ mln/morpho/dilation.hh (working copy) @@ -112,7 +112,7 @@ // Stage 2: dispatch w.r.t. the value kind. template <typename I, typename W, typename O> - void dilation_wrt_value(trait::kind::logic, // binary => morphology on sets + void dilation_wrt_value(trait::image::kind::logic, // binary => morphology on sets const Image<I>& input, const Window<W>& win, Image<O>& output) { return impl::dilation_on_set(exact(input), exact(win), output); Index: mln/morpho/erosion.hh --- mln/morpho/erosion.hh (revision 1263) +++ mln/morpho/erosion.hh (working copy) @@ -115,7 +115,7 @@ // Stage 2: dispatch w.r.t. the value kind. template <typename I, typename W, typename O> - void erosion_wrt_value(trait::kind::logic, // binary => morphology on sets + void erosion_wrt_value(trait::image::kind::logic, // binary => morphology on sets const Image<I>& input, const Window<W>& win, Image<O>& output) { return impl::erosion_on_set(exact(input), exact(win), output); Index: mln/morpho/hit_or_miss.hh --- mln/morpho/hit_or_miss.hh (revision 1263) +++ mln/morpho/hit_or_miss.hh (working copy) @@ -115,7 +115,7 @@ // On sets. template <typename I, typename Wh, typename Wm, typename O> - void hit_or_miss_(trait::kind::logic, // binary => morphology on sets + void hit_or_miss_(trait::image::kind::logic, // binary => morphology on sets const Image<I>& input, const Window<Wh>& win_hit, const Window<Wm>& win_miss, Image<O>& output) Index: mln/io/internal/pnm/save.hh --- mln/io/internal/pnm/save.hh (revision 1263) +++ mln/io/internal/pnm/save.hh (working copy) @@ -139,7 +139,7 @@ // caller for fastest images template <typename I> void save_data_(std::ofstream& file, - mln::trait::speed::fastest, const I& ima) + trait::image::speed::fastest, const I& ima) { if (sizeof(value::int_u8) = 1) save_data_contiguous(file, ima); @@ -150,7 +150,7 @@ // caller for non fastest images template <typename I> void save_data_(std::ofstream& file, - mln::trait::speed::any, const I& ima) + trait::image::speed::any, const I& ima) { save_data_uncontiguous(file, ima); } Index: mln/logical/and.hh --- mln/logical/and.hh (revision 1263) +++ mln/logical/and.hh (working copy) @@ -77,9 +77,9 @@ { template <typename L, typename R, typename O> - void and__(mln::trait::speed::any, const L& lhs, - mln::trait::speed::any, const R& rhs, - mln::trait::speed::any, O& output) + void and__(trait::image::speed::any, const L& lhs, + trait::image::speed::any, const R& rhs, + trait::image::speed::any, O& output) { mln_piter(L) p(lhs.domain()); for_all(p) @@ -87,9 +87,9 @@ } template <typename L, typename R, typename O> - void and__(mln::trait::speed::fastest, const L& lhs, - mln::trait::speed::fastest, const R& rhs, - mln::trait::speed::fastest, O& output) + void and__(trait::image::speed::fastest, const L& lhs, + trait::image::speed::fastest, const R& rhs, + trait::image::speed::fastest, O& output) { mln_pixter(const L) lp(lhs); mln_pixter(const R) rp(rhs); Index: mln/logical/and_not.hh --- mln/logical/and_not.hh (revision 1263) +++ mln/logical/and_not.hh (working copy) @@ -77,9 +77,9 @@ { template <typename L, typename R, typename O> - void and_not_(mln::trait::speed::any, const L& lhs, - mln::trait::speed::any, const R& rhs, - mln::trait::speed::any, O& output) + void and_not_(trait::image::speed::any, const L& lhs, + trait::image::speed::any, const R& rhs, + trait::image::speed::any, O& output) { mln_piter(L) p(lhs.domain()); for_all(p) @@ -87,9 +87,9 @@ } template <typename L, typename R, typename O> - void and_not_(mln::trait::speed::fastest, const L& lhs, - mln::trait::speed::fastest, const R& rhs, - mln::trait::speed::fastest, O& output) + void and_not_(trait::image::speed::fastest, const L& lhs, + trait::image::speed::fastest, const R& rhs, + trait::image::speed::fastest, O& output) { mln_pixter(const L) lp(lhs); mln_pixter(const R) rp(rhs); Index: mln/logical/or.hh --- mln/logical/or.hh (revision 1263) +++ mln/logical/or.hh (working copy) @@ -77,9 +77,9 @@ { template <typename L, typename R, typename O> - void or__(mln::trait::speed::any, const L& lhs, - mln::trait::speed::any, const R& rhs, - mln::trait::speed::any, O& output) + void or__(trait::image::speed::any, const L& lhs, + trait::image::speed::any, const R& rhs, + trait::image::speed::any, O& output) { mln_piter(L) p(lhs.domain()); for_all(p) @@ -87,9 +87,9 @@ } template <typename L, typename R, typename O> - void or__(mln::trait::speed::fastest, const L& lhs, - mln::trait::speed::fastest, const R& rhs, - mln::trait::speed::fastest, O& output) + void or__(trait::image::speed::fastest, const L& lhs, + trait::image::speed::fastest, const R& rhs, + trait::image::speed::fastest, O& output) { mln_pixter(const L) lp(lhs); mln_pixter(const R) rp(rhs); Index: mln/logical/not.hh --- mln/logical/not.hh (revision 1263) +++ mln/logical/not.hh (working copy) @@ -73,8 +73,8 @@ { template <typename I, typename O> - void not__(mln::trait::speed::any, const I& input, - mln::trait::speed::any, O& output) + void not__(trait::image::speed::any, const I& input, + trait::image::speed::any, O& output) { mln_piter(I) p(input.domain()); for_all(p) @@ -82,8 +82,8 @@ } template <typename I, typename O> - void not__(mln::trait::speed::fastest, const I& input, - mln::trait::speed::fastest, O& output) + void not__(trait::image::speed::fastest, const I& input, + trait::image::speed::fastest, O& output) { mln_pixter(const I) ip(input); mln_pixter(O) op(output); Index: mln/labeling/level.hh --- mln/labeling/level.hh (revision 1263) +++ mln/labeling/level.hh (working copy) @@ -96,9 +96,9 @@ // Routines. template <typename I, typename N, typename O> - bool level_(mln::trait::speed::any, const I& input, + bool level_(trait::image::speed::any, const I& input, const mln_value(I)& val, const Neighborhood<N>& nbh, - mln::trait::speed::any, O& output, unsigned& nlabels) + trait::image::speed::any, O& output, unsigned& nlabels) { typedef impl::level_t<I,N,O> F; F f(input, val, exact(nbh), output); @@ -132,9 +132,9 @@ template <typename I, typename N, typename O> - bool level_(mln::trait::speed::fastest, const I& input, + bool level_(trait::image::speed::fastest, const I& input, const mln_value(I)& val, const Neighborhood<N>& nbh, - mln::trait::speed::fastest, O& output, unsigned& nlabels) + trait::image::speed::fastest, O& output, unsigned& nlabels) { typedef level_fast_t<I,N,O> F; F f(input, val, exact(nbh), output);
participants (1)
-
Thierry Geraud