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

Fix the initialization of mln::decorated_image.

	* mln/tag/init.hh (tag::data_t): New tag type.
	 (tag::data): New tag.
	* mln/core/image/imorph/decorated_image.hh
	(init_(tag::data_t, D&, const decorated_image<I,D>&))
	(init_(tag::data_t, D&, const decorated_image<I,D2>&))
	(init_(tag::image_t, decorated_image<I,D>&, const J&)):
	New functions.
parent 21c2800d
2011-11-24 Roland Levillain <roland@lrde.epita.fr>
Fix the initialization of mln::decorated_image.
* mln/tag/init.hh (tag::data_t): New tag type.
(tag::data): New tag.
* mln/core/image/imorph/decorated_image.hh
(init_(tag::data_t, D&, const decorated_image<I,D>&))
(init_(tag::data_t, D&, const decorated_image<I,D2>&))
(init_(tag::image_t, decorated_image<I,D>&, const J&)):
New functions.
2011-11-18 Roland Levillain <roland@lrde.epita.fr>
 
Simplify some apps/morpher programs using mln::make::box2d.
......@@ -140,6 +140,32 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
// init_.
template <typename I, typename D>
void init_(tag::data_t, D& d, const decorated_image<I,D>& model)
{
d = model.decoration();
}
// Initializing a decoration with a model of another type.
template <typename I, typename D, typename D2>
void init_(tag::data_t, D& /* d */, const decorated_image<I,D2>& /* model */)
{
// FIXME: No initialization, really?
}
template <typename I, typename D, typename J>
void init_(tag::image_t, decorated_image<I,D>& target, const J& model)
{
I ima;
init_(tag::image, ima, exact(model));
D d;
init_(tag::data, d, exact(model));
target.init_(ima, d);
}
namespace internal
{
......
......@@ -40,6 +40,7 @@ namespace mln
struct bbox_t {};
struct border_t {};
struct data_t {};
struct domain_t {};
struct extension_t {};
struct function_t {};
......@@ -47,6 +48,7 @@ namespace mln
extern bbox_t bbox;
extern border_t border;
extern data_t data;
extern domain_t domain;
extern extension_t extension;
extern function_t function;
......@@ -58,6 +60,7 @@ namespace mln
bbox_t bbox;
border_t border;
data_t data;
domain_t domain;
extension_t extension;
function_t function;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment