Metadata¶
Bases: object
Metadata class represents a container for image metadata.
This class allows to store metadata of various types (integers, floats, strings, containers) and provides methods for access, conversion, and serialization.
copy(md)
¶
Copy metadata content.
Copies the data from a metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
md
|
Metadata
|
The metadata to copy |
required |
index()
¶
Get the type index of the metadata.
Retrieves the index of the metadata type.
Returns:
| Type | Description |
|---|---|
size_t
|
The type index |
type()
¶
Get the type of the metadata.
Retrieves the type of the metadata.
Returns:
| Type | Description |
|---|---|
type_info
|
The type |
serialize()
¶
Serialize the metadata.
Provides a serialization interface for Metadata. Must be overridden.
Returns:
| Type | Description |
|---|---|
str
|
The serialized form of the metadata |
toString()
¶
Convert to string.
Returns a human-readable string representation of the metadata element.
Returns:
| Type | Description |
|---|---|
str
|
The string representation |
fromString(value, index)
¶
Build from string.
Parses a string and sets the metadata, interpreting it as the specified type index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
string
|
The string to parse |
required |
index
|
size_t
|
The expected type index |
required |
__init__(*args)
¶
Overload 1:
Default constructor.
Initializes a new instance of the Metadata class.
|
Overload 2:
Copy constructor.
Creates a new Metadata instance as a deep copy of an existing one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
md
|
Metadata
|
The metadata to copy from | Overload 3: Converting constructor. Initializes a new instance of the Metadata class from a pointer. |
required |
T
|
The type of the data |
required | |
data
|
boolean
|
The value to store | Overload 5: Constructor from a primitive. Initializes a new instance of the Metadata class with a value of a supported primitive. |
required |