Converts data from one specified datatype to another
Procedure:
H5T_CONVERT(src_type_id, dest_type_id, nelmts, buf, background, plist_id)
Signature:
herr_t H5Tconvert( hid_t src_type_id, hid_t dest_type_id, size_t nelmts, void *buf, void *background, hid_t plist_id )
Fortran2003:
SUBROUTINE h5tconvert_f(src_id, dst_id, nelmts, buf, hdferr, background, plist_id)
INTEGER(HID_T) , INTENT(IN) :: src_id
INTEGER(HID_T) , INTENT(IN) :: dst_id
INTEGER(SIZE_T), INTENT(IN) :: nelmts
TYPE(C_PTR) , INTENT(INOUT) :: buf
INTEGER , INTENT(OUT) :: hdferr
TYPE(C_PTR) , INTENT(INOUT), OPTIONAL :: background
INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: plist_id
Parameters:
hid_t src_type_id | IN: Identifier for the source datatype |
hid_t dest_type_id | IN: Identifier for the destination datatype |
size_t nelmts | IN: Size of array buf |
void *buf | IN/OUT: Array containing pre- and post-conversion values
H5Tconvert will not resize this buffer; it must be large enough to hold the larger of the input and output data. |
void *background | IN: Optional background buffer |
hid_t plist_id | IN: Dataset transfer property list identifier |
Description:
H5T_CONVERT converts nelmts
elements from a source datatype, specified by src_type_id
, to a destination datatype, dest_type_id
. The source elements are packed in buf
and on return the destination elements will be packed in buf
. That is, the conversion is performed in place.
The optional background buffer is for use with compound datatypes. It is an array of nelmts
values for the destination datatype which can then be merged with the converted values to recreate the compound datatype. For instance, background
might be an array of structs with the a
and b
fields already initialized and the conversion of buf
supplies the c
and d
field values.
The parameter plist_id
contains the dataset transfer property list identifier which is passed to the conversion functions. As of Release 1.2, this parameter is only used to pass along the variable-length datatype custom allocation information.
Returns:
Returns a non-negative value if successful; otherwise returns a negative value.
Example:
History:
Release | Change |
---|
1.8.8 | Fortran subroutine added. |
1.6.3 | In C function, nelmts parameter type changed to size_t. |
1.4.0 | In C function, nelmts parameter type changed to hsize_t. |
--- Last Modified: May 10, 2019 | 02:26 PM