[geglmm] Wrapped GeglBufferIterator
- From: Hubert FiguiÃre <hub src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geglmm] Wrapped GeglBufferIterator
- Date: Tue, 17 Apr 2012 15:45:47 +0000 (UTC)
commit 57817d26e39e266eff31f7c4f7b4ccaa8cb77000
Author: Hub Figuiere <hub figuiere net>
Date: Sun Nov 13 20:09:48 2011 -0800
Wrapped GeglBufferIterator
.gitignore | 3 ++
ChangeLog | 12 +++++++++
gegl/geglmm/filelist.am | 2 +
gegl/src/buffer-iterator.ccg | 47 ++++++++++++++++++++++++++++++++++
gegl/src/buffer-iterator.hg | 57 ++++++++++++++++++++++++++++++++++++++++++
gegl/src/buffer.ccg | 1 +
gegl/src/buffer.hg | 5 +++
gegl/src/filelist.am | 2 +-
8 files changed, 128 insertions(+), 1 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 6dd242a..050d435 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,6 +35,8 @@ tools/extra_defs_gen/generate_extra_defs
gegl/geglmm.pc
gegl/geglmm/buffer.cc
gegl/geglmm/buffer.h
+gegl/geglmm/buffer-iterator.cc
+gegl/geglmm/buffer-iterator.h
gegl/geglmm/color.cc
gegl/geglmm/color.h
gegl/geglmm/curve.cc
@@ -48,6 +50,7 @@ gegl/geglmm/operation.h
gegl/geglmm/path.cc
gegl/geglmm/path.h
gegl/geglmm/private/buffer_p.h
+gegl/geglmm/private/buffer-iterator_p.h
gegl/geglmm/private/color_p.h
gegl/geglmm/private/curve_p.h
gegl/geglmm/private/matrix3_p.h
diff --git a/ChangeLog b/ChangeLog
index 7abef41..587b3c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2011-12-14 Hub FiguiÃre <hub figuiere net>
+
+ Wrapped GeglBufferIterator
+
+ * gegl/src/buffer-iterator.{hg,ccg}:
+ Added Gegl::BufferIterator.
+ * gegl/src/buffer.{hg,ccg}:
+ Wrap create_iterator()
+ * gegl/src/filelist.am:
+ gegl/geglmm/filelist.am:
+ Makefile changes.
+
2011-11-22 Hub FiguiÃre <hub figuiere net>
* build/doc-reference.am
diff --git a/gegl/geglmm/filelist.am b/gegl/geglmm/filelist.am
index 2fa6d72..1056313 100644
--- a/gegl/geglmm/filelist.am
+++ b/gegl/geglmm/filelist.am
@@ -6,6 +6,7 @@ geglmm_files_built_ph = $(patsubst %.hg,private/%_p.h,$(geglmm_files_hg))
geglmm_files_extra_cc = \
buffer.cc \
+ buffer-iterator.cc \
color.cc \
curve.cc \
init.cc \
@@ -19,6 +20,7 @@ geglmm_files_extra_cc = \
geglmm_files_extra_h = \
buffer.h \
+ buffer-iterator.h \
color.h \
curve.h \
init.h \
diff --git a/gegl/src/buffer-iterator.ccg b/gegl/src/buffer-iterator.ccg
new file mode 100644
index 0000000..20c4e41
--- /dev/null
+++ b/gegl/src/buffer-iterator.ccg
@@ -0,0 +1,47 @@
+/* libgeglmm - a C++ wrapper for libgegl
+ *
+ * (c) 2011 Hubert Figuiere
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+
+#include <gegl.h>
+
+namespace Gegl {
+
+int BufferIterator::add(const Glib::RefPtr<Gegl::Buffer>& buffer, const Gegl::Rectangle& roi,
+ const Babl* format, unsigned int flags)
+{
+ return gegl_buffer_iterator_add(gobj(), buffer->gobj(), roi.gobj(), format, flags);
+}
+
+bool BufferIterator::next()
+{
+ return gegl_buffer_iterator_next(gobj());
+}
+
+
+}
+
+namespace Glib
+{
+
+Gegl::BufferIterator *wrap(GeglBufferIterator* object)
+{
+ return new(object) Gegl::BufferIterator(object);
+}
+
+} /* namespace Glib */
diff --git a/gegl/src/buffer-iterator.hg b/gegl/src/buffer-iterator.hg
new file mode 100644
index 0000000..5ac84d3
--- /dev/null
+++ b/gegl/src/buffer-iterator.hg
@@ -0,0 +1,57 @@
+/* libgeglmm - a C++ wrapper for libgegl
+ *
+ * (c) 2011 Hubert Figuiere
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gegl.h>
+#include <gegl-utils.h>
+
+#include <geglmm/buffer.h>
+
+_DEFS(geglmm,gegl)
+
+namespace Gegl {
+
+class BufferIterator
+{
+ _CLASS_GENERIC(BufferIterator, GeglBufferIterator)
+public:
+ BufferIterator(GeglBufferIterator* p)
+ {
+ }
+
+ GeglBufferIterator* gobj() { return reinterpret_cast<GeglBufferIterator*>(this); }
+ const GeglBufferIterator* gobj() const { return reinterpret_cast<const GeglBufferIterator*>(this); }
+
+ int add(const Glib::RefPtr<Buffer>& buffer, const Rectangle& roi,
+ const Babl* format, unsigned int flags);
+
+ bool next();
+
+protected:
+ GeglBufferIterator gobject_;
+private:
+ BufferIterator(const BufferIterator&);
+ BufferIterator& operator=(const BufferIterator&);
+};
+
+}
+
+namespace Glib {
+
+Gegl::BufferIterator* wrap(GeglBufferIterator* object);
+
+}
diff --git a/gegl/src/buffer.ccg b/gegl/src/buffer.ccg
index bab806e..53aba20 100644
--- a/gegl/src/buffer.ccg
+++ b/gegl/src/buffer.ccg
@@ -17,6 +17,7 @@
*/
+#include <geglmm/buffer-iterator.h>
namespace Gegl {
diff --git a/gegl/src/buffer.hg b/gegl/src/buffer.hg
index 88572d5..c47cc88 100644
--- a/gegl/src/buffer.hg
+++ b/gegl/src/buffer.hg
@@ -28,6 +28,8 @@ _PINCLUDE(glibmm/private/object_p.h)
namespace Gegl
{
+class BufferIterator;
+
_WRAP_ENUM(SamplerType, GeglSamplerType, NO_GTYPE)
class Buffer
@@ -84,6 +86,9 @@ public:
_WRAP_METHOD(const Rectangle& abyss(), gegl_buffer_get_abyss)
+#m4 _CONVERSION(`GeglBufferIterator*',`BufferIterator*',`Glib::wrap($3)')
+ _WRAP_METHOD(BufferIterator* create_iterator(const Rectangle &, const Babl *, guint flags), gegl_buffer_iterator_new)
+
// Properties
_WRAP_PROPERTY("px-size", int)
_WRAP_PROPERTY("pixels", int)
diff --git a/gegl/src/filelist.am b/gegl/src/filelist.am
index 5bd7475..595f520 100644
--- a/gegl/src/filelist.am
+++ b/gegl/src/filelist.am
@@ -3,5 +3,5 @@
# so it's like copy-and-pasting this into each of those Makefile.am files.
files_hg = rectangle.hg node.hg processor.hg buffer.hg curve.hg color.hg\
- operation.hg path.hg matrix3.hg
+ operation.hg path.hg matrix3.hg buffer-iterator.hg
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]