* table/extract.hh: add a missing include and specify the scribo
namespace.
* table/internal/align_lines.hh: fix warnings.
* table/internal/repair_lines.hh: do not use mln_VAR.
---
scribo/ChangeLog | 11 +++++++++++
scribo/table/extract.hh | 9 +++++----
scribo/table/internal/align_lines.hh | 11 +++++++----
scribo/table/internal/repair_lines.hh | 20 +++++++++++++++++---
4 files changed, 40 insertions(+), 11 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 89eedfc..f2751f0 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,14 @@
+2009-06-16 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
+ Fix compilation issues with gcc-3.3 in Scribo.
+
+ * table/extract.hh: add a missing include and specify the scribo
+ namespace.
+
+ * table/internal/align_lines.hh: fix warnings.
+
+ * table/internal/repair_lines.hh: do not use mln_VAR.
+
2009-06-12 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Fixes about accumulator includes and calls.
diff --git a/scribo/table/extract.hh b/scribo/table/extract.hh
index c09909b..026343d 100644
--- a/scribo/table/extract.hh
+++ b/scribo/table/extract.hh
@@ -35,6 +35,7 @@
# include <mln/util/couple.hh>
# include <mln/util/array.hh>
+# include <scribo/core/object_image.hh>
# include <scribo/table/rebuild.hh>
# include <scribo/table/erase.hh>
# include <scribo/extract/primitive/lines_h_discontinued.hh>
@@ -81,10 +82,10 @@ namespace scribo
V nhlines, nvlines;
object_image(mln_ch_value(I,V))
- hlines = extract::primitive::lines_h_discontinued(input, c8(),
- nhlines, 51, 6),
- vlines = extract::primitive::lines_v_discontinued(input, c8(),
- nvlines, 51, 6);
+ hlines = scribo::extract::primitive::lines_h_discontinued(input, c8(),
+ nhlines, 51, 6),
+ vlines = scribo::extract::primitive::lines_v_discontinued(input, c8(),
+ nvlines, 51, 6);
typedef mln::util::couple<mln_ch_value(I,V),
mln::util::couple<mln::util::array<box<mln_site(I)> >,
diff --git a/scribo/table/internal/align_lines.hh b/scribo/table/internal/align_lines.hh
index 5ea50e2..bd72af8 100644
--- a/scribo/table/internal/align_lines.hh
+++ b/scribo/table/internal/align_lines.hh
@@ -38,6 +38,8 @@
# include <mln/util/array.hh>
# include <mln/util/set.hh>
+# include <mln/math/round.hh>
+
# include <scribo/core/macros.hh>
@@ -151,6 +153,7 @@ namespace scribo
// We may do too much iterations (while loop) and some of them may
// be done for nothing...
mln::util::array<int> newlines;
+ math::round<int> round;
while (max_nelts > 0)
{
for_all_elements(i, lines)
@@ -166,11 +169,11 @@ namespace scribo
for_all_elements(j, lines[i])
if (box2line[lines[i][j]] == -1)
{
- line_bboxes[lines[i][j]].pmin()[dim] = mean.to_result();
- line_bboxes[lines[i][j]].pmax()[dim] = mean.to_result();
- box2line[lines[i][j]] = mean.to_result();
+ line_bboxes[lines[i][j]].pmin()[dim] = round(mean.to_result());
+ line_bboxes[lines[i][j]].pmax()[dim] = round(mean.to_result());
+ box2line[lines[i][j]] = round(mean.to_result());
}
- newlines.append(mean.to_result());
+ newlines.append(round(mean.to_result()));
}
}
--max_nelts;
diff --git a/scribo/table/internal/repair_lines.hh
b/scribo/table/internal/repair_lines.hh
index 28a737f..7c307e8 100644
--- a/scribo/table/internal/repair_lines.hh
+++ b/scribo/table/internal/repair_lines.hh
@@ -76,6 +76,12 @@ namespace scribo
/// Repair lines which have small discontinuities.
/// FIXME: buggy. Sometimes few lines move or shrink!
+ ///
+ /// \param[in] input A binary image.
+ /// \param[in,out] tableboxes Vertical or horizontal lines.
+ /// \param[in] max_discontinuity The maximum discontinuity length which
+ /// can be repaired.
+ //
template <unsigned axis, typename I>
void
repair_lines(const Image<I>& input_,
@@ -101,7 +107,8 @@ namespace scribo
typedef win::line<mln_grid(P), axis, mln_coord(P)> line_t;
// Initialization
- mln_ch_value(I,value::label_16) l(input.domain());
+ typedef mln_ch_value(I,value::label_16) L;
+ L l(input.domain());
data::fill(l, literal::zero);
for_all_components(i, tableboxes)
{
@@ -111,12 +118,19 @@ namespace scribo
}
// Repair
- extension_val<mln_ch_value(I,value::label_16)> l_ext(l, literal::zero);
+ extension_val<L> l_ext(l, literal::zero);
mln::util::array<box<P> > result;
std::vector<bool> to_keep(tableboxes.nelements(), true);
- mln_VAR(tbb_ima, extend(l | (pw::value(l) != pw::cst(literal::zero)), l));
+ //FIXME: use mln_VAR?
+ typedef
+ extension_ima<
+ const image_if<L,
+ fun::neq_v2b_expr_<pw::value_<L>,
+ pw::cst_<literal::zero_t> > >, const L> tbb_ima_t;
+ tbb_ima_t tbb_ima = extend(l | (pw::value(l) != pw::cst(literal::zero)), l);
+
//FIXME: use a half window, just the bottom of the vertical line.
line_t vl(max_discontinuity);
mln_piter(tbb_ima_t) p(tbb_ima.domain());
--
1.5.6.5