Trait opencv::prelude::HDF5

source ·
pub trait HDF5: HDF5Const {
    // Required method
    fn as_raw_mut_HDF5(&mut self) -> *mut c_void;

    // Provided methods
    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<()> { ... }
}
Expand description

Hierarchical Data Format version 5 interface.

Notice that this module is compiled only when hdf5 is correctly installed.

Required Methods§

Provided Methods§

source

fn close(&mut self) -> Result<()>

Close and release hdf5 object.

source

fn grcreate(&mut self, grlabel: &str) -> Result<()>

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:

create_group

The corresponding result visualized using the HDFView tool is

Visualization of groups using the HDFView tool

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.

source

fn atdelete(&mut self, atlabel: &str) -> Result<()>

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

source

fn atwrite(&mut self, value: i32, atlabel: &str) -> Result<()>

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:

snippets_write_str

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

source

fn atread(&mut self, value: &mut i32, atlabel: &str) -> Result<()>

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:

snippets_read_str

Note: The attribute MUST exist, otherwise CV_Error() is called. Use atexists() to check if it exists beforehand.

See also

atexists, atdelete, atwrite

source

fn atwrite_1(&mut self, value: f64, atlabel: &str) -> Result<()>

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:

snippets_write_str

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
source

fn atread_1(&mut self, value: &mut f64, atlabel: &str) -> Result<()>

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:

snippets_read_str

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
source

fn atwrite_2(&mut self, value: &str, atlabel: &str) -> Result<()>

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:

snippets_write_str

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
source

fn atread_2(&mut self, value: &mut String, atlabel: &str) -> Result<()>

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:

snippets_read_str

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
source

fn atwrite_3(&mut self, value: &dyn ToInputArray, atlabel: &str) -> Result<()>

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.

source

fn atread_3( &mut self, value: &mut dyn ToOutputArray, atlabel: &str ) -> Result<()>

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

Implementors§

source§

impl HDF5 for Ptr<dyn HDF5>