last-svn-commit-795-g2cd9b01 Rename line_info::components() to line_info::component_ids.

* scribo/core/line_info.hh: Here. * scribo/debug/char_space_image.hh, * scribo/text/recognition.hh, * src/debug/show_text_lines.cc, * scribo/io/xml/internal/full_xml_visitor.hh: Update calls to that method. --- scribo/ChangeLog | 22 ++++++++++++++++++++- scribo/scribo/core/line_info.hh | 8 +++--- scribo/scribo/debug/char_space_image.hh | 8 +++--- scribo/scribo/io/xml/internal/full_xml_visitor.hh | 4 +- scribo/scribo/text/recognition.hh | 4 +- scribo/src/debug/show_text_lines.cc | 2 +- 6 files changed, 34 insertions(+), 14 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 439db69..1928592 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,12 +1,32 @@ 2011-03-14 Guillaume Lazzara <z@lrde.epita.fr> - Rename debug routines. + Rename line_info::components() to line_info::component_ids. + + * scribo/core/line_info.hh: Here. + + * scribo/debug/char_space_image.hh, + * scribo/text/recognition.hh, + * src/debug/show_text_lines.cc, + * scribo/io/xml/internal/full_xml_visitor.hh: Update calls to that + method. + +2011-03-14 Guillaume Lazzara <z@lrde.epita.fr> + + Some changes in debug routines. * scribo/debug/save_bboxes_image.hh, * scribo/debug/save_linked_bboxes_image.hh: Rename as... * scribo/debug/bboxes_image.hh, * scribo/debug/linked_bboxes_image.hh: ... this. + * scribo/debug/links_image.hh: New. + + * scribo/debug/several_links_decision_image.hh: + Remove. Deprecated. + + * scribo/debug/alignment_decision_image.hh: Make use of + compute_anchor routine. + * scribo/debug/all.hh, * scribo/table/extract.hh, * scribo/toolchain/text_in_picture.hh, diff --git a/scribo/scribo/core/line_info.hh b/scribo/scribo/core/line_info.hh index 46ba720..4def6fe 100644 --- a/scribo/scribo/core/line_info.hh +++ b/scribo/scribo/core/line_info.hh @@ -172,7 +172,7 @@ namespace scribo // const mln::box2d& ebbox() const; - const mln::util::array<component_id_t>& components() const; + const mln::util::array<component_id_t>& component_ids() const; unsigned card() const; int baseline() const; @@ -481,7 +481,7 @@ namespace scribo template <typename L> const mln::util::array<typename line_info<L>::component_id_t>& - line_info<L>::components() const + line_info<L>::component_ids() const { return data_->components_; } @@ -856,7 +856,7 @@ namespace scribo // Update bbox and ebbox update_bbox_and_ebox(other); - data_->components_.append(other.components()); + data_->components_.append(other.component_ids()); } @@ -1023,7 +1023,7 @@ namespace scribo << ", type=" << info.type() << ", bbox=" << info.bbox() << ", ebbox=" << info.ebbox() - << ", components=" << info.components() + << ", components=" << info.component_ids() << ", baseline=" << info.baseline() << ", meanline=" << info.meanline() << ", ascent=" << info.ascent() diff --git a/scribo/scribo/debug/char_space_image.hh b/scribo/scribo/debug/char_space_image.hh index 6dc6f8f..53fc303 100644 --- a/scribo/scribo/debug/char_space_image.hh +++ b/scribo/scribo/debug/char_space_image.hh @@ -76,16 +76,16 @@ namespace scribo for_all_lines(l, line) { if (! line(l).is_valid() || line(l).is_hidden() - || line(l).components().size() < 2) + || line(l).component_ids().size() < 2) continue; - for_all_elements(i, line(l).components()) + for_all_elements(i, line(l).component_ids()) { - if (i == line(l).components().nelements() - 1) + if (i == line(l).component_ids().nelements() - 1) continue; - unsigned c = line(l).components()[i]; + unsigned c = line(l).component_ids()[i]; point2d beg = comps(c).bbox().pmax(), diff --git a/scribo/scribo/io/xml/internal/full_xml_visitor.hh b/scribo/scribo/io/xml/internal/full_xml_visitor.hh index 8576c27..701c1b7 100644 --- a/scribo/scribo/io/xml/internal/full_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/full_xml_visitor.hh @@ -447,9 +447,9 @@ namespace scribo output << " <compid_list>" << std::endl; - for_all_line_comps(c, line.components()) + for_all_line_comps(c, line.component_ids()) output << " <compid value=\"" - << line.components()(c) << "\" />" << std::endl; + << line.component_ids()(c) << "\" />" << std::endl; output << " </compid_list>" << std::endl; diff --git a/scribo/scribo/text/recognition.hh b/scribo/scribo/text/recognition.hh index 3a9742b..1e11a3e 100644 --- a/scribo/scribo/text/recognition.hh +++ b/scribo/scribo/text/recognition.hh @@ -144,8 +144,8 @@ namespace scribo const L& lbl = comp_set.labeled_image(); // Extract each character components to create the line image. - const mln::util::array<component_id_t>& comps = lines(i).components(); - for_all_elements(e, lines(i).components()) + const mln::util::array<component_id_t>& comps = lines(i).component_ids(); + for_all_elements(e, lines(i).component_ids()) { unsigned comp_id = comps(e); data::fill(((text_ima | comp_set(comp_id).bbox()).rw() | (pw::value(lbl) == pw::cst(comp_id))).rw(), diff --git a/scribo/src/debug/show_text_lines.cc b/scribo/src/debug/show_text_lines.cc index 368f375..d5a5c8f 100644 --- a/scribo/src/debug/show_text_lines.cc +++ b/scribo/src/debug/show_text_lines.cc @@ -110,7 +110,7 @@ int main(int argc, char* argv[]) for_all_lines(l, lines) if (lines(l).is_textline()) { - const util::array<component_id_t>& comps = lines(l).components(); + const util::array<component_id_t>& comps = lines(l).component_ids(); const L& lbl = lines.components().labeled_image(); for_all_elements(c, comps) data::fill((output | lines.components()(comps(c)).bbox()).rw(), -- 1.5.6.5
participants (1)
-
Guillaume Lazzara