summaryrefslogtreecommitdiffstats
path: root/src/H5Sall.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1999-03-10 23:50:03 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1999-03-10 23:50:03 (GMT)
commitae782bd7ac0d7f3342d4317cbcd487d4bfefc206 (patch)
tree43c7965a2a9a3014f8b27915e0a5685919907dd2 /src/H5Sall.c
parent354a6dcc0120bc857a22736fb0eb3d7cdda11525 (diff)
downloadhdf5-ae782bd7ac0d7f3342d4317cbcd487d4bfefc206.zip
hdf5-ae782bd7ac0d7f3342d4317cbcd487d4bfefc206.tar.gz
hdf5-ae782bd7ac0d7f3342d4317cbcd487d4bfefc206.tar.bz2
[svn-r1132] Dataset region references are now finished and working correctly. Also, there
are five new API functions for querying selections: H5Sget_select_hyper_nblocks - retrieves the number of hyperslab blocks in current hyperslab selection for a dataspace H5Sget_select_elem_npoints - retrieves the number of element points in current element selection for a dataspace H5Sget_select_hyper_blocklist - retrieves a list of the hyperslab blocks in current hyperslab selection for a dataspace H5Sget_select_elem_pointlist - retrieves a list of the element points in current element selection for a dataspace H5Sget_select_bounds - retrieves a n-dimensional bounding box containing current selection.
Diffstat (limited to 'src/H5Sall.c')
-rw-r--r--src/H5Sall.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/H5Sall.c b/src/H5Sall.c
index c5cf909..3a6eb0a 100644
--- a/src/H5Sall.c
+++ b/src/H5Sall.c
@@ -640,3 +640,53 @@ H5S_all_select_deserialize (H5S_t *space, const uint8_t __unused__ *buf)
done:
FUNC_LEAVE (ret_value);
} /* H5S_all_select_deserialize() */
+
+/*--------------------------------------------------------------------------
+ NAME
+ H5S_all_bounds
+ PURPOSE
+ Gets the bounding box containing the selection.
+ USAGE
+ herr_t H5S_all_bounds(space, hsize_t *start, hsize_t *end)
+ H5S_t *space; IN: Dataspace pointer of selection to query
+ hsize_t *start; OUT: Starting coordinate of bounding box
+ hsize_t *end; OUT: Opposite coordinate of bounding box
+ RETURNS
+ Non-negative on success, negative on failure
+ DESCRIPTION
+ Retrieves the bounding box containing the current selection and places
+ it into the user's buffers. The start and end buffers must be large
+ enough to hold the dataspace rank number of coordinates. The bounding box
+ exactly contains the selection, ie. if a 2-D element selection is currently
+ defined with the following points: (4,5), (6,8) (10,7), the bounding box
+ with be (4, 5), (10, 8). Calling this function on a "none" selection
+ returns fail.
+ GLOBAL VARIABLES
+ COMMENTS, BUGS, ASSUMPTIONS
+ EXAMPLES
+ REVISION LOG
+--------------------------------------------------------------------------*/
+herr_t
+H5S_all_bounds(H5S_t *space, hsize_t *start, hsize_t *end)
+{
+ intn rank; /* Dataspace rank */
+ intn i; /* index variable */
+ herr_t ret_value=SUCCEED; /* return value */
+
+ FUNC_ENTER (H5S_all_bounds, FAIL);
+
+ assert(space);
+ assert(start);
+ assert(end);
+
+ /* Get the dataspace extent rank */
+ rank=space->extent.u.simple.rank;
+
+ /* Just copy over the complete extent */
+ for(i=0; i<rank; i++) {
+ start[i]=0;
+ end[i]=space->extent.u.simple.size[i]-1;
+ } /* end for */
+
+ FUNC_LEAVE (ret_value);
+} /* H5Sget_all_bounds() */