What an image file states beyond its shape and data type, such as the distance between its samples.
More...
#include <vitrio/image_metadata.hpp>
What an image file states beyond its shape and data type, such as the distance between its samples.
A dictionary of values, each under a label. Nothing has to be stated: what a file does not carry, or a format does not read, is absent.
- Labels
- A label with no dot in it names a standard field, one of those of image_metadata_fields, which means the same whatever the format of the file. Any other label has a prefix that ends at its first dot and says whose it is, such as the format that defines it:
mrc.labels.
- Standard fields
- A standard field has one type, and the dictionary holds it as no other.
- See also
- image_metadata_field
◆ erase()
| bool vitrio::image_metadata::erase |
( |
const std::string & | label | ) |
|
|
noexcept |
Stop stating anything under a label.
- Parameters
-
- Returns
- true A value was under
label and is gone.
-
false Nothing was stated under
label.
◆ find()
Find the value under a label.
- Parameters
-
- Returns
- const image_metadata_value* The value, or nullptr when nothing is stated under
label. It refers to storage owned by this metadata, and is valid until the metadata is next modified.
◆ get()
Get the value under a label.
- Parameters
-
- Returns
- const image_metadata_value& The value. It refers to storage owned by this metadata, and is valid until the metadata is next modified.
- Exceptions
-
| std::out_of_range | If nothing is stated under label. |
◆ get_entries()
| span< const entry_type > vitrio::image_metadata::get_entries |
( |
| ) |
const |
|
noexcept |
Get everything that is stated.
- Returns
- span<const entry_type> The entries, sorted by label. It refers to storage owned by this metadata, and is valid until the metadata is next modified.
◆ set()
State a value under a label.
Replaces the value already under that label, if any.
An integer given for a standard field that is a real is held as the real of the same value.
- Parameters
-
| label | The label. |
| value | The value. |
- Exceptions
-
| std::invalid_argument | If label is empty, if it has no dot and names no standard field, or if it names a standard field and value is neither of its type nor an integer given for a real. The metadata is left as it was. |
The documentation for this class was generated from the following file: