---
scribo/ChangeLog | 4 ++++
scribo/scribo/core/document.hh | 30 +++++++++++++++++++++++++++++-
2 files changed, 33 insertions(+), 1 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index a1025f2..8a7132a 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,9 @@
2010-12-10 Guillaume Lazzara <z(a)lrde.epita.fr>
+ * scribo/core/document.hh: Add new methods.
+
+2010-12-10 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Fix missing inlines and MLN_WO_GLOBALS_VARS guards in Scribo.
* scribo/binarization/internal/first_pass_functor.hh,
diff --git a/scribo/scribo/core/document.hh b/scribo/scribo/core/document.hh
index daa0d7b..b6b79df 100644
--- a/scribo/scribo/core/document.hh
+++ b/scribo/scribo/core/document.hh
@@ -47,8 +47,11 @@ namespace scribo
document();
document(const char *filename);
+ document(const char *filename,
+ const mln::image2d<mln::value::rgb8>& input);
void open();
+ bool is_open() const;
const char * filename() const;
void set_filename(const char*name);
@@ -64,6 +67,7 @@ namespace scribo
void set_elements(const component_set<L>& elements);
const mln::image2d<value::rgb8>& image() const;
+ void set_image(const mln::image2d<value::rgb8>& image);
private:
const char *filename_;
@@ -88,7 +92,15 @@ namespace scribo
document<L>::document(const char *filename)
: filename_(filename)
{
- open();
+ }
+
+
+ template <typename L>
+ document<L>::document(const char *filename,
+ const mln::image2d<mln::value::rgb8>& input)
+ : filename_(filename),
+ image_(input)
+ {
}
@@ -118,6 +130,14 @@ namespace scribo
template <typename L>
bool
+ document<L>::is_open() const
+ {
+ return image_.is_valid();
+ }
+
+
+ template <typename L>
+ bool
document<L>::is_valid() const
{
return image_.is_valid();
@@ -180,6 +200,14 @@ namespace scribo
}
+ template <typename L>
+ void
+ document<L>::set_image(const mln::image2d<value::rgb8>& image)
+ {
+ image_ = image;
+ }
+
+
# endif // ! MLN_INCLUDE_ONLY
--
1.5.6.5
Show replies by date