* src/primitive/extract/Makefile.am,
* src/primitive/remove/Makefile.am: Add new targets.
* src/primitive/extract/separators_nonvisible.cc,
* src/primitive/remove/separators.cc: New.
---
scribo/ChangeLog | 10 ++++++++++
scribo/src/primitive/extract/Makefile.am | 2 ++
.../extract/separators_nonvisible.cc} | 19 ++++++++++---------
scribo/src/primitive/{ => remove}/Makefile.am | 11 ++++++-----
.../negate.cc => primitive/remove/separators.cc} | 20 ++++++++++++--------
5 files changed, 40 insertions(+), 22 deletions(-)
copy scribo/src/{misc/negate.cc => primitive/extract/separators_nonvisible.cc} (79%)
copy scribo/src/primitive/{ => remove}/Makefile.am (82%)
copy scribo/src/{misc/negate.cc => primitive/remove/separators.cc} (76%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 0aa4ba2..8b7ad7f 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,15 @@
2011-02-17 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Add new tools in Scribo.
+
+ * src/primitive/extract/Makefile.am,
+ * src/primitive/remove/Makefile.am: Add new targets.
+
+ * src/primitive/extract/separators_nonvisible.cc,
+ * src/primitive/remove/separators.cc: New.
+
+2011-02-17 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Small fixes in Scribo.
* scribo/core/macros.hh: Update comments.
diff --git a/scribo/src/primitive/extract/Makefile.am
b/scribo/src/primitive/extract/Makefile.am
index a46cd68..22d6bfd 100644
--- a/scribo/src/primitive/extract/Makefile.am
+++ b/scribo/src/primitive/extract/Makefile.am
@@ -22,6 +22,7 @@ noinst_PROGRAMS = \
discontinued_lines \
discontinued_vlines \
discontinued_hlines \
+ separators_nonvisible \
thick_vlines \
thick_hlines \
lines_pattern
@@ -29,6 +30,7 @@ noinst_PROGRAMS = \
discontinued_lines_SOURCES = discontinued_lines.cc
discontinued_vlines_SOURCES = discontinued_vlines.cc
discontinued_hlines_SOURCES = discontinued_hlines.cc
+separators_nonvisible_SOURCES = separators_nonvisible.cc
thick_vlines_SOURCES = thick_vlines.cc
thick_hlines_SOURCES = thick_hlines.cc
lines_pattern_SOURCES = lines_pattern.cc
diff --git a/scribo/src/misc/negate.cc
b/scribo/src/primitive/extract/separators_nonvisible.cc
similarity index 79%
copy from scribo/src/misc/negate.cc
copy to scribo/src/primitive/extract/separators_nonvisible.cc
index da6fad6..82d4787 100644
--- a/scribo/src/misc/negate.cc
+++ b/scribo/src/primitive/extract/separators_nonvisible.cc
@@ -1,5 +1,4 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -25,35 +24,37 @@
// executable file might be covered by the GNU General Public License.
#include <mln/core/image/image2d.hh>
-#include <mln/logical/not.hh>
#include <mln/io/pbm/all.hh>
+#include <mln/data/convert.hh>
+#include <scribo/primitive/extract/separators_nonvisible2.hh>
#include <scribo/debug/usage.hh>
-
const char *args_desc[][2] =
{
{ "input.pbm", "A binary image." },
+ { "output.pbm", "Output image." },
{0, 0}
};
int main(int argc, char *argv[])
{
- mln::trace::entering("main");
using namespace mln;
+ using namespace scribo;
if (argc != 3)
return scribo::debug::usage(argv,
- "Negate a binary image",
+ "Extract non visible separators (whitespaces)",
"input.pbm output.pbm",
args_desc);
+ trace::entering("main");
+
image2d<bool> input;
io::pbm::load(input, argv[1]);
- io::pbm::save(logical::not_(input), argv[2]);
-
- mln::trace::exiting("main");
+ io::pbm::save(primitive::extract::separators_nonvisible(input), argv[2]);
+ trace::exiting("main");
}
diff --git a/scribo/src/primitive/Makefile.am b/scribo/src/primitive/remove/Makefile.am
similarity index 82%
copy from scribo/src/primitive/Makefile.am
copy to scribo/src/primitive/remove/Makefile.am
index 7e46a66..a673886 100644
--- a/scribo/src/primitive/Makefile.am
+++ b/scribo/src/primitive/remove/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE).
+# Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE).
#
# This file is part of Olena.
#
@@ -16,7 +16,8 @@
include $(top_srcdir)/scribo/scribo.mk
-SUBDIRS = \
- extract \
- find \
- group
+
+noinst_PROGRAMS = \
+ separators
+
+separators_SOURCES = separators.cc
diff --git a/scribo/src/misc/negate.cc b/scribo/src/primitive/remove/separators.cc
similarity index 76%
copy from scribo/src/misc/negate.cc
copy to scribo/src/primitive/remove/separators.cc
index da6fad6..46e977f 100644
--- a/scribo/src/misc/negate.cc
+++ b/scribo/src/primitive/remove/separators.cc
@@ -1,5 +1,4 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -25,35 +24,40 @@
// executable file might be covered by the GNU General Public License.
#include <mln/core/image/image2d.hh>
-#include <mln/logical/not.hh>
#include <mln/io/pbm/all.hh>
+#include <mln/data/convert.hh>
+#include <scribo/primitive/extract/separators.hh>
+#include <scribo/primitive/remove/separators.hh>
#include <scribo/debug/usage.hh>
-
const char *args_desc[][2] =
{
{ "input.pbm", "A binary image." },
+ { "output.pbm", "Output image." },
{0, 0}
};
int main(int argc, char *argv[])
{
- mln::trace::entering("main");
using namespace mln;
+ using namespace scribo;
if (argc != 3)
return scribo::debug::usage(argv,
- "Negate a binary image",
+ "Remove visible separators",
"input.pbm output.pbm",
args_desc);
+ trace::entering("main");
+
image2d<bool> input;
io::pbm::load(input, argv[1]);
- io::pbm::save(logical::not_(input), argv[2]);
+ image2d<bool> seps = primitive::extract::separators(input, 81);
- mln::trace::exiting("main");
+ io::pbm::save(primitive::remove::separators(input, seps), argv[2]);
+ trace::exiting("main");
}
--
1.5.6.5