Trait opencv::hdf::HDF5 [−][src]
pub trait HDF5: HDF5Const {
fn as_raw_mut_HDF5(&mut self) -> *mut c_void;
fn close(&mut self) -> Result<()> { ... }
fn grcreate(&mut self, grlabel: &str) -> Result<()> { ... }
fn atdelete(&mut self, atlabel: &str) -> Result<()> { ... }
fn atwrite(&mut self, value: i32, atlabel: &str) -> Result<()> { ... }
fn atread(&mut self, value: &mut i32, atlabel: &str) -> Result<()> { ... }
fn atwrite_1(&mut self, value: f64, atlabel: &str) -> Result<()> { ... }
fn atread_1(&mut self, value: &mut f64, atlabel: &str) -> Result<()> { ... }
fn atwrite_2(&mut self, value: &str, atlabel: &str) -> Result<()> { ... }
fn atread_2(&mut self, value: &mut String, atlabel: &str) -> Result<()> { ... }
fn atwrite_3(
&mut self,
value: &dyn ToInputArray,
atlabel: &str
) -> Result<()> { ... }
fn atread_3(
&mut self,
value: &mut dyn ToOutputArray,
atlabel: &str
) -> Result<()> { ... }
}Required methods
fn as_raw_mut_HDF5(&mut self) -> *mut c_void
Provided methods
Create a group.
Parameters
- grlabel: specify the hdf5 group label.
Create a hdf5 group with default properties. The group is closed automatically after creation.
Note: Groups are useful for better organising multiple datasets. It is possible to create subgroups within any group. Existence of a particular group can be checked using hlexists(). In case of subgroups, a label would be e.g: ‘Group1/SubGroup1’ where SubGroup1 is within the root group Group1. Before creating a subgroup, its parent group MUST be created.
- In this example, Group1 will have one subgroup called SubGroup1:
The corresponding result visualized using the HDFView tool is

Note: When a dataset is created with dscreate() or kpcreate(), it can be created within a group by specifying the full path within the label. In our example, it would be: ‘Group1/SubGroup1/MyDataSet’. It is not thread safe.
Delete an attribute from the root group.
Parameters
- atlabel: the attribute to be deleted.
Note: CV_Error() is called if the given attribute does not exist. Use atexists() to check whether it exists or not beforehand.
See also
atexists, atwrite, atread
Write an attribute inside the root group.
Parameters
- value: attribute value.
- atlabel: attribute name.
The following example demonstrates how to write an attribute of type cv::String:
Note: CV_Error() is called if the given attribute already exists. Use atexists() to check whether it exists or not beforehand. And use atdelete() to delete it if it already exists.
See also
atexists, atdelete, atread
Read an attribute from the root group.
Parameters
- value: address where the attribute is read into
- atlabel: attribute name
The following example demonstrates how to read an attribute of type cv::String:
Note: The attribute MUST exist, otherwise CV_Error() is called. Use atexists() to check if it exists beforehand.
See also
atexists, atdelete, atwrite
Write an attribute into the root group.
Parameters
- value: attribute value. Currently, only n-d continuous multi-channel arrays are supported.
- atlabel: attribute name.
Note: CV_Error() is called if the given attribute already exists. Use atexists() to check whether it exists or not beforehand. And use atdelete() to delete it if it already exists.
See also
atexists, atdelete, atread.
Overloaded parameters
Read an attribute from the root group.
Parameters
- value: attribute value. Currently, only n-d continuous multi-channel arrays are supported.
- atlabel: attribute name.
Note: The attribute MUST exist, otherwise CV_Error() is called. Use atexists() to check if it exists beforehand.
See also
atexists, atdelete, atwrite
Overloaded parameters
Write an attribute into the root group.
Parameters
- value: attribute value. Currently, only n-d continuous multi-channel arrays are supported.
- atlabel: attribute name.
Note: CV_Error() is called if the given attribute already exists. Use atexists() to check whether it exists or not beforehand. And use atdelete() to delete it if it already exists.
See also
atexists, atdelete, atread.
Overloaded parameters
Read an attribute from the root group.
Parameters
- value: attribute value. Currently, only n-d continuous multi-channel arrays are supported.
- atlabel: attribute name.
Note: The attribute MUST exist, otherwise CV_Error() is called. Use atexists() to check if it exists beforehand.
See also
atexists, atdelete, atwrite
Overloaded parameters
Write an attribute into the root group.
Parameters
- value: attribute value. Currently, only n-d continuous multi-channel arrays are supported.
- atlabel: attribute name.
Note: CV_Error() is called if the given attribute already exists. Use atexists() to check whether it exists or not beforehand. And use atdelete() to delete it if it already exists.
See also
atexists, atdelete, atread.
Read an attribute from the root group.
Parameters
- value: attribute value. Currently, only n-d continuous multi-channel arrays are supported.
- atlabel: attribute name.
Note: The attribute MUST exist, otherwise CV_Error() is called. Use atexists() to check if it exists beforehand.
See also
atexists, atdelete, atwrite