LRE
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
List overview
Download
Olena-patches
March 2011
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
olena-patches@lrde.epita.fr
7 participants
277 discussions
Start a n
N
ew thread
last-svn-commit-798-g07b076c Introduce new anchors.
by Guillaume Lazzara
* scribo/core/tag/anchor.hh: New anchors. * scribo/filter/internal/alignment_angle.hh, * scribo/primitive/link/internal/compute_anchor.hh: Make use of that new anchors. --- scribo/ChangeLog | 10 ++++++++++ scribo/scribo/core/tag/anchor.hh | 6 ++++-- scribo/scribo/filter/internal/alignment_angle.hh | 2 ++ .../primitive/link/internal/compute_anchor.hh | 16 ++++++++++++++-- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 1de58fe..58685f6 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,15 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Introduce new anchors. + + * scribo/core/tag/anchor.hh: New anchors. + + * scribo/filter/internal/alignment_angle.hh, + * scribo/primitive/link/internal/compute_anchor.hh: Make use of + that new anchors. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Rename document serializer base class. * scribo/core/internal/doc_xml_serializer.hh: Rename as... diff --git a/scribo/scribo/core/tag/anchor.hh b/scribo/scribo/core/tag/anchor.hh index bb6780c..7ce8ddc 100644 --- a/scribo/scribo/core/tag/anchor.hh +++ b/scribo/scribo/core/tag/anchor.hh @@ -37,11 +37,13 @@ namespace scribo { MassCenter = 0, Top, + StrictTopCenter, Bottom, + StrictBottomCenter, Center, - ActualLeft, + StrictLeft, Left, - ActualRight, + StrictRight, Right, TopLeft, TopStrictLeft, diff --git a/scribo/scribo/filter/internal/alignment_angle.hh b/scribo/scribo/filter/internal/alignment_angle.hh index 33855a8..035dec7 100644 --- a/scribo/scribo/filter/internal/alignment_angle.hh +++ b/scribo/scribo/filter/internal/alignment_angle.hh @@ -109,6 +109,7 @@ namespace scribo break; // Top + case anchor::StrictTopCenter: case anchor::TopStrictLeft: case anchor::Top: { @@ -122,6 +123,7 @@ namespace scribo break; // Bottom + case anchor::StrictBottomCenter: case anchor::BottomStrictRight: case anchor::Bottom: { diff --git a/scribo/scribo/primitive/link/internal/compute_anchor.hh b/scribo/scribo/primitive/link/internal/compute_anchor.hh index c1a9106..9afc33f 100644 --- a/scribo/scribo/primitive/link/internal/compute_anchor.hh +++ b/scribo/scribo/primitive/link/internal/compute_anchor.hh @@ -111,6 +111,12 @@ namespace scribo break; + // Bounding box Strict top center + case anchor::StrictTopCenter: + sp.row() = components(current_object).bbox().pmin().row(); + break; + + // Bounding box top left case anchor::TopStrictLeft: sp.col() = components(current_object).bbox().pmin().col(); @@ -138,13 +144,19 @@ namespace scribo break; + // Bounding box strict bottom center. + case anchor::StrictBottomCenter: + sp.row() = components(current_object).bbox().pmax().row(); + break; + + // Bounding box center case anchor::Center: return components(current_object).bbox().pcenter(); // Bounding box actual left center - case anchor::ActualLeft: + case anchor::StrictLeft: return P(components(current_object).bbox().pcenter().row(), components(current_object).bbox().pmin().col()); @@ -161,7 +173,7 @@ namespace scribo // Bounding box actual right center - case anchor::ActualRight: + case anchor::StrictRight: return P(components(current_object).bbox().pcenter().row(), components(current_object).bbox().pmax().col()); -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-798-gbafdc50 Rename document serializer base class.
by Guillaume Lazzara
* scribo/core/internal/doc_xml_serializer.hh: Rename as... * scribo/core/internal/doc_serializer.hh: ... this. * scribo/io/xml/internal/extended_page_xml_visitor.hh, * scribo/io/xml/internal/full_xml_visitor.hh, * scribo/io/xml/internal/page_xml_visitor.hh: Update inheritance. --- scribo/ChangeLog | 11 +++++++++ .../{doc_xml_serializer.hh => doc_serializer.hh} | 24 ++++++++++---------- .../io/xml/internal/extended_page_xml_visitor.hh | 3 +- scribo/scribo/io/xml/internal/full_xml_visitor.hh | 4 +- scribo/scribo/io/xml/internal/page_xml_visitor.hh | 4 +- 5 files changed, 29 insertions(+), 17 deletions(-) rename scribo/scribo/core/internal/{doc_xml_serializer.hh => doc_serializer.hh} (80%) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 213fa0a..f0bff06 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,16 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Rename document serializer base class. + + * scribo/core/internal/doc_xml_serializer.hh: Rename as... + * scribo/core/internal/doc_serializer.hh: ... this. + + * scribo/io/xml/internal/extended_page_xml_visitor.hh, + * scribo/io/xml/internal/full_xml_visitor.hh, + * scribo/io/xml/internal/page_xml_visitor.hh: Update inheritance. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Store more information in scribo::document. * scribo/core/document.hh: Make a distinction between horizontal diff --git a/scribo/scribo/core/internal/doc_xml_serializer.hh b/scribo/scribo/core/internal/doc_serializer.hh similarity index 80% rename from scribo/scribo/core/internal/doc_xml_serializer.hh rename to scribo/scribo/core/internal/doc_serializer.hh index b64c9d4..2655100 100644 --- a/scribo/scribo/core/internal/doc_xml_serializer.hh +++ b/scribo/scribo/core/internal/doc_serializer.hh @@ -23,8 +23,8 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#ifndef SCRIBO_CORE_INTERNAL_DOC_XML_SERIALIZER_HH -# define SCRIBO_CORE_INTERNAL_DOC_XML_SERIALIZER_HH +#ifndef SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH +# define SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH /// \file /// @@ -46,7 +46,7 @@ namespace scribo /// \brief Link functor concept. template <typename E> - class doc_xml_serializer : public SerializeVisitor<E> + class doc_serializer : public SerializeVisitor<E> { public: // Visit overloads @@ -80,55 +80,55 @@ namespace scribo template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const document<L>& doc) const + doc_serializer<E>::visit(const document<L>& doc) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const line_links<L>& llinks) const + doc_serializer<E>::visit(const line_links<L>& llinks) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const object_groups<L>& groups) const + doc_serializer<E>::visit(const object_groups<L>& groups) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const object_links<L>& links) const + doc_serializer<E>::visit(const object_links<L>& links) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const component_set<L>& comp_set) const + doc_serializer<E>::visit(const component_set<L>& comp_set) const { } template <typename E> void - doc_xml_serializer<E>::visit(const component_info& info) const + doc_serializer<E>::visit(const component_info& info) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const paragraph_set<L>& parset) const + doc_serializer<E>::visit(const paragraph_set<L>& parset) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const line_info<L>& line) const + doc_serializer<E>::visit(const line_info<L>& line) const { } @@ -137,4 +137,4 @@ namespace scribo } // end of namespace scribo -#endif // SCRIBO_CORE_INTERNAL_DOC_XML_SERIALIZER_HH +#endif // SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH diff --git a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh index 51e7ad3..e8c7689 100644 --- a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh @@ -32,6 +32,7 @@ # include <fstream> # include <scribo/core/internal/doc_xml_serializer.hh> +# include <scribo/core/internal/doc_serializer.hh> # include <scribo/core/document.hh> # include <scribo/core/component_set.hh> # include <scribo/core/paragraph_set.hh> @@ -57,7 +58,7 @@ namespace scribo { - class extended_page_xml_visitor : public doc_xml_serializer<extended_page_xml_visitor> + class extended_page_xml_visitor : public doc_serializer<extended_page_xml_visitor> { public: // Constructor diff --git a/scribo/scribo/io/xml/internal/full_xml_visitor.hh b/scribo/scribo/io/xml/internal/full_xml_visitor.hh index d466b34..28f43e9 100644 --- a/scribo/scribo/io/xml/internal/full_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/full_xml_visitor.hh @@ -34,7 +34,7 @@ # include <QByteArray> -# include <scribo/core/internal/doc_xml_serializer.hh> +# include <scribo/core/internal/doc_serializer.hh> # include <scribo/core/document.hh> # include <scribo/core/component_set.hh> # include <scribo/core/paragraph_set.hh> @@ -63,7 +63,7 @@ namespace scribo { - class full_xml_visitor : public doc_xml_serializer<full_xml_visitor> + class full_xml_visitor : public doc_serializer<full_xml_visitor> { public: // Constructor diff --git a/scribo/scribo/io/xml/internal/page_xml_visitor.hh b/scribo/scribo/io/xml/internal/page_xml_visitor.hh index 9dec1e7..19665d6 100644 --- a/scribo/scribo/io/xml/internal/page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/page_xml_visitor.hh @@ -32,7 +32,7 @@ # include <fstream> -# include <scribo/core/internal/doc_xml_serializer.hh> +# include <scribo/core/internal/doc_serializer.hh> # include <scribo/convert/to_base64.hh> # include <scribo/io/xml/internal/print_box_coords.hh> @@ -63,7 +63,7 @@ namespace scribo
http://schema.primaresearch.org/PAGE/gts/pagecontent/2009-03-16/pagecontent…
*/ - class page_xml_visitor : public doc_xml_serializer<page_xml_visitor> + class page_xml_visitor : public doc_serializer<page_xml_visitor> { public: // Constructor -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-797-g0135714 Rename document serializer base class.
by Guillaume Lazzara
* scribo/core/internal/doc_xml_serializer.hh: Rename as... * scribo/core/internal/doc_serializer.hh: ... this. * scribo/io/xml/internal/extended_page_xml_visitor.hh, * scribo/io/xml/internal/full_xml_visitor.hh, * scribo/io/xml/internal/page_xml_visitor.hh: Update inheritance. --- scribo/ChangeLog | 11 +++++++++ .../{doc_xml_serializer.hh => doc_serializer.hh} | 24 ++++++++++---------- .../io/xml/internal/extended_page_xml_visitor.hh | 3 +- scribo/scribo/io/xml/internal/full_xml_visitor.hh | 4 +- scribo/scribo/io/xml/internal/page_xml_visitor.hh | 4 +- 5 files changed, 29 insertions(+), 17 deletions(-) rename scribo/scribo/core/internal/{doc_xml_serializer.hh => doc_serializer.hh} (80%) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 33b036a..1de58fe 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,16 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Rename document serializer base class. + + * scribo/core/internal/doc_xml_serializer.hh: Rename as... + * scribo/core/internal/doc_serializer.hh: ... this. + + * scribo/io/xml/internal/extended_page_xml_visitor.hh, + * scribo/io/xml/internal/full_xml_visitor.hh, + * scribo/io/xml/internal/page_xml_visitor.hh: Update inheritance. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Store more information in scribo::document. * scribo/core/document.hh: Make a distinction between horizontal diff --git a/scribo/scribo/core/internal/doc_xml_serializer.hh b/scribo/scribo/core/internal/doc_serializer.hh similarity index 80% rename from scribo/scribo/core/internal/doc_xml_serializer.hh rename to scribo/scribo/core/internal/doc_serializer.hh index b64c9d4..2655100 100644 --- a/scribo/scribo/core/internal/doc_xml_serializer.hh +++ b/scribo/scribo/core/internal/doc_serializer.hh @@ -23,8 +23,8 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#ifndef SCRIBO_CORE_INTERNAL_DOC_XML_SERIALIZER_HH -# define SCRIBO_CORE_INTERNAL_DOC_XML_SERIALIZER_HH +#ifndef SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH +# define SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH /// \file /// @@ -46,7 +46,7 @@ namespace scribo /// \brief Link functor concept. template <typename E> - class doc_xml_serializer : public SerializeVisitor<E> + class doc_serializer : public SerializeVisitor<E> { public: // Visit overloads @@ -80,55 +80,55 @@ namespace scribo template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const document<L>& doc) const + doc_serializer<E>::visit(const document<L>& doc) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const line_links<L>& llinks) const + doc_serializer<E>::visit(const line_links<L>& llinks) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const object_groups<L>& groups) const + doc_serializer<E>::visit(const object_groups<L>& groups) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const object_links<L>& links) const + doc_serializer<E>::visit(const object_links<L>& links) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const component_set<L>& comp_set) const + doc_serializer<E>::visit(const component_set<L>& comp_set) const { } template <typename E> void - doc_xml_serializer<E>::visit(const component_info& info) const + doc_serializer<E>::visit(const component_info& info) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const paragraph_set<L>& parset) const + doc_serializer<E>::visit(const paragraph_set<L>& parset) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const line_info<L>& line) const + doc_serializer<E>::visit(const line_info<L>& line) const { } @@ -137,4 +137,4 @@ namespace scribo } // end of namespace scribo -#endif // SCRIBO_CORE_INTERNAL_DOC_XML_SERIALIZER_HH +#endif // SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH diff --git a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh index 51e7ad3..e8c7689 100644 --- a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh @@ -32,6 +32,7 @@ # include <fstream> # include <scribo/core/internal/doc_xml_serializer.hh> +# include <scribo/core/internal/doc_serializer.hh> # include <scribo/core/document.hh> # include <scribo/core/component_set.hh> # include <scribo/core/paragraph_set.hh> @@ -57,7 +58,7 @@ namespace scribo { - class extended_page_xml_visitor : public doc_xml_serializer<extended_page_xml_visitor> + class extended_page_xml_visitor : public doc_serializer<extended_page_xml_visitor> { public: // Constructor diff --git a/scribo/scribo/io/xml/internal/full_xml_visitor.hh b/scribo/scribo/io/xml/internal/full_xml_visitor.hh index d466b34..28f43e9 100644 --- a/scribo/scribo/io/xml/internal/full_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/full_xml_visitor.hh @@ -34,7 +34,7 @@ # include <QByteArray> -# include <scribo/core/internal/doc_xml_serializer.hh> +# include <scribo/core/internal/doc_serializer.hh> # include <scribo/core/document.hh> # include <scribo/core/component_set.hh> # include <scribo/core/paragraph_set.hh> @@ -63,7 +63,7 @@ namespace scribo { - class full_xml_visitor : public doc_xml_serializer<full_xml_visitor> + class full_xml_visitor : public doc_serializer<full_xml_visitor> { public: // Constructor diff --git a/scribo/scribo/io/xml/internal/page_xml_visitor.hh b/scribo/scribo/io/xml/internal/page_xml_visitor.hh index 9dec1e7..19665d6 100644 --- a/scribo/scribo/io/xml/internal/page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/page_xml_visitor.hh @@ -32,7 +32,7 @@ # include <fstream> -# include <scribo/core/internal/doc_xml_serializer.hh> +# include <scribo/core/internal/doc_serializer.hh> # include <scribo/convert/to_base64.hh> # include <scribo/io/xml/internal/print_box_coords.hh> @@ -63,7 +63,7 @@ namespace scribo
http://schema.primaresearch.org/PAGE/gts/pagecontent/2009-03-16/pagecontent…
*/ - class page_xml_visitor : public doc_xml_serializer<page_xml_visitor> + class page_xml_visitor : public doc_serializer<page_xml_visitor> { public: // Constructor -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-797-gd045991 Rename document serializer base class.
by Guillaume Lazzara
* scribo/core/internal/doc_xml_serializer.hh: Rename as... * scribo/core/internal/doc_serializer.hh: ... this. * scribo/io/xml/internal/extended_page_xml_visitor.hh, * scribo/io/xml/internal/full_xml_visitor.hh, * scribo/io/xml/internal/page_xml_visitor.hh: Update inheritance. --- scribo/ChangeLog | 11 +++++++++ .../{doc_xml_serializer.hh => doc_serializer.hh} | 24 ++++++++++---------- .../io/xml/internal/extended_page_xml_visitor.hh | 3 +- scribo/scribo/io/xml/internal/full_xml_visitor.hh | 4 +- scribo/scribo/io/xml/internal/page_xml_visitor.hh | 4 +- 5 files changed, 29 insertions(+), 17 deletions(-) rename scribo/scribo/core/internal/{doc_xml_serializer.hh => doc_serializer.hh} (80%) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 33b036a..1de58fe 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,16 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Rename document serializer base class. + + * scribo/core/internal/doc_xml_serializer.hh: Rename as... + * scribo/core/internal/doc_serializer.hh: ... this. + + * scribo/io/xml/internal/extended_page_xml_visitor.hh, + * scribo/io/xml/internal/full_xml_visitor.hh, + * scribo/io/xml/internal/page_xml_visitor.hh: Update inheritance. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Store more information in scribo::document. * scribo/core/document.hh: Make a distinction between horizontal diff --git a/scribo/scribo/core/internal/doc_xml_serializer.hh b/scribo/scribo/core/internal/doc_serializer.hh similarity index 80% rename from scribo/scribo/core/internal/doc_xml_serializer.hh rename to scribo/scribo/core/internal/doc_serializer.hh index b64c9d4..2655100 100644 --- a/scribo/scribo/core/internal/doc_xml_serializer.hh +++ b/scribo/scribo/core/internal/doc_serializer.hh @@ -23,8 +23,8 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#ifndef SCRIBO_CORE_INTERNAL_DOC_XML_SERIALIZER_HH -# define SCRIBO_CORE_INTERNAL_DOC_XML_SERIALIZER_HH +#ifndef SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH +# define SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH /// \file /// @@ -46,7 +46,7 @@ namespace scribo /// \brief Link functor concept. template <typename E> - class doc_xml_serializer : public SerializeVisitor<E> + class doc_serializer : public SerializeVisitor<E> { public: // Visit overloads @@ -80,55 +80,55 @@ namespace scribo template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const document<L>& doc) const + doc_serializer<E>::visit(const document<L>& doc) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const line_links<L>& llinks) const + doc_serializer<E>::visit(const line_links<L>& llinks) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const object_groups<L>& groups) const + doc_serializer<E>::visit(const object_groups<L>& groups) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const object_links<L>& links) const + doc_serializer<E>::visit(const object_links<L>& links) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const component_set<L>& comp_set) const + doc_serializer<E>::visit(const component_set<L>& comp_set) const { } template <typename E> void - doc_xml_serializer<E>::visit(const component_info& info) const + doc_serializer<E>::visit(const component_info& info) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const paragraph_set<L>& parset) const + doc_serializer<E>::visit(const paragraph_set<L>& parset) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const line_info<L>& line) const + doc_serializer<E>::visit(const line_info<L>& line) const { } @@ -137,4 +137,4 @@ namespace scribo } // end of namespace scribo -#endif // SCRIBO_CORE_INTERNAL_DOC_XML_SERIALIZER_HH +#endif // SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH diff --git a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh index 51e7ad3..e8c7689 100644 --- a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh @@ -32,6 +32,7 @@ # include <fstream> # include <scribo/core/internal/doc_xml_serializer.hh> +# include <scribo/core/internal/doc_serializer.hh> # include <scribo/core/document.hh> # include <scribo/core/component_set.hh> # include <scribo/core/paragraph_set.hh> @@ -57,7 +58,7 @@ namespace scribo { - class extended_page_xml_visitor : public doc_xml_serializer<extended_page_xml_visitor> + class extended_page_xml_visitor : public doc_serializer<extended_page_xml_visitor> { public: // Constructor diff --git a/scribo/scribo/io/xml/internal/full_xml_visitor.hh b/scribo/scribo/io/xml/internal/full_xml_visitor.hh index d466b34..28f43e9 100644 --- a/scribo/scribo/io/xml/internal/full_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/full_xml_visitor.hh @@ -34,7 +34,7 @@ # include <QByteArray> -# include <scribo/core/internal/doc_xml_serializer.hh> +# include <scribo/core/internal/doc_serializer.hh> # include <scribo/core/document.hh> # include <scribo/core/component_set.hh> # include <scribo/core/paragraph_set.hh> @@ -63,7 +63,7 @@ namespace scribo { - class full_xml_visitor : public doc_xml_serializer<full_xml_visitor> + class full_xml_visitor : public doc_serializer<full_xml_visitor> { public: // Constructor diff --git a/scribo/scribo/io/xml/internal/page_xml_visitor.hh b/scribo/scribo/io/xml/internal/page_xml_visitor.hh index 9dec1e7..19665d6 100644 --- a/scribo/scribo/io/xml/internal/page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/page_xml_visitor.hh @@ -32,7 +32,7 @@ # include <fstream> -# include <scribo/core/internal/doc_xml_serializer.hh> +# include <scribo/core/internal/doc_serializer.hh> # include <scribo/convert/to_base64.hh> # include <scribo/io/xml/internal/print_box_coords.hh> @@ -63,7 +63,7 @@ namespace scribo
http://schema.primaresearch.org/PAGE/gts/pagecontent/2009-03-16/pagecontent…
*/ - class page_xml_visitor : public doc_xml_serializer<page_xml_visitor> + class page_xml_visitor : public doc_serializer<page_xml_visitor> { public: // Constructor -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-797-gfffcde7 Store more information in scribo::document.
by Guillaume Lazzara
* scribo/core/document.hh: Make a distinction between horizontal and vertical lines. Store the binary image. * scribo/io/xml/internal/extended_page_xml_visitor.hh, * scribo/io/xml/internal/full_xml_visitor.hh, * scribo/io/xml/internal/page_xml_visitor.hh, * scribo/toolchain/internal/content_in_doc_functor.hh: Make use of that new methods and information. --- scribo/ChangeLog | 13 ++ scribo/scribo/core/document.hh | 137 ++++++++++++++----- .../io/xml/internal/extended_page_xml_visitor.hh | 6 +- scribo/scribo/io/xml/internal/full_xml_visitor.hh | 14 +- scribo/scribo/io/xml/internal/page_xml_visitor.hh | 6 +- .../toolchain/internal/content_in_doc_functor.hh | 20 +++- 6 files changed, 145 insertions(+), 51 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 52e3125..213fa0a 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,18 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Store more information in scribo::document. + + * scribo/core/document.hh: Make a distinction between horizontal + and vertical lines. Store the binary image. + + * scribo/io/xml/internal/extended_page_xml_visitor.hh, + * scribo/io/xml/internal/full_xml_visitor.hh, + * scribo/io/xml/internal/page_xml_visitor.hh, + * scribo/toolchain/internal/content_in_doc_functor.hh: Make use of + that new methods and information. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Rename line_info::components() to line_info::component_ids. * scribo/core/line_info.hh: Here. diff --git a/scribo/scribo/core/document.hh b/scribo/scribo/core/document.hh index 689d0e3..f38b20b 100644 --- a/scribo/scribo/core/document.hh +++ b/scribo/scribo/core/document.hh @@ -85,23 +85,34 @@ namespace scribo const component_set<L>& elements() const; void set_elements(const component_set<L>& elements); - const mln::image2d<value::rgb8>& image() const; - void set_image(const mln::image2d<value::rgb8>& image); - bool has_whitespace_seps() const; const mln::image2d<bool>& whitespace_seps() const; const component_set<L>& whitespace_seps_comps() const; void set_whitespace_separators(const image2d<bool>& whitespace_seps); - bool has_line_seps() const; - const mln::image2d<bool>& line_seps() const; - const component_set<L>& line_seps_comps() const; - void set_line_separators(const image2d<bool>& line_seps); + // Horizontal separators + bool has_hline_seps() const; + const mln::image2d<bool>& hline_seps() const; + const component_set<L>& hline_seps_comps() const; + void set_hline_separators(const image2d<bool>& line_seps); + + // Vertical separators + bool has_vline_seps() const; + const mln::image2d<bool>& vline_seps() const; + const component_set<L>& vline_seps_comps() const; + void set_vline_separators(const image2d<bool>& line_seps); + + const mln::image2d<value::rgb8>& image() const; + void set_image(const mln::image2d<value::rgb8>& image); + + const mln::image2d<bool>& binary_image() const; + void set_binary_image(const mln::image2d<bool>& binary_image); private: std::string filename_; mln::image2d<mln::value::rgb8> image_; + mln::image2d<bool> binary_image_; paragraph_set<L> parset_; component_set<L> elements_; @@ -109,8 +120,11 @@ namespace scribo mln::image2d<bool> whitespace_seps_; component_set<L> whitespace_seps_comps_; - mln::image2d<bool> line_seps_; - component_set<L> line_seps_comps_; + mln::image2d<bool> hline_seps_; + component_set<L> hline_seps_comps_; + + mln::image2d<bool> vline_seps_; + component_set<L> vline_seps_comps_; }; @@ -251,97 +265,148 @@ namespace scribo elements_ = elements; } + template <typename L> + bool + document<L>::has_whitespace_seps() const + { + return whitespace_seps_.is_valid(); + } + template <typename L> - const mln::image2d<value::rgb8>& - document<L>::image() const + const mln::image2d<bool>& + document<L>::whitespace_seps() const { - return image_; + return whitespace_seps_; + } + + + template <typename L> + const component_set<L>& + document<L>::whitespace_seps_comps() const + { + return whitespace_seps_comps_; } template <typename L> void - document<L>::set_image(const mln::image2d<value::rgb8>& image) + document<L>::set_whitespace_separators(const image2d<bool>& whitespace_seps) { - image_ = image; + whitespace_seps_ = whitespace_seps; + + mln_value(L) ncomps; + whitespace_seps_comps_ = primitive::extract::components(whitespace_seps, + mln::c8(), ncomps, + component::WhitespaceSeparator); } template <typename L> bool - document<L>::has_whitespace_seps() const + document<L>::has_hline_seps() const { - return whitespace_seps_.is_valid(); + return hline_seps_.is_valid(); } template <typename L> const mln::image2d<bool>& - document<L>::whitespace_seps() const + document<L>::hline_seps() const { - return whitespace_seps_; + return hline_seps_; } template <typename L> const component_set<L>& - document<L>::whitespace_seps_comps() const + document<L>::hline_seps_comps() const { - return whitespace_seps_comps_; + return hline_seps_comps_; } template <typename L> void - document<L>::set_whitespace_separators(const image2d<bool>& whitespace_seps) + document<L>::set_hline_separators(const image2d<bool>& hline_seps) { - whitespace_seps_ = whitespace_seps; + hline_seps_ = hline_seps; mln_value(L) ncomps; - whitespace_seps_comps_ = primitive::extract::components(whitespace_seps, - mln::c8(), ncomps, - component::WhitespaceSeparator); + hline_seps_comps_ = primitive::extract::components(hline_seps, + mln::c8(), ncomps, + component::LineSeparator); } template <typename L> bool - document<L>::has_line_seps() const + document<L>::has_vline_seps() const { - return line_seps_.is_valid(); + return vline_seps_.is_valid(); } template <typename L> const mln::image2d<bool>& - document<L>::line_seps() const + document<L>::vline_seps() const { - return line_seps_; + return vline_seps_; } template <typename L> const component_set<L>& - document<L>::line_seps_comps() const + document<L>::vline_seps_comps() const { - return line_seps_comps_; + return vline_seps_comps_; } template <typename L> void - document<L>::set_line_separators(const image2d<bool>& line_seps) + document<L>::set_vline_separators(const image2d<bool>& vline_seps) { - line_seps_ = line_seps; + vline_seps_ = vline_seps; mln_value(L) ncomps; - line_seps_comps_ = primitive::extract::components(line_seps, - mln::c8(), ncomps, - component::LineSeparator); + vline_seps_comps_ = primitive::extract::components(vline_seps, + mln::c8(), ncomps, + component::LineSeparator); + } + + + template <typename L> + const mln::image2d<value::rgb8>& + document<L>::image() const + { + return image_; } + template <typename L> + void + document<L>::set_image(const mln::image2d<value::rgb8>& image) + { + image_ = image; + } + + + template <typename L> + const mln::image2d<bool>& + document<L>::binary_image() const + { + return binary_image_; + } + + + template <typename L> + void + document<L>::set_binary_image(const mln::image2d<bool>& binary_image) + { + binary_image_ = binary_image; + } + # endif // ! MLN_INCLUDE_ONLY diff --git a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh index f573d88..51e7ad3 100644 --- a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh @@ -114,8 +114,10 @@ namespace scribo doc.elements().accept(*this); // line seraparators - if (doc.has_line_seps()) - doc.line_seps_comps().accept(*this); + if (doc.has_vline_seps()) + doc.vline_seps_comps().accept(*this); + if (doc.has_hline_seps()) + doc.hline_seps_comps().accept(*this); // Whitespace seraparators if (doc.has_whitespace_seps()) diff --git a/scribo/scribo/io/xml/internal/full_xml_visitor.hh b/scribo/scribo/io/xml/internal/full_xml_visitor.hh index 701c1b7..d466b34 100644 --- a/scribo/scribo/io/xml/internal/full_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/full_xml_visitor.hh @@ -164,14 +164,12 @@ namespace scribo // line seraparators - if (doc.has_line_seps()) - { - const component_set<L>& - line_seps_comps = doc.line_seps_comps(); - - for_all_comps(c, line_seps_comps) - line_seps_comps(c).accept(*this); - } + if (doc.has_hline_seps()) + for_all_comps(c, doc.hline_seps_comps()) + doc.hline_seps_comps()(c).accept(*this); + if (doc.has_vline_seps()) + for_all_comps(c, doc.vline_seps_comps()) + doc.vline_seps_comps()(c).accept(*this); // Whitespace seraparators diff --git a/scribo/scribo/io/xml/internal/page_xml_visitor.hh b/scribo/scribo/io/xml/internal/page_xml_visitor.hh index 52d8f12..9dec1e7 100644 --- a/scribo/scribo/io/xml/internal/page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/page_xml_visitor.hh @@ -116,8 +116,10 @@ namespace scribo doc.elements().accept(*this); // line seraparators - if (doc.has_line_seps()) - doc.line_seps_comps().accept(*this); + if (doc.has_vline_seps()) + doc.vline_seps_comps().accept(*this); + if (doc.has_hline_seps()) + doc.hline_seps_comps().accept(*this); output << " </page>" << std::endl; output << "</pcGts>" << std::endl; diff --git a/scribo/scribo/toolchain/internal/content_in_doc_functor.hh b/scribo/scribo/toolchain/internal/content_in_doc_functor.hh index 40f013c..3e6668f 100644 --- a/scribo/scribo/toolchain/internal/content_in_doc_functor.hh +++ b/scribo/scribo/toolchain/internal/content_in_doc_functor.hh @@ -162,6 +162,7 @@ namespace scribo mln_precondition(exact(processed_image).is_valid()); doc.set_image(exact(original_image)); + doc.set_binary_image(exact(processed_image)); // Remove separators mln_ch_value(I,bool) @@ -169,17 +170,30 @@ namespace scribo input_cleaned = exact(processed_image); if (enable_line_seps) { + // FIXME: SLOW on_new_progress_label("Find vertical and horizontal separators..."); // Vertical and horizontal separators - separators = primitive::extract::separators(processed_image, 81); + { + mln_ch_value(I,bool) + vseparators = primitive::extract::vertical_separators(processed_image, 81), + hseparators = primitive::extract::horizontal_separators(processed_image, 81); + + doc.set_vline_separators(vseparators); + doc.set_hline_separators(hseparators); + + separators = vseparators; + separators += hseparators; + + border::resize(processed_image, border::thickness); + } on_progress(); on_new_progress_label("Remove separators..."); - input_cleaned = primitive::remove::separators(processed_image, separators); - doc.set_line_separators(separators); + input_cleaned = primitive::remove::separators(processed_image, + separators); on_progress(); } -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-796-g20da74d Store more information in scribo::document.
by Guillaume Lazzara
* scribo/core/document.hh: Make a distinction between horizontal and vertical lines. Store the binary image. * scribo/io/xml/internal/extended_page_xml_visitor.hh, * scribo/io/xml/internal/full_xml_visitor.hh, * scribo/io/xml/internal/page_xml_visitor.hh, * scribo/toolchain/internal/content_in_doc_functor.hh: Make use of that new methods and information. --- scribo/ChangeLog | 13 ++ scribo/scribo/core/document.hh | 137 ++++++++++++++----- .../io/xml/internal/extended_page_xml_visitor.hh | 6 +- scribo/scribo/io/xml/internal/full_xml_visitor.hh | 14 +- scribo/scribo/io/xml/internal/page_xml_visitor.hh | 6 +- .../toolchain/internal/content_in_doc_functor.hh | 20 +++- 6 files changed, 145 insertions(+), 51 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 1928592..33b036a 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,18 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Store more information in scribo::document. + + * scribo/core/document.hh: Make a distinction between horizontal + and vertical lines. Store the binary image. + + * scribo/io/xml/internal/extended_page_xml_visitor.hh, + * scribo/io/xml/internal/full_xml_visitor.hh, + * scribo/io/xml/internal/page_xml_visitor.hh, + * scribo/toolchain/internal/content_in_doc_functor.hh: Make use of + that new methods and information. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Rename line_info::components() to line_info::component_ids. * scribo/core/line_info.hh: Here. diff --git a/scribo/scribo/core/document.hh b/scribo/scribo/core/document.hh index 689d0e3..f38b20b 100644 --- a/scribo/scribo/core/document.hh +++ b/scribo/scribo/core/document.hh @@ -85,23 +85,34 @@ namespace scribo const component_set<L>& elements() const; void set_elements(const component_set<L>& elements); - const mln::image2d<value::rgb8>& image() const; - void set_image(const mln::image2d<value::rgb8>& image); - bool has_whitespace_seps() const; const mln::image2d<bool>& whitespace_seps() const; const component_set<L>& whitespace_seps_comps() const; void set_whitespace_separators(const image2d<bool>& whitespace_seps); - bool has_line_seps() const; - const mln::image2d<bool>& line_seps() const; - const component_set<L>& line_seps_comps() const; - void set_line_separators(const image2d<bool>& line_seps); + // Horizontal separators + bool has_hline_seps() const; + const mln::image2d<bool>& hline_seps() const; + const component_set<L>& hline_seps_comps() const; + void set_hline_separators(const image2d<bool>& line_seps); + + // Vertical separators + bool has_vline_seps() const; + const mln::image2d<bool>& vline_seps() const; + const component_set<L>& vline_seps_comps() const; + void set_vline_separators(const image2d<bool>& line_seps); + + const mln::image2d<value::rgb8>& image() const; + void set_image(const mln::image2d<value::rgb8>& image); + + const mln::image2d<bool>& binary_image() const; + void set_binary_image(const mln::image2d<bool>& binary_image); private: std::string filename_; mln::image2d<mln::value::rgb8> image_; + mln::image2d<bool> binary_image_; paragraph_set<L> parset_; component_set<L> elements_; @@ -109,8 +120,11 @@ namespace scribo mln::image2d<bool> whitespace_seps_; component_set<L> whitespace_seps_comps_; - mln::image2d<bool> line_seps_; - component_set<L> line_seps_comps_; + mln::image2d<bool> hline_seps_; + component_set<L> hline_seps_comps_; + + mln::image2d<bool> vline_seps_; + component_set<L> vline_seps_comps_; }; @@ -251,97 +265,148 @@ namespace scribo elements_ = elements; } + template <typename L> + bool + document<L>::has_whitespace_seps() const + { + return whitespace_seps_.is_valid(); + } + template <typename L> - const mln::image2d<value::rgb8>& - document<L>::image() const + const mln::image2d<bool>& + document<L>::whitespace_seps() const { - return image_; + return whitespace_seps_; + } + + + template <typename L> + const component_set<L>& + document<L>::whitespace_seps_comps() const + { + return whitespace_seps_comps_; } template <typename L> void - document<L>::set_image(const mln::image2d<value::rgb8>& image) + document<L>::set_whitespace_separators(const image2d<bool>& whitespace_seps) { - image_ = image; + whitespace_seps_ = whitespace_seps; + + mln_value(L) ncomps; + whitespace_seps_comps_ = primitive::extract::components(whitespace_seps, + mln::c8(), ncomps, + component::WhitespaceSeparator); } template <typename L> bool - document<L>::has_whitespace_seps() const + document<L>::has_hline_seps() const { - return whitespace_seps_.is_valid(); + return hline_seps_.is_valid(); } template <typename L> const mln::image2d<bool>& - document<L>::whitespace_seps() const + document<L>::hline_seps() const { - return whitespace_seps_; + return hline_seps_; } template <typename L> const component_set<L>& - document<L>::whitespace_seps_comps() const + document<L>::hline_seps_comps() const { - return whitespace_seps_comps_; + return hline_seps_comps_; } template <typename L> void - document<L>::set_whitespace_separators(const image2d<bool>& whitespace_seps) + document<L>::set_hline_separators(const image2d<bool>& hline_seps) { - whitespace_seps_ = whitespace_seps; + hline_seps_ = hline_seps; mln_value(L) ncomps; - whitespace_seps_comps_ = primitive::extract::components(whitespace_seps, - mln::c8(), ncomps, - component::WhitespaceSeparator); + hline_seps_comps_ = primitive::extract::components(hline_seps, + mln::c8(), ncomps, + component::LineSeparator); } template <typename L> bool - document<L>::has_line_seps() const + document<L>::has_vline_seps() const { - return line_seps_.is_valid(); + return vline_seps_.is_valid(); } template <typename L> const mln::image2d<bool>& - document<L>::line_seps() const + document<L>::vline_seps() const { - return line_seps_; + return vline_seps_; } template <typename L> const component_set<L>& - document<L>::line_seps_comps() const + document<L>::vline_seps_comps() const { - return line_seps_comps_; + return vline_seps_comps_; } template <typename L> void - document<L>::set_line_separators(const image2d<bool>& line_seps) + document<L>::set_vline_separators(const image2d<bool>& vline_seps) { - line_seps_ = line_seps; + vline_seps_ = vline_seps; mln_value(L) ncomps; - line_seps_comps_ = primitive::extract::components(line_seps, - mln::c8(), ncomps, - component::LineSeparator); + vline_seps_comps_ = primitive::extract::components(vline_seps, + mln::c8(), ncomps, + component::LineSeparator); + } + + + template <typename L> + const mln::image2d<value::rgb8>& + document<L>::image() const + { + return image_; } + template <typename L> + void + document<L>::set_image(const mln::image2d<value::rgb8>& image) + { + image_ = image; + } + + + template <typename L> + const mln::image2d<bool>& + document<L>::binary_image() const + { + return binary_image_; + } + + + template <typename L> + void + document<L>::set_binary_image(const mln::image2d<bool>& binary_image) + { + binary_image_ = binary_image; + } + # endif // ! MLN_INCLUDE_ONLY diff --git a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh index f573d88..51e7ad3 100644 --- a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh @@ -114,8 +114,10 @@ namespace scribo doc.elements().accept(*this); // line seraparators - if (doc.has_line_seps()) - doc.line_seps_comps().accept(*this); + if (doc.has_vline_seps()) + doc.vline_seps_comps().accept(*this); + if (doc.has_hline_seps()) + doc.hline_seps_comps().accept(*this); // Whitespace seraparators if (doc.has_whitespace_seps()) diff --git a/scribo/scribo/io/xml/internal/full_xml_visitor.hh b/scribo/scribo/io/xml/internal/full_xml_visitor.hh index 701c1b7..d466b34 100644 --- a/scribo/scribo/io/xml/internal/full_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/full_xml_visitor.hh @@ -164,14 +164,12 @@ namespace scribo // line seraparators - if (doc.has_line_seps()) - { - const component_set<L>& - line_seps_comps = doc.line_seps_comps(); - - for_all_comps(c, line_seps_comps) - line_seps_comps(c).accept(*this); - } + if (doc.has_hline_seps()) + for_all_comps(c, doc.hline_seps_comps()) + doc.hline_seps_comps()(c).accept(*this); + if (doc.has_vline_seps()) + for_all_comps(c, doc.vline_seps_comps()) + doc.vline_seps_comps()(c).accept(*this); // Whitespace seraparators diff --git a/scribo/scribo/io/xml/internal/page_xml_visitor.hh b/scribo/scribo/io/xml/internal/page_xml_visitor.hh index 52d8f12..9dec1e7 100644 --- a/scribo/scribo/io/xml/internal/page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/page_xml_visitor.hh @@ -116,8 +116,10 @@ namespace scribo doc.elements().accept(*this); // line seraparators - if (doc.has_line_seps()) - doc.line_seps_comps().accept(*this); + if (doc.has_vline_seps()) + doc.vline_seps_comps().accept(*this); + if (doc.has_hline_seps()) + doc.hline_seps_comps().accept(*this); output << " </page>" << std::endl; output << "</pcGts>" << std::endl; diff --git a/scribo/scribo/toolchain/internal/content_in_doc_functor.hh b/scribo/scribo/toolchain/internal/content_in_doc_functor.hh index 40f013c..3e6668f 100644 --- a/scribo/scribo/toolchain/internal/content_in_doc_functor.hh +++ b/scribo/scribo/toolchain/internal/content_in_doc_functor.hh @@ -162,6 +162,7 @@ namespace scribo mln_precondition(exact(processed_image).is_valid()); doc.set_image(exact(original_image)); + doc.set_binary_image(exact(processed_image)); // Remove separators mln_ch_value(I,bool) @@ -169,17 +170,30 @@ namespace scribo input_cleaned = exact(processed_image); if (enable_line_seps) { + // FIXME: SLOW on_new_progress_label("Find vertical and horizontal separators..."); // Vertical and horizontal separators - separators = primitive::extract::separators(processed_image, 81); + { + mln_ch_value(I,bool) + vseparators = primitive::extract::vertical_separators(processed_image, 81), + hseparators = primitive::extract::horizontal_separators(processed_image, 81); + + doc.set_vline_separators(vseparators); + doc.set_hline_separators(hseparators); + + separators = vseparators; + separators += hseparators; + + border::resize(processed_image, border::thickness); + } on_progress(); on_new_progress_label("Remove separators..."); - input_cleaned = primitive::remove::separators(processed_image, separators); - doc.set_line_separators(separators); + input_cleaned = primitive::remove::separators(processed_image, + separators); on_progress(); } -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-796-g9721b83 Store more information in scribo::document.
by Guillaume Lazzara
* scribo/core/document.hh: Make a distinction between horizontal and vertical lines. Store the binary image. * scribo/io/xml/internal/extended_page_xml_visitor.hh, * scribo/io/xml/internal/full_xml_visitor.hh, * scribo/io/xml/internal/page_xml_visitor.hh, * scribo/toolchain/internal/content_in_doc_functor.hh: Make use of that new methods and information. --- scribo/ChangeLog | 13 ++ scribo/scribo/core/document.hh | 137 ++++++++++++++----- .../io/xml/internal/extended_page_xml_visitor.hh | 6 +- scribo/scribo/io/xml/internal/full_xml_visitor.hh | 14 +- scribo/scribo/io/xml/internal/page_xml_visitor.hh | 6 +- .../toolchain/internal/content_in_doc_functor.hh | 20 +++- 6 files changed, 145 insertions(+), 51 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 1928592..33b036a 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,18 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Store more information in scribo::document. + + * scribo/core/document.hh: Make a distinction between horizontal + and vertical lines. Store the binary image. + + * scribo/io/xml/internal/extended_page_xml_visitor.hh, + * scribo/io/xml/internal/full_xml_visitor.hh, + * scribo/io/xml/internal/page_xml_visitor.hh, + * scribo/toolchain/internal/content_in_doc_functor.hh: Make use of + that new methods and information. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Rename line_info::components() to line_info::component_ids. * scribo/core/line_info.hh: Here. diff --git a/scribo/scribo/core/document.hh b/scribo/scribo/core/document.hh index 689d0e3..f38b20b 100644 --- a/scribo/scribo/core/document.hh +++ b/scribo/scribo/core/document.hh @@ -85,23 +85,34 @@ namespace scribo const component_set<L>& elements() const; void set_elements(const component_set<L>& elements); - const mln::image2d<value::rgb8>& image() const; - void set_image(const mln::image2d<value::rgb8>& image); - bool has_whitespace_seps() const; const mln::image2d<bool>& whitespace_seps() const; const component_set<L>& whitespace_seps_comps() const; void set_whitespace_separators(const image2d<bool>& whitespace_seps); - bool has_line_seps() const; - const mln::image2d<bool>& line_seps() const; - const component_set<L>& line_seps_comps() const; - void set_line_separators(const image2d<bool>& line_seps); + // Horizontal separators + bool has_hline_seps() const; + const mln::image2d<bool>& hline_seps() const; + const component_set<L>& hline_seps_comps() const; + void set_hline_separators(const image2d<bool>& line_seps); + + // Vertical separators + bool has_vline_seps() const; + const mln::image2d<bool>& vline_seps() const; + const component_set<L>& vline_seps_comps() const; + void set_vline_separators(const image2d<bool>& line_seps); + + const mln::image2d<value::rgb8>& image() const; + void set_image(const mln::image2d<value::rgb8>& image); + + const mln::image2d<bool>& binary_image() const; + void set_binary_image(const mln::image2d<bool>& binary_image); private: std::string filename_; mln::image2d<mln::value::rgb8> image_; + mln::image2d<bool> binary_image_; paragraph_set<L> parset_; component_set<L> elements_; @@ -109,8 +120,11 @@ namespace scribo mln::image2d<bool> whitespace_seps_; component_set<L> whitespace_seps_comps_; - mln::image2d<bool> line_seps_; - component_set<L> line_seps_comps_; + mln::image2d<bool> hline_seps_; + component_set<L> hline_seps_comps_; + + mln::image2d<bool> vline_seps_; + component_set<L> vline_seps_comps_; }; @@ -251,97 +265,148 @@ namespace scribo elements_ = elements; } + template <typename L> + bool + document<L>::has_whitespace_seps() const + { + return whitespace_seps_.is_valid(); + } + template <typename L> - const mln::image2d<value::rgb8>& - document<L>::image() const + const mln::image2d<bool>& + document<L>::whitespace_seps() const { - return image_; + return whitespace_seps_; + } + + + template <typename L> + const component_set<L>& + document<L>::whitespace_seps_comps() const + { + return whitespace_seps_comps_; } template <typename L> void - document<L>::set_image(const mln::image2d<value::rgb8>& image) + document<L>::set_whitespace_separators(const image2d<bool>& whitespace_seps) { - image_ = image; + whitespace_seps_ = whitespace_seps; + + mln_value(L) ncomps; + whitespace_seps_comps_ = primitive::extract::components(whitespace_seps, + mln::c8(), ncomps, + component::WhitespaceSeparator); } template <typename L> bool - document<L>::has_whitespace_seps() const + document<L>::has_hline_seps() const { - return whitespace_seps_.is_valid(); + return hline_seps_.is_valid(); } template <typename L> const mln::image2d<bool>& - document<L>::whitespace_seps() const + document<L>::hline_seps() const { - return whitespace_seps_; + return hline_seps_; } template <typename L> const component_set<L>& - document<L>::whitespace_seps_comps() const + document<L>::hline_seps_comps() const { - return whitespace_seps_comps_; + return hline_seps_comps_; } template <typename L> void - document<L>::set_whitespace_separators(const image2d<bool>& whitespace_seps) + document<L>::set_hline_separators(const image2d<bool>& hline_seps) { - whitespace_seps_ = whitespace_seps; + hline_seps_ = hline_seps; mln_value(L) ncomps; - whitespace_seps_comps_ = primitive::extract::components(whitespace_seps, - mln::c8(), ncomps, - component::WhitespaceSeparator); + hline_seps_comps_ = primitive::extract::components(hline_seps, + mln::c8(), ncomps, + component::LineSeparator); } template <typename L> bool - document<L>::has_line_seps() const + document<L>::has_vline_seps() const { - return line_seps_.is_valid(); + return vline_seps_.is_valid(); } template <typename L> const mln::image2d<bool>& - document<L>::line_seps() const + document<L>::vline_seps() const { - return line_seps_; + return vline_seps_; } template <typename L> const component_set<L>& - document<L>::line_seps_comps() const + document<L>::vline_seps_comps() const { - return line_seps_comps_; + return vline_seps_comps_; } template <typename L> void - document<L>::set_line_separators(const image2d<bool>& line_seps) + document<L>::set_vline_separators(const image2d<bool>& vline_seps) { - line_seps_ = line_seps; + vline_seps_ = vline_seps; mln_value(L) ncomps; - line_seps_comps_ = primitive::extract::components(line_seps, - mln::c8(), ncomps, - component::LineSeparator); + vline_seps_comps_ = primitive::extract::components(vline_seps, + mln::c8(), ncomps, + component::LineSeparator); + } + + + template <typename L> + const mln::image2d<value::rgb8>& + document<L>::image() const + { + return image_; } + template <typename L> + void + document<L>::set_image(const mln::image2d<value::rgb8>& image) + { + image_ = image; + } + + + template <typename L> + const mln::image2d<bool>& + document<L>::binary_image() const + { + return binary_image_; + } + + + template <typename L> + void + document<L>::set_binary_image(const mln::image2d<bool>& binary_image) + { + binary_image_ = binary_image; + } + # endif // ! MLN_INCLUDE_ONLY diff --git a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh index f573d88..51e7ad3 100644 --- a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh @@ -114,8 +114,10 @@ namespace scribo doc.elements().accept(*this); // line seraparators - if (doc.has_line_seps()) - doc.line_seps_comps().accept(*this); + if (doc.has_vline_seps()) + doc.vline_seps_comps().accept(*this); + if (doc.has_hline_seps()) + doc.hline_seps_comps().accept(*this); // Whitespace seraparators if (doc.has_whitespace_seps()) diff --git a/scribo/scribo/io/xml/internal/full_xml_visitor.hh b/scribo/scribo/io/xml/internal/full_xml_visitor.hh index 701c1b7..d466b34 100644 --- a/scribo/scribo/io/xml/internal/full_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/full_xml_visitor.hh @@ -164,14 +164,12 @@ namespace scribo // line seraparators - if (doc.has_line_seps()) - { - const component_set<L>& - line_seps_comps = doc.line_seps_comps(); - - for_all_comps(c, line_seps_comps) - line_seps_comps(c).accept(*this); - } + if (doc.has_hline_seps()) + for_all_comps(c, doc.hline_seps_comps()) + doc.hline_seps_comps()(c).accept(*this); + if (doc.has_vline_seps()) + for_all_comps(c, doc.vline_seps_comps()) + doc.vline_seps_comps()(c).accept(*this); // Whitespace seraparators diff --git a/scribo/scribo/io/xml/internal/page_xml_visitor.hh b/scribo/scribo/io/xml/internal/page_xml_visitor.hh index 52d8f12..9dec1e7 100644 --- a/scribo/scribo/io/xml/internal/page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/page_xml_visitor.hh @@ -116,8 +116,10 @@ namespace scribo doc.elements().accept(*this); // line seraparators - if (doc.has_line_seps()) - doc.line_seps_comps().accept(*this); + if (doc.has_vline_seps()) + doc.vline_seps_comps().accept(*this); + if (doc.has_hline_seps()) + doc.hline_seps_comps().accept(*this); output << " </page>" << std::endl; output << "</pcGts>" << std::endl; diff --git a/scribo/scribo/toolchain/internal/content_in_doc_functor.hh b/scribo/scribo/toolchain/internal/content_in_doc_functor.hh index 40f013c..3e6668f 100644 --- a/scribo/scribo/toolchain/internal/content_in_doc_functor.hh +++ b/scribo/scribo/toolchain/internal/content_in_doc_functor.hh @@ -162,6 +162,7 @@ namespace scribo mln_precondition(exact(processed_image).is_valid()); doc.set_image(exact(original_image)); + doc.set_binary_image(exact(processed_image)); // Remove separators mln_ch_value(I,bool) @@ -169,17 +170,30 @@ namespace scribo input_cleaned = exact(processed_image); if (enable_line_seps) { + // FIXME: SLOW on_new_progress_label("Find vertical and horizontal separators..."); // Vertical and horizontal separators - separators = primitive::extract::separators(processed_image, 81); + { + mln_ch_value(I,bool) + vseparators = primitive::extract::vertical_separators(processed_image, 81), + hseparators = primitive::extract::horizontal_separators(processed_image, 81); + + doc.set_vline_separators(vseparators); + doc.set_hline_separators(hseparators); + + separators = vseparators; + separators += hseparators; + + border::resize(processed_image, border::thickness); + } on_progress(); on_new_progress_label("Remove separators..."); - input_cleaned = primitive::remove::separators(processed_image, separators); - doc.set_line_separators(separators); + input_cleaned = primitive::remove::separators(processed_image, + separators); on_progress(); } -- 1.5.6.5
13 years, 9 months
1
0
0
0
last-svn-commit-796-gdd1061b Rename line_info::components() to line_info::component_ids.
by Guillaume Lazzara
* 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 8de7299..52e3125 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,12 +1,32 @@ 2011-03-14 Guillaume Lazzara <z(a)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(a)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
13 years, 9 months
1
0
0
0
last-svn-commit-795-g881caef Rename line_info::components() to line_info::component_ids.
by Guillaume Lazzara
* 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(a)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(a)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
13 years, 9 months
1
0
0
0
last-svn-commit-795-g2cd9b01 Rename line_info::components() to line_info::component_ids.
by Guillaume Lazzara
* 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(a)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(a)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
13 years, 9 months
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Results per page:
10
25
50
100
200