[med-svn] [aghermann] 67/85: split heavy itpp-dependent inline cairo_draw_signal from ui.hh

andrei zavada hmmr-guest at alioth.debian.org
Thu Sep 26 23:46:34 UTC 2013


This is an automated email from the git hooks/post-receive script.

hmmr-guest pushed a commit to branch master
in repository aghermann.

commit a2fd0082b00655d938e33192cfea0c28b05252a3
Author: Andrei Zavada <johnhommer at gmail.com>
Date:   Sun Sep 22 01:47:44 2013 +0300

    split heavy itpp-dependent inline cairo_draw_signal from ui.hh
---
 upstream/src/aghermann/ui/sf/montage.cc |    1 +
 upstream/src/aghermann/ui/sf/sf.hh      |    1 +
 upstream/src/aghermann/ui/ui-itpp.hh    |   61 +++++++++++++++++++++++++++++++
 upstream/src/aghermann/ui/ui.hh         |   22 -----------
 4 files changed, 63 insertions(+), 22 deletions(-)

diff --git a/upstream/src/aghermann/ui/sf/montage.cc b/upstream/src/aghermann/ui/sf/montage.cc
index e4fab03..8eff24e 100644
--- a/upstream/src/aghermann/ui/sf/montage.cc
+++ b/upstream/src/aghermann/ui/sf/montage.cc
@@ -13,6 +13,7 @@
 
 #include "common/lang.hh"
 #include "aghermann/ui/misc.hh"
+#include "aghermann/ui/ui-itpp.hh"
 #include "aghermann/ui/mw/mw.hh"
 #include "channel.hh"
 #include "sf.hh"
diff --git a/upstream/src/aghermann/ui/sf/sf.hh b/upstream/src/aghermann/ui/sf/sf.hh
index f75bb99..054924a 100644
--- a/upstream/src/aghermann/ui/sf/sf.hh
+++ b/upstream/src/aghermann/ui/sf/sf.hh
@@ -17,6 +17,7 @@
 #include <string>
 
 #include <cairo/cairo.h>
+#include <itpp/base/mat.h>
 
 #include "common/alg.hh"
 #include "common/config-validate.hh"
diff --git a/upstream/src/aghermann/ui/ui-itpp.hh b/upstream/src/aghermann/ui/ui-itpp.hh
new file mode 100644
index 0000000..90fa1be
--- /dev/null
+++ b/upstream/src/aghermann/ui/ui-itpp.hh
@@ -0,0 +1,61 @@
+/*
+ *       File name:  aghermann/ui/ui-itpp.hh
+ *         Project:  Aghermann
+ *          Author:  Andrei Zavada <johnhommer at gmail.com>
+ * Initial version:  2013-09-21
+ *
+ *         Purpose:  simple, C-style UI supporting functions (those which need itpp)
+ *
+ *         License:  GPL
+ */
+
+
+#ifndef AGH_AGHERMANN_UI_UI_ITPP_H_
+#define AGH_AGHERMANN_UI_UI_ITPP_H_
+
+#include <itpp/base/mat.h>
+#include "ui.hh"
+
+#if HAVE_CONFIG_H && !defined(VERSION)
+#  include "config.h"
+#endif
+
+using namespace std;
+
+namespace agh {
+namespace ui {
+
+
+inline void
+cairo_draw_signal( cairo_t *cr,
+                   const itpp::Mat<double>& signal, int row,
+                   ssize_t start, ssize_t end,
+                   size_t width, double hdisp, double vdisp, float display_scale,
+                   unsigned short decimate = 1,
+                   TDrawSignalDirection direction = TDrawSignalDirection::forward,
+                   TDrawSignalPathOption continue_path = TDrawSignalPathOption::yes)
+{
+        valarray<TFloat> tmp (end - start); // avoid copying other rows, cols
+        for ( ssize_t c = 0; c < (end-start); ++c )
+                if ( likely (start + c > 0 && start + c < (ssize_t)signal.size()) )
+                        tmp[c] = signal(row, start + c);
+        cairo_draw_signal( cr,
+                           tmp, 0, end-start,
+                           width, hdisp, vdisp, display_scale,
+                           decimate,
+                           direction,
+                           continue_path);
+}
+
+
+}
+} // namespace agh::ui
+
+#endif
+
+// Local Variables:
+// Mode: c++
+// indent-tabs-mode: nil
+// tab-width: 8
+// c-basic-offset: 8
+// End:
diff --git a/upstream/src/aghermann/ui/ui.hh b/upstream/src/aghermann/ui/ui.hh
index 3b7cae6..8e986c9 100644
--- a/upstream/src/aghermann/ui/ui.hh
+++ b/upstream/src/aghermann/ui/ui.hh
@@ -17,7 +17,6 @@
 #include <cstring>
 #include <string>
 #include <valarray>
-#include <itpp/base/mat.h>
 #include <gtk/gtk.h>
 
 #include "common/lang.hh"
@@ -59,27 +58,6 @@ cairo_draw_signal( cairo_t*,
                    TDrawSignalDirection direction = TDrawSignalDirection::forward,
                    TDrawSignalPathOption continue_path = TDrawSignalPathOption::yes);
 
-inline void
-cairo_draw_signal( cairo_t *cr,
-                   const itpp::Mat<double>& signal, int row,
-                   ssize_t start, ssize_t end,
-                   size_t width, double hdisp, double vdisp, float display_scale,
-                   unsigned short decimate = 1,
-                   TDrawSignalDirection direction = TDrawSignalDirection::forward,
-                   TDrawSignalPathOption continue_path = TDrawSignalPathOption::yes)
-{
-        valarray<TFloat> tmp (end - start); // avoid copying other rows, cols
-        for ( ssize_t c = 0; c < (end-start); ++c )
-                if ( likely (start + c > 0 && start + c < (ssize_t)signal.size()) )
-                        tmp[c] = signal(row, start + c);
-        cairo_draw_signal( cr,
-                           tmp, 0, end-start,
-                           width, hdisp, vdisp, display_scale,
-                           decimate,
-                           direction,
-                           continue_path);
-}
-
 void
 cairo_draw_envelope( cairo_t*,
                      const valarray<TFloat>&,

-- 
Alioth's /git/debian-med/git-commit-notice on /srv/git.debian.org/git/debian-med/aghermann.git



More information about the debian-med-commit mailing list