summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2013-11-29 08:44:12 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2013-11-29 08:44:12 (GMT)
commita14acf716660a8805a99c790061a6518324a94fe (patch)
tree7f750ef026385d22214f20d8aa1d609f3af76cfa /include
parentb0f1450f800efe593105b5d1b41afa3207b09422 (diff)
Added tng_util_compression_next_frame_get(). Fixed compression.
If compressing one frame using TNG-MF1 when the default number of frames per frame set is higher always try to find the best compression algorithm and do not store it. Otherwise there might be attempts to use incompatible compressions algorithms.
Diffstat (limited to 'include')
-rw-r--r--include/tng_io.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/tng_io.h b/include/tng_io.h
index 9cc8a8a..e46cd60 100644
--- a/include/tng_io.h
+++ b/include/tng_io.h
@@ -4293,6 +4293,35 @@ tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_with_time_double_write
const double time,
const double *box_shape);
+/**
+ * @brief High-level function for getting the compression method and
+ * multiplication factor of the next frame of a specific data block.
+ * @param tng_data is the trajectory to use.
+ * @param block_id is the ID number of the block containing the data of
+ * interest.
+ * @param codec_id will be set to the value of the codec_id of the
+ * compression of the data block. See tng_compression for more details.
+ * @param factor will be set to the multiplication factor applied to
+ * the values before compression, in order to get integers from them.
+ * factor is 1/precision.
+ * @pre \code tng_data != 0 \endcode The trajectory container (tng_data)
+ * must be initialised before using it.
+ * @pre \code codec_id != 0 \endcode The pointer to the returned codec id
+ * must not be a NULL pointer.
+ * @pre \code factor != 0 \endcode The pointer to the returned multiplication
+ * factor must not be a NULL pointer.
+ * @details This function reads ahead until a data block of the requested ID
+ * is found.
+ * @return TNG_SUCCESS (0) if successful, TNG_FAILURE (1) if a minor error
+ * has occured (such as invalid mode) or TNG_CRITICAL (2) if a major error
+ * has occured.
+ */
+tng_function_status DECLSPECDLLEXPORT tng_util_compression_next_frame_get
+ (tng_trajectory_t tng_data,
+ const int64_t block_id,
+ char *codec_id,
+ float *factor);
+
/** @} */ /* end of group2 */
contact: Jan Huwald // Impressum