---
scribo/ChangeLog | 4 ++++
scribo/debug/decision_image.hh | 24 ++++++++++++++----------
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index a9c13e3..53358b7 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,9 @@
2010-04-13 Guillaume Lazzara <z(a)lrde.epita.fr>
+ * debug/decision_image.hh: Add the anchor::Type as argument.
+
+2010-04-13 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Use anchor::Type in alignment routines' dispatch.
* filter/object_links_bottom_aligned.hh,
diff --git a/scribo/debug/decision_image.hh b/scribo/debug/decision_image.hh
index cc3f0f0..7f881d3 100644
--- a/scribo/debug/decision_image.hh
+++ b/scribo/debug/decision_image.hh
@@ -66,7 +66,8 @@ namespace scribo
mln_ch_value(I,value::rgb8)
decision_image(const Image<I>& input_,
const object_groups<L>& groups,
- const object_groups<L>& filtered_groups);
+ const object_groups<L>& filtered_groups,
+ anchor::Type anchor);
/*! \brief Save a color image showing the difference between to
object links.
@@ -84,7 +85,8 @@ namespace scribo
mln_ch_value(I,value::rgb8)
decision_image(const Image<I>& input_,
const object_links<L>& links,
- const object_links<L>& filtered_links);
+ const object_links<L>& filtered_links,
+ anchor::Type anchor);
# ifndef MLN_INCLUDE_ONLY
@@ -125,12 +127,13 @@ namespace scribo
mln_ch_value(I,value::rgb8)
decision_image(const Image<I>& input_,
const object_links<L>& links,
- const object_links<L>& filtered_links)
+ const object_links<L>& filtered_links,
+ anchor::Type anchor)
{
trace::entering("scribo::debug::decision_image");
const I& input = exact(input_);
- const component_set<L>& components = links.components();
+ const component_set<L>& comps = links.components();
mln_precondition(input.is_valid());
mln_precondition(links.is_valid());
@@ -142,21 +145,22 @@ namespace scribo
image2d<value::rgb8>
decision_image = data::convert(value::rgb8(), input);
- for_all_comps(i, components)
- mln::draw::box(decision_image, components(i).bbox(), literal::blue);
+ for_all_comps(i, comps)
+ mln::draw::box(decision_image, comps(i).bbox(), literal::blue);
for (unsigned i = 1; i < links.nelements(); ++i)
{
if (links(i) != i)
{
+ mln_site(L)
+ p1 = primitive::link::internal::compute_anchor(comps, i, anchor),
+ p2 = primitive::link::internal::compute_anchor(comps, links(i), anchor);
+
value::rgb8 value = literal::green;
if (links(i) != filtered_links(i))
value = literal::red;
- mln::draw::line(decision_image,
- components(i).bbox().pcenter(),
- components(links(i)).bbox().pcenter(),
- value);
+ mln::draw::line(decision_image, p1, p2, value);
}
}
--
1.5.6.5
Show replies by date