[arrayfire] 41/284: Fixes for scatter
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Sun Feb 7 18:59:17 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/experimental
in repository arrayfire.
commit 65c7a23c76173b7e6b98593ec4a76ad1e1b94181
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date: Mon Nov 30 14:24:06 2015 -0500
Fixes for scatter
---
include/af/graphics.h | 26 +++++++++++++++++---------
src/api/c/plot.cpp | 15 ++++++++++-----
src/api/c/plot3.cpp | 15 ++++++++++-----
3 files changed, 37 insertions(+), 19 deletions(-)
diff --git a/include/af/graphics.h b/include/af/graphics.h
index 129b439..a8b4816 100644
--- a/include/af/graphics.h
+++ b/include/af/graphics.h
@@ -179,6 +179,7 @@ class AFAPI Window {
*/
void plot(const array& X, const array& Y, const char* const title=NULL);
+#if AF_API_VERSION >= 33
/**
Renders the input arrays as a 2D scatter-plot to the window
@@ -191,18 +192,23 @@ class AFAPI Window {
\ingroup gfx_func_draw
*/
- void scatter(const array& X, const array& Y, const af::markerType marker=AF_MARKER_POINT, const char* const title=NULL);
+ void scatter(const array& X, const array& Y,
+ const af::markerType marker = AF_MARKER_POINT, const char* const title = NULL);
+#endif
+#if AF_API_VERSION >= 33
/**
- Renders the input arrays as a 2D scatter-plot to the window
+ Renders the input arrays as a 3D scatter-plot to the window
- \param[in] P is an \ref af_array or matrix with the xyz-values of the points
+ \param[in] P is an \ref af_array or matrix with the xyz-values of the points
\param[in] marker is an \ref markerType enum specifying which marker to use in the scatter plot
\param[in] title parameter is used when this function is called in grid mode
\ingroup gfx_func_draw
*/
- void scatter3(const array& P, const af::markerType marker=AF_MARKER_POINT, const char* const title=NULL);
+ void scatter3(const array& P, const af::markerType marker = AF_MARKER_POINT,
+ const char* const title = NULL);
+#endif
/**
Renders the input array as a histogram to the window
@@ -395,7 +401,7 @@ AFAPI af_err af_draw_image(const af_window wind, const af_array in, const af_cel
*/
AFAPI af_err af_draw_plot(const af_window wind, const af_array X, const af_array Y, const af_cell* const props);
-#if AF_API_VERSION >= 32
+#if AF_API_VERSION >= 33
/**
C Interface wrapper for drawing an array as a plot
@@ -413,10 +419,11 @@ AFAPI af_err af_draw_plot(const af_window wind, const af_array X, const af_array
\ingroup gfx_func_draw
*/
-AFAPI af_err af_draw_scatter(const af_window wind, const af_array X, const af_array Y, const af_marker_type marker, const af_cell* const props);
+AFAPI af_err af_draw_scatter(const af_window wind, const af_array X, const af_array Y,
+ const af_marker_type marker, const af_cell* const props);
#endif
-#if AF_API_VERSION >= 32
+#if AF_API_VERSION >= 33
/**
C Interface wrapper for drawing an array as a plot
@@ -431,9 +438,10 @@ AFAPI af_err af_draw_scatter(const af_window wind, const af_array X, const af_ar
\ingroup gfx_func_draw
*/
-AFAPI af_err af_draw_scatter3(const af_window wind, const af_array P, const af_marker_type marker, const af_cell* const props);
-
+AFAPI af_err af_draw_scatter3(const af_window wind, const af_array P,
+ const af_marker_type marker, const af_cell* const props);
#endif
+
#if AF_API_VERSION >= 32
/**
C Interface wrapper for drawing an array as a plot
diff --git a/src/api/c/plot.cpp b/src/api/c/plot.cpp
index c58a894..a2c026b 100644
--- a/src/api/c/plot.cpp
+++ b/src/api/c/plot.cpp
@@ -55,11 +55,9 @@ fg::Plot* setup_plot(const af_array X, const af_array Y, fg::PlotType type, fg::
return plot;
}
-#endif
af_err plotWrapper(const af_window wind, const af_array X, const af_array Y, const af_cell* const props, fg::PlotType type=fg::FG_LINE, fg::MarkerType marker=fg::FG_NONE)
{
-#if defined(WITH_GRAPHICS)
if(wind==0) {
std::cerr<<"Not a valid window"<<std::endl;
return AF_SUCCESS;
@@ -101,18 +99,25 @@ af_err plotWrapper(const af_window wind, const af_array X, const af_array Y, con
}
CATCHALL;
return AF_SUCCESS;
-#else
- return AF_ERR_NO_GFX;
-#endif
}
+#endif // WITH_GRAPHICS
+
af_err af_draw_plot(const af_window wind, const af_array X, const af_array Y, const af_cell* const props)
{
+#if defined(WITH_GRAPHICS)
return plotWrapper(wind, X, Y, props);
+#else
+ return AF_ERR_NO_GFX;
+#endif
}
af_err af_draw_scatter(const af_window wind, const af_array X, const af_array Y, const af_marker_type af_marker, const af_cell* const props)
{
+#if defined(WITH_GRAPHICS)
fg::MarkerType fg_marker = getFGMarker(af_marker);
return plotWrapper(wind, X, Y, props, fg::FG_SCATTER, fg_marker);
+#else
+ return AF_ERR_NO_GFX;
+#endif
}
diff --git a/src/api/c/plot3.cpp b/src/api/c/plot3.cpp
index 4d31105..d21a399 100644
--- a/src/api/c/plot3.cpp
+++ b/src/api/c/plot3.cpp
@@ -72,11 +72,9 @@ fg::Plot3* setup_plot3(const af_array P, fg::PlotType ptype, fg::MarkerType mtyp
return plot3;
}
-#endif
af_err plot3Wrapper(const af_window wind, const af_array P, const af_cell* const props, const fg::PlotType type=fg::FG_LINE, const fg::MarkerType marker=fg::FG_NONE)
{
-#if defined(WITH_GRAPHICS)
if(wind==0) {
std::cerr<<"Not a valid window"<<std::endl;
return AF_SUCCESS;
@@ -107,18 +105,25 @@ af_err plot3Wrapper(const af_window wind, const af_array P, const af_cell* const
}
CATCHALL;
return AF_SUCCESS;
-#else
- return AF_ERR_NO_GFX;
-#endif
}
+#endif // WITH_GRAPHICS
+
af_err af_draw_plot3(const af_window wind, const af_array P, const af_cell* const props)
{
+#if defined(WITH_GRAPHICS)
return plot3Wrapper(wind, P, props);
+#else
+ return AF_ERR_NO_GFX;
+#endif
}
af_err af_draw_scatter3(const af_window wind, const af_array P, const af_marker_type af_marker, const af_cell* const props)
{
+#if defined(WITH_GRAPHICS)
fg::MarkerType fg_marker = getFGMarker(af_marker);
return plot3Wrapper(wind, P, props, fg::FG_SCATTER, fg_marker);
+#else
+ return AF_ERR_NO_GFX;
+#endif
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git
More information about the debian-science-commits
mailing list