Commit 68432bbd authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Small fixes in Scribo.

	* scribo/core/paragraph_info.hh: Update delta baseline.

	* scribo/primitive/extract/non_text.hh: Fill extension.

	* scribo/util/component_precise_outline.hh: Adjust extension.
parent 17d260bf
2011-08-09 Guillaume Lazzara <z@lrde.epita.fr>
Small fixes in Scribo.
* scribo/core/paragraph_info.hh: Update delta baseline.
* scribo/primitive/extract/non_text.hh: Fill extension.
* scribo/util/component_precise_outline.hh: Adjust extension.
2011-08-09 Guillaume Lazzara <z@lrde.epita.fr>
Fix XML I/O.
......
......@@ -224,6 +224,8 @@ namespace scribo
const line_set<L>& lines = llinks_.lines();
// Update color
mln::accu::stat::mean<mln::value::int_u<8> >
color_red,
color_green,
......@@ -261,10 +263,35 @@ namespace scribo
color_reliability_ = std::sqrt(std::max(var_red,
std::max(var_green, var_blue)));
// Update color
// FIXME: Update paragraph stats
// Compute paragraph's delta baseline
stats< float > delta(nlines());
const unsigned nelements = line_ids_.nelements();
for (unsigned i = 0; i < nelements; ++i)
{
const line_id_t& current_id = line_ids_(i);
if (llinks_(current_id) != current_id)
{
const line_info<L>& current_line = lines(current_id);
const line_info<L>& left_line = lines(llinks_(current_id));
delta.take(left_line.baseline() - current_line.baseline());
}
}
int median = delta.median();
if (!median)
median = lines(line_ids_(0)).x_height();
set_delta_baseline(median);
// Update tag
tag_ = paragraph::None;
}
......
......@@ -42,6 +42,8 @@
# include <scribo/primitive/extract/internal/union.hh>
# include <scribo/debug/logger.hh>
# include <mln/literal/black.hh>
//DEBUG
#include <mln/util/timer.hh>
#include <mln/io/pbm/save.hh>
......@@ -114,7 +116,7 @@ namespace scribo
border::resize(seps, border::thickness);
// std::abort();
}
extension::fill(input, literal::black);
const unsigned q_div = std::pow(2.f, (int)(8 - nbits));
const unsigned q = unsigned(std::pow(2.f, (int)nbits));
......
......@@ -368,7 +368,7 @@ namespace scribo
const I& input = exact(input_);
typedef mln_site(I) P;
extension::fill(input, 0);
extension::adjust_fill(input, 3, 0);
mln::p_array<P> points;
points.reserve(std::max(geom::ncols(input), geom::nrows(input)));
......
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