[arrayfire] 13/408: Added documentation for unwrap

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Sep 21 19:11:05 UTC 2015


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

ghisvail-guest pushed a commit to branch debian/sid
in repository arrayfire.

commit ec5c0d17476b34fd5659ec041ac7393b8b8223db
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date:   Thu Jun 18 15:16:40 2015 -0400

    Added documentation for unwrap
---
 docs/details/image.dox | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 include/af/image.h     | 26 ++++++++++++++++++++++++++
 2 files changed, 75 insertions(+)

diff --git a/docs/details/image.dox b/docs/details/image.dox
index 7491d25..e39b2d7 100644
--- a/docs/details/image.dox
+++ b/docs/details/image.dox
@@ -570,5 +570,54 @@ Interpolation types of \ref AF_INTERP_NEAREST and \ref AF_INTERP_BILINEAR are al
 Affine transforms can be used for various purposes. \ref af::translate, \ref af::scale and \ref af::skew
 are specializations of the transform function.
 
+\defgroup image_func_unwrap unwrap
+\ingroup image_mod
+
+Generate image with image windows as columns
+
+\ref unwrap takes in an input image along with the window sizes \p wx and \p
+wy and strides \p sx and \p sy. This function then generates a matrix where
+each windows is an independent column. The number of columns in the output
+array are govenered by the number of windows that can be fit along x and y
+directions.
+
+When strides are 1, the operation is sliding window. When strides are equal to
+the respective window sizes, the option is distinct window. Other stride
+values are also allowed. When strides are greater than 1, then the output may
+be padded with 0 if required.
+
+\code
+A [5 5 1 1]
+    0.0000     0.2190     0.3835     0.5297     0.4175
+    0.1315     0.0470     0.5194     0.6711     0.6868
+    0.7556     0.6789     0.8310     0.0077     0.5890
+    0.4587     0.6793     0.0346     0.3834     0.9304
+    0.5328     0.9347     0.0535     0.0668     0.8462
+
+// Sliding Window
+unwrap(A, 3, 3, 1, 1) [9 9 1 1]
+    0.0000     0.1315     0.7556     0.2190     0.0470     0.6789     0.3835     0.5194     0.8310
+    0.1315     0.7556     0.4587     0.0470     0.6789     0.6793     0.5194     0.8310     0.0346
+    0.7556     0.4587     0.5328     0.6789     0.6793     0.9347     0.8310     0.0346     0.0535
+    0.2190     0.0470     0.6789     0.3835     0.5194     0.8310     0.5297     0.6711     0.0077
+    0.0470     0.6789     0.6793     0.5194     0.8310     0.0346     0.6711     0.0077     0.3834
+    0.6789     0.6793     0.9347     0.8310     0.0346     0.0535     0.0077     0.3834     0.0668
+    0.3835     0.5194     0.8310     0.5297     0.6711     0.0077     0.4175     0.6868     0.5890
+    0.5194     0.8310     0.0346     0.6711     0.0077     0.3834     0.6868     0.5890     0.9304
+    0.8310     0.0346     0.0535     0.0077     0.3834     0.0668     0.5890     0.9304     0.8462
+
+// Distinct Windows (has padding)
+unwrap(A, 3, 3, 3, 3) [9 4 1 1]
+    0.0000     0.4587     0.5297     0.3834
+    0.1315     0.5328     0.6711     0.0668
+    0.7556     0.0000     0.0077     0.0000
+    0.2190     0.6793     0.4175     0.9304
+    0.0470     0.9347     0.6868     0.8462
+    0.6789     0.0000     0.5890     0.0000
+    0.3835     0.0346     0.0000     0.0000
+    0.5194     0.0535     0.0000     0.0000
+    0.8310     0.0000     0.0000     0.0000
+\endcode
+
 @}
 */
diff --git a/include/af/image.h b/include/af/image.h
index f5751a6..0c616bc 100644
--- a/include/af/image.h
+++ b/include/af/image.h
@@ -461,6 +461,18 @@ AFAPI array rgb2hsv(const array& in);
  */
 AFAPI array colorSpace(const array& image, const CSpace to, const CSpace from);
 
+/**
+   C++ Interface wrapper for unwrap
+
+   \param[in]  in is the input array
+   \param[in]  wx is the block window size along 0th-dimension
+   \param[in]  wy is the block window size along 1st-dimension
+   \param[in]  sx is the stride along 0th-dimension
+   \param[in]  sy is the stride along 1st-dimension
+   \returns    an array with the image blocks as columns
+
+   \ingroup image_func_unwrap
+*/
 AFAPI array unwrap(const array& in, const dim_t wx, const dim_t wy, const dim_t sx, const dim_t sy);
 
 }
@@ -905,6 +917,20 @@ extern "C" {
     */
     AFAPI af_err af_color_space(af_array *out, const af_array image, const af_cspace_t to, const af_cspace_t from);
 
+    /**
+       C Interface wrapper for unwrap
+
+       \param[out] out is an array with image blocks as columns.
+       \param[in]  in is the input array
+       \param[in]  wx is the block window size along 0th-dimension
+       \param[in]  wy is the block window size along 1st-dimension
+       \param[in]  sx is the stride along 0th-dimension
+       \param[in]  sy is the stride along 1st-dimension
+       \return     \ref AF_SUCCESS if the color transformation is successful,
+       otherwise an appropriate error code is returned.
+
+       \ingroup image_func_unwrap
+    */
     AFAPI af_err af_unwrap(af_array *out, const af_array in, const dim_t wx, const dim_t wy, const dim_t sx, const dim_t sy);
 
 #ifdef __cplusplus

-- 
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