27 #ifndef SCRIBO_FILTER_PARAGRAPHS_IN_BORDERS_HH
28 # define SCRIBO_FILTER_PARAGRAPHS_IN_BORDERS_HH
36 # include <mln/core/concept/image.hh>
37 # include <scribo/core/component_set.hh>
38 # include <scribo/core/document.hh>
39 # include <scribo/util/box_is_included.hh>
79 # ifndef MLN_INCLUDE_ONLY
85 mln_trace(
"scribo::filter::paragraphs_in_borders");
87 mln_precondition(doc.is_valid());
91 unsigned border_size =
std::min(43., 0.02 * ima.domain().width());
105 ptl = ima.domain().pmin(),
108 pbr = ima.domain().pmax(),
121 paragraph_set<L> parset = doc.paragraphs();
122 for_all_paragraphs(p, parset)
123 if (parset(p).is_valid())
124 if (util::box_is_included(parset(p).
bbox(), bt)
125 || util::box_is_included(parset(p).bbox(), br)
126 || util::box_is_included(parset(p).bbox(), bb)
127 || util::box_is_included(parset(p).bbox(), bl))
129 parset(p).invalidate();
132 doc.set_paragraphs(parset);
137 # endif // ! MLN_INCLUDE_ONLY
143 #endif // ! SCRIBO_FILTER_PARAGRAPHS_IN_BORDERS_HH