Commit b63755a6 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Make use of value::next routine in Scribo.

	* scribo/core/component_set.hh,
	* scribo/core/line_set.hh,
	* scribo/core/object_links.hh,
	* scribo/debug/highlight_text_area.hh,
	* scribo/filter/object_groups_with_holes.hh,
	* scribo/filter/objects_with_holes.hh,
	* scribo/postprocessing/fill_object_holes.hh,
	* scribo/table/internal/align_lines.hh: Use value::next to replace
	evil casts.
parent a913e1f8
2010-10-21 Guillaume Lazzara <z@lrde.epita.fr>
Make use of value::next routine in Scribo.
* scribo/core/component_set.hh,
* scribo/core/line_set.hh,
* scribo/core/object_links.hh,
* scribo/debug/highlight_text_area.hh,
* scribo/filter/object_groups_with_holes.hh,
* scribo/filter/objects_with_holes.hh,
* scribo/postprocessing/fill_object_holes.hh,
* scribo/table/internal/align_lines.hh: Use value::next to replace
evil casts.
2010-10-11 Guillaume Lazzara <z@lrde.epita.fr>
Fix namespace ambiguities.
......
......@@ -37,6 +37,7 @@
# include <mln/data/fill.hh>
# include <mln/util/array.hh>
# include <mln/value/next.hh>
# include <mln/accu/pair.hh>
# include <mln/accu/center.hh>
......@@ -315,7 +316,7 @@ namespace scribo
{
typedef mln_site(L) P;
infos_.reserve(value::next(ncomps_));
infos_.reserve(mln::value::next(ncomps_));
infos_.append(component_info()); // Component 0, i.e. the background.
for_all_comp_data(i, attribs)
......@@ -333,7 +334,7 @@ namespace scribo
{
typedef mln_site(L) P;
infos_.reserve(value::next(ncomps_));
infos_.reserve(mln::value::next(ncomps_));
infos_.append(component_info()); // Component 0, i.e. the background.
for_all_comp_data(i, attribs)
......@@ -509,7 +510,7 @@ namespace scribo
mln_concrete(L)
component_set<L>::valid_comps_image_() const
{
mln::util::array<bool> f(value::next(this->data_->ncomps_));
mln::util::array<bool> f(mln::value::next(this->data_->ncomps_));
f(0) = true;
for_all_comps(c, (*this))
......
......@@ -244,7 +244,7 @@ namespace scribo
// FIXME: object_groups should store the relation 'group -> comp'.
mln::util::array< mln::util::array<component_id_t> >
group_to_comps(unsigned(n_groups) + 1);
group_to_comps(value::next(n_groups));
// 1st pass - Compute data.
......
......@@ -148,7 +148,7 @@ namespace scribo
template <typename L>
object_links<L>::object_links(const component_set<L>& components)
{
data_ = new data_t(components, unsigned(components.nelements()) + 1);
data_ = new data_t(components, value::next(components.nelements()));
}
......@@ -156,7 +156,7 @@ namespace scribo
object_links<L>::object_links(const component_set<L>& components,
unsigned value)
{
data_ = new data_t(components, unsigned(components.nelements()) + 1,
data_ = new data_t(components, value::next(components.nelements()),
value);
}
......
......@@ -263,7 +263,7 @@ namespace scribo
initialize(mask, input);
data::fill(mask, false);
mln::util::array<mln_box(I)> bbox(unsigned(components.nelements()) + 1);
mln::util::array<mln_box(I)> bbox(value::next(components.nelements()));
for_all_comps(i, components)
if (components(i).is_valid())
......
......@@ -172,13 +172,12 @@ namespace scribo
// Will store the first background component id associated
// to a group.
util::array<unsigned> bg_comps(
static_cast<unsigned>(components.nelements()) + 1, 0);
value::next(components.nelements()), 0);
// Will 'True' if a group has at least two background
// components.
fun::i2v::array<bool>
to_keep(static_cast<unsigned>(components.nelements()) + 1,
false);
to_keep(value::next(components.nelements()), false);
const L& lbl = components.labeled_image();
......
......@@ -173,10 +173,10 @@ namespace scribo
L bboxes_ima;
util::array<util::set<unsigned> > bg_comps(
static_cast<unsigned>(components.nelements()) + 1);
value::next(components.nelements()));
fun::i2v::array<bool>
to_keep(static_cast<unsigned>(components.nelements()) + 1,
to_keep(value::next(components.nelements()),
false);
const L& lbl = components.labeled_image();
......@@ -337,13 +337,12 @@ namespace scribo
L bboxes_ima;
util::array<unsigned> bg_comps(
static_cast<unsigned>(components.nelements()) + 1, 0);
value::next(components.nelements()), 0);
util::array<bool> bg_comps_done(
static_cast<unsigned>(components.nelements()) + 1, false);
value::next(components.nelements()), false);
fun::i2v::array<bool>
to_keep(static_cast<unsigned>(components.nelements()) + 1,
false);
to_keep(value::next(components.nelements()), false);
const L& lbl = components.labeled_image();
......
......@@ -174,12 +174,12 @@ namespace scribo
L bboxes_ima;
util::array<unsigned> bg_comps(
unsigned(components.nelements()) + 1, 0);
value::next(components.nelements()), 0);
util::array<bool> bg_comps_done(
unsigned(components.nelements()) + 1, false);
value::next(components.nelements()), false);
mln::fun::i2v::array<bool>
to_keep(unsigned(components.nelements()) + 1, false);
to_keep(value::next(components.nelements()), false);
const L& lbl = components.labeled_image();
......
......@@ -142,7 +142,7 @@ namespace scribo
// Init box2line
mln::util::array<int>
box2line(unsigned(lines.nelements()) + 1, -1);
box2line(value::next(lines.nelements()), -1);
// Find the line with the highest element count.
unsigned max_nelts = 0;
......
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