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

Introduce mln_trace_warning macro.

	* mln/border/mirror.hh,
	* mln/canvas/labeling/blobs.hh,
	* mln/canvas/labeling/generic.hh,
	* mln/canvas/labeling/sorted.hh,
	* mln/canvas/labeling/video.hh,
	* mln/data/stretch.hh,
	* mln/debug/put_word.hh,
	* mln/debug/trace.hh,
	* mln/draw/dashed_line.hh,
	* mln/draw/line.hh,
	* mln/labeling/colorize.hh,
	* mln/subsampling/antialiased.hh: Make use of this macro here.
parent 3164abc5
2013-03-19 Guillaume Lazzara <z@lrde.epita.fr>
Introduce mln_trace_warning macro.
* mln/border/mirror.hh,
* mln/canvas/labeling/blobs.hh,
* mln/canvas/labeling/generic.hh,
* mln/canvas/labeling/sorted.hh,
* mln/canvas/labeling/video.hh,
* mln/data/stretch.hh,
* mln/debug/put_word.hh,
* mln/debug/trace.hh,
* mln/draw/dashed_line.hh,
* mln/draw/line.hh,
* mln/labeling/colorize.hh,
* mln/subsampling/antialiased.hh: Make use of this macro here.
2013-03-19 Guillaume Lazzara <z@lrde.epita.fr>
 
Remove last references to mln::trace::*.
......@@ -197,7 +197,7 @@ namespace mln
inline
void mirror_(const box3d&, const I& ima)
{
debug::trace::warning("border::mirror for 3D image is not implemented,"
mln_trace_warning("border::mirror for 3D image is not implemented,"
" so image borders have not been mirrored!");
(void) ima;
// FIXME write it!
......
......@@ -120,7 +120,7 @@ namespace mln
// Label this point component.
if (nlabels == mln_max(L))
{
debug::trace::warning("labeling aborted! Too many labels \
mln_trace_warning("labeling aborted! Too many labels \
for this label type: nlabels > max(label_type).");
return output;
......
......@@ -161,7 +161,7 @@ namespace mln
if (nlabels == mln_max(L))
{
status = false;
debug::trace::warning("labeling aborted! Too many labels \
mln_trace_warning("labeling aborted! Too many labels \
for this label type: nlabels > \
max(label_type).");
......
......@@ -172,7 +172,7 @@ namespace mln
{
if (nlabels == mln_max(L))
{
debug::trace::warning("labeling aborted! Too many labels \
mln_trace_warning("labeling aborted! Too many labels \
for this label type: nlabels > \
max(label_type).");
return output;
......
......@@ -159,7 +159,7 @@ namespace mln
{
if (nlabels == mln_max(L))
{
debug::trace::warning("labeling aborted! Too many labels for \
mln_trace_warning("labeling aborted! Too many labels for \
this label type: nlabels > \
max(label_type).");
return output;
......
......@@ -111,7 +111,7 @@ namespace mln
else
{
initialize(output, input);
debug::trace::warning("output has no significative data!");
mln_trace_warning("output has no significative data!");
}
return output;
......
......@@ -66,7 +66,7 @@ namespace mln
word_end.last_coord() = static_cast<def::coord>(word_end.last_coord() + word.length() - 1);
if (! inout.has(word_end))
debug::trace::warning("Cannot write text outside the image domain");
mln_trace_warning("Cannot write text outside the image domain");
const unsigned n = word.length();
point2d p = word_start;
......
......@@ -40,6 +40,8 @@
mln::debug::trace mln_trace_(S); \
(void) mln_trace_;
# define mln_trace_warning(S) \
mln::debug::trace::warning(S);
namespace mln
{
......@@ -61,6 +63,9 @@ namespace mln
void my_function()
{
mln_trace("mln::my_function");
/// Your code
/// ....
}
}
\endcode
......@@ -117,6 +122,7 @@ namespace mln
// Implementations.
inline
trace::trace(const std::string& scope)
{
if (quiet)
......@@ -136,6 +142,7 @@ namespace mln
}
inline
trace::~trace()
{
if (quiet)
......@@ -179,12 +186,14 @@ namespace mln
}
inline
void trace::resume()
{
quiet = is_quiet_;
}
inline
void trace::stop()
{
is_quiet_ = quiet;
......@@ -193,6 +202,7 @@ namespace mln
}
inline
void trace::warning(const std::string& message)
{
std::cerr << "Warning: " << message << std::endl;
......
......@@ -99,9 +99,9 @@ namespace mln
mln_precondition(ima.is_valid());
if (! ima.has(beg))
debug::trace::warning("Begin site is not part of the given image.");
mln_trace_warning("Begin site is not part of the given image.");
if (! ima.has(end))
debug::trace::warning("End site is not part of the given image.");
mln_trace_warning("End site is not part of the given image.");
data::fill(((ima | p_line2d(beg, end)).rw() | internal::dashed_line_f<I, 1>()).rw(), v);
}
......
......@@ -78,9 +78,9 @@ namespace mln
I& ima = exact(ima_);
mln_precondition(ima.is_valid());
if (! ima.has(beg))
debug::trace::warning("Begin site is not part of the given image.");
mln_trace_warning("Begin site is not part of the given image.");
if (! ima.has(end))
debug::trace::warning("End site is not part of the given image.");
mln_trace_warning("End site is not part of the given image.");
data::paste(pw::cst(v) | p_line2d(beg, end),
safe(ima).rw());
}
......
......@@ -144,7 +144,7 @@ namespace mln
if (ntries == nelements)
{
debug::trace::warning("labeling::colorize - Can't find a new unique color. Returning black.");
mln_trace_warning("labeling::colorize - Can't find a new unique color. Returning black.");
return literal::black;
}
......
......@@ -409,7 +409,7 @@ namespace mln
output_domain,
border_thickness);
else
debug::trace::warning("Not implemented yet.");
mln_trace_warning("Not implemented yet.");
mln_concrete(I) output;
return output;
......
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