![]() |
IOFormat 1.12.0
|
Global namespace which contains all methods to encode/decode data from/into different resources (files, streams...) and some other helper classes and methods. More...
Classes | |
| class | DecodingError |
| class | EncodingError |
| class | ExtractorPlugin |
| Extractor plugin interface. More... | |
| class | FeiMetadataHelper |
| class | FormatPlugin |
| Plugin class for format encoding/decoding. More... | |
| class | GeneralOptions |
| A collection of general options. More... | |
| class | Logger |
| class | OptionMap |
| A map of heterogeneous options. More... | |
| class | Plugin |
| Base class for all plugins. More... | |
| struct | PluginVersion |
| Hold information about a plugin's version. More... | |
| class | ProtocolPlugin |
| ProtocolPlugin is an interface for plugins that provide access to data using a specific protocol. More... | |
| class | StackReader |
| class | StackWriter |
| class | UnsupportedFormat |
| class | UnsupportedOperation |
| struct | VersionInfo |
| class | Versioning |
| class | WriterPlugin |
| Writer plugin interface. More... | |
Functions | |
| IOFORMAT_API bool | init () |
| IOFORMAT_API std::shared_ptr< iolink::View > | openView (const std::string &pathFile) |
| IOFORMAT_API std::shared_ptr< iolink::View > | openView (const std::string &path, const std::string &format) |
| IOFORMAT_API std::shared_ptr< iolink::View > | openView (const iolink::Uri &uri) |
| IOFORMAT_API std::shared_ptr< iolink::View > | openViewFromUri (const std::string &uri, const GeneralOptions &options={}) |
| IOFORMAT_API std::shared_ptr< iolink::View > | openView (const iolink::Uri &uri, const std::string &format) |
| IOFORMAT_API std::shared_ptr< iolink::View > | openViewFromUri (const std::string &uri, const std::string &format, const GeneralOptions &options={}) |
| IOFORMAT_API std::shared_ptr< iolink::ImageView > | readImageFromUri (const std::string &uri, const GeneralOptions &options={}) |
| IOFORMAT_API std::shared_ptr< iolink::View > | openView (std::shared_ptr< iolink::DataAccess > storage, const std::string &format) |
| IOFORMAT_API std::shared_ptr< iolink::Writer > | openWriter (std::shared_ptr< iolink::View > view, const std::string &pathFile) |
| IOFORMAT_API std::shared_ptr< iolink::Writer > | openWriter (std::shared_ptr< iolink::View > view, std::shared_ptr< iolink::DataAccess > dst, const std::string &format) |
| IOFORMAT_API std::shared_ptr< iolink::Writer > | openWriter (std::shared_ptr< iolink::View > view, std::shared_ptr< iolink::DataAccess > dst, const std::string &format, const std::string &plugin) |
| IOFORMAT_API void | writeView (std::shared_ptr< iolink::View > view, const std::string &pathFile) |
| IOFORMAT_API void | writeView (std::shared_ptr< iolink::View > view, std::shared_ptr< iolink::DataAccess > dst, const std::string &format) |
| IOFORMAT_API std::string | formatFromExtension (const std::string &extension) |
| IOFORMAT_API std::shared_ptr< iolink::View > | openView (const std::string &src, const std::string &format, const GeneralOptions &options) |
| Open a view from a source path. | |
| IOFORMAT_API std::shared_ptr< iolink::View > | openView (const std::string &src, const GeneralOptions &options) |
| Open a view from a source path. | |
| IOFORMAT_API std::shared_ptr< iolink::View > | openView (std::shared_ptr< iolink::StreamAccess > src, const std::string &format, const GeneralOptions &options) |
| Open a view from a stream. | |
| IOFORMAT_API std::shared_ptr< iolink::View > | openView (std::shared_ptr< iolink::RandomAccess > src, const std::string &format, const GeneralOptions &options) |
| Open a view from a random access storage. | |
| IOFORMAT_API std::shared_ptr< iolink::ImageView > | readImage (const std::string &src, const GeneralOptions &options) |
| Read an image from a source path and store it in CPU memory. | |
| IOFORMAT_API std::shared_ptr< iolink::ImageView > | readImage (const std::string &pathFile) |
| IOFORMAT_API std::shared_ptr< iolink::Writer > | openWriter (std::shared_ptr< iolink::View > src, const std::string &dst, const std::string &format, const GeneralOptions &options) |
| Open a writer to a destination path. | |
| IOFORMAT_API std::shared_ptr< iolink::Writer > | openWriter (std::shared_ptr< iolink::View > src, const std::string &dst, const GeneralOptions &options) |
| Open a writer to a destination path. | |
| IOFORMAT_API std::shared_ptr< iolink::Writer > | openWriter (std::shared_ptr< iolink::View > src, std::shared_ptr< iolink::StreamAccess > dst, const std::string &format, const GeneralOptions &options) |
| Open a writer to a destination stream. | |
| IOFORMAT_API void | writeView (std::shared_ptr< iolink::View > src, const std::string &dst, const std::string &format, const GeneralOptions &options) |
| Write a view to a destination path. | |
| IOFORMAT_API void | writeView (std::shared_ptr< iolink::View > src, const std::string &dst, const GeneralOptions &options) |
| Write a view to a destination path. | |
| IOFORMAT_API void | writeView (std::shared_ptr< iolink::View > src, const std::string &dst, const std::string &format) |
| Write a view to a destination path. | |
| IOFORMAT_API void | writeViewToUri (std::shared_ptr< iolink::View > src, const std::string &dst, const GeneralOptions &options={}) |
| Write a view into a destination URI. Scheme is used to determine the protocol to use. | |
| IOFORMAT_API void | writeViewToUri (std::shared_ptr< iolink::View > src, const std::string &dst, const std::string &format, const GeneralOptions &options={}) |
| Write a view into a destination URI. Scheme is used to determine the protocol to use. | |
| IOFORMAT_API void | writeView (std::shared_ptr< iolink::View > src, std::shared_ptr< iolink::StreamAccess > dst, const std::string &format, const GeneralOptions &options) |
| Write a view into a destination stream. | |
| IOFORMAT_API void | writeView (std::shared_ptr< iolink::View > src, std::shared_ptr< iolink::StreamAccess > dst, const std::string &format) |
| Write a view into a destination stream. | |
| IOFORMAT_API void | addCredentials (const std::string &host, const std::string &user, const std::string &password) |
| Add credentials for a given host. | |
Global namespace which contains all methods to encode/decode data from/into different resources (files, streams...) and some other helper classes and methods.
| IOFORMAT_API void ioformat::addCredentials | ( | const std::string & | host, |
| const std::string & | user, | ||
| const std::string & | password | ||
| ) |
Add credentials for a given host.
If credentials were already added for the host, they will be replaced by the new ones.
| host | The host to add credentials for (the scheme must be included to determine the protocol). |
| user | The user to use for authentication to given host |
| password | The password to use for authentication to given host with given user |
| Error | if the credentials cannot be assigned to a supported protocol |
| InvalidArgument | if the scheme is not present in host address |
| IOFORMAT_API std::string ioformat::formatFromExtension | ( | const std::string & | extension | ) |
Helper to retrieve a format from an extension.
Extension are case insensitive, so for example "png" and "PNG" are the same for this function, and will return the same format.
| extension | string which contains the extension to identify (without dot) |
| IOFORMAT_API bool ioformat::init | ( | ) |
Force IOFormat initialization. If not called, it will be initialized at the first call of any following methods. This method allows you to force the loading of all the IOFormat plugins. It may take some time, depending on the number of plugins to load.
| IOFORMAT_API std::shared_ptr< iolink::View > ioformat::openView | ( | const iolink::Uri & | uri | ) |
Access to data from Uniform Resource Identifier, using the extension of the path to determine format
| iolink::Error |
ioformat::openViewFromUri(const std::string & uri) method instead.| IOFORMAT_API std::shared_ptr< iolink::View > ioformat::openView | ( | const iolink::Uri & | uri, |
| const std::string & | format | ||
| ) |
Access to data from Uniform Resource Identifier, using the given format to decode it
| iolink::Error |
ioformat::openViewFromUri(const std::string & uri, const std::string& format) method instead. | IOFORMAT_API std::shared_ptr< iolink::View > ioformat::openView | ( | const std::string & | path, |
| const std::string & | format | ||
| ) |
Open a View on the file at the given path, forcing to a specific format.
| path | The path to the file |
| format | The format to use to read the file |
| UnsupportedFormat | When the extractor selected according to the format cannot read the file. |
| IOFORMAT_API std::shared_ptr< iolink::View > ioformat::openView | ( | const std::string & | pathFile | ) |
Access to data from given file, using the extension of the file to determine format
| iolink::Error | |
| iolink::InvalidArgument | |
| ioformat::UnsupportedFormat |
| IOFORMAT_API std::shared_ptr< iolink::View > ioformat::openView | ( | const std::string & | src, |
| const GeneralOptions & | options | ||
| ) |
Open a view from a source path.
The format will be inferred from the path's extension.
| src | The path to the source file. |
| options | The options to use to read the file. |
| iolink::Error | When the file cannot be opened. |
| IOFORMAT_API std::shared_ptr< iolink::View > ioformat::openView | ( | const std::string & | src, |
| const std::string & | format, | ||
| const GeneralOptions & | options | ||
| ) |
Open a view from a source path.
| src | The path to the source file. |
| format | The format to use to read the file. |
| options | The options to use to read the file. |
| iolink::Error | When the file cannot be opened. |
| IOFORMAT_API std::shared_ptr< iolink::View > ioformat::openView | ( | std::shared_ptr< iolink::DataAccess > | storage, |
| const std::string & | format | ||
| ) |
Access to data from given storage, using the given format to decode it
| storage | input storage containing the data to decode with given format |
| format | file format to apply on given stream to decode |
| iolink::Error | |
| iolink::InvalidArgument | |
| ioformat::UnsupportedFormat |
| IOFORMAT_API std::shared_ptr< iolink::View > ioformat::openView | ( | std::shared_ptr< iolink::RandomAccess > | src, |
| const std::string & | format, | ||
| const GeneralOptions & | options | ||
| ) |
Open a view from a random access storage.
| src | The random access storage to read from. |
| format | The format to use to read the storage. |
| options | The options to use to read the storage. |
| iolink::Error | When the decoding of the view fails. |
| IOFORMAT_API std::shared_ptr< iolink::View > ioformat::openView | ( | std::shared_ptr< iolink::StreamAccess > | src, |
| const std::string & | format, | ||
| const GeneralOptions & | options | ||
| ) |
Open a view from a stream.
| src | The stream to read from. |
| format | The format to use to read the stream. |
| options | The options to use to read the stream. |
| iolink::Error | When the decoding of the view fails. |
| IOFORMAT_API std::shared_ptr< iolink::View > ioformat::openViewFromUri | ( | const std::string & | uri, |
| const GeneralOptions & | options = {} |
||
| ) |
Access to data from Uniform Resource Identifier, using the extension of the path to determine format, and the scheme from the URI to determine the protocol to use.
| uri | The URI to open (scheme is mandatory to select the appropriate protocol plugin) |
| options | General options to use when opening the view |
| iolink::InvalidArgument | if the URI does not contain any scheme |
| iolink::InvalidArgument | if the URI is not valid |
| iolink::InvalidArgument | if the URI does not contain a valid extension |
| iolink::Error | if protocol plugin is not found |
| iolink::Error | if the format plugin is not found or cannot handle the file |
plugin chapter in IOFormat user guide for more details about the protocols and formats supported. | IOFORMAT_API std::shared_ptr< iolink::View > ioformat::openViewFromUri | ( | const std::string & | uri, |
| const std::string & | format, | ||
| const GeneralOptions & | options = {} |
||
| ) |
Access to data from Uniform Resource Identifier, using the given format to decode it, and the scheme from the URI to determine the protocol to use.
| uri | The URI to open (scheme is mandatory to select the appropriate protocol plugin) |
| format | The format to use to decode the data |
| options | General options to use when opening the view |
| iolink::InvalidArgument | if the URI does not contain any scheme |
| iolink::InvalidArgument | if the URI is not valid |
| iolink::Error | if protocol plugin is not found |
| iolink::Error | if the format plugin is not found or cannot handle the file |
plugin chapter in IOFormat user guide for more details about the protocols and formats supported. | IOFORMAT_API std::shared_ptr< iolink::Writer > ioformat::openWriter | ( | std::shared_ptr< iolink::View > | src, |
| const std::string & | dst, | ||
| const GeneralOptions & | options | ||
| ) |
Open a writer to a destination path.
The format will be inferred from the path's extension.
| src | The view to write. |
| dst | The path to the destination file. |
| options | The options to use to write the file. |
| iolink::Error | When the source view cannot be written into the destination file. |
| IOFORMAT_API std::shared_ptr< iolink::Writer > ioformat::openWriter | ( | std::shared_ptr< iolink::View > | src, |
| const std::string & | dst, | ||
| const std::string & | format, | ||
| const GeneralOptions & | options | ||
| ) |
Open a writer to a destination path.
| src | The view to write. |
| dst | The path to the destination file. |
| format | The format to use to write the file. |
| options | The options to use to write the file. |
| iolink::Error | When the source view cannot be written into the destination file. |
| IOFORMAT_API std::shared_ptr< iolink::Writer > ioformat::openWriter | ( | std::shared_ptr< iolink::View > | src, |
| std::shared_ptr< iolink::StreamAccess > | dst, | ||
| const std::string & | format, | ||
| const GeneralOptions & | options | ||
| ) |
Open a writer to a destination stream.
| src | The view to write. |
| dst | The stream to write into. |
| format | The format to use to write the stream. |
| options | The options to use to write into the stream. |
| iolink::Error | When the source view cannot be written into the destination stream. |
| IOFORMAT_API std::shared_ptr< iolink::Writer > ioformat::openWriter | ( | std::shared_ptr< iolink::View > | view, |
| const std::string & | pathFile | ||
| ) |
Open a writer used to write an image view into a file.
| view | The view that will be written |
| pathFile | a path to the output file. |
| IOFORMAT_API std::shared_ptr< iolink::Writer > ioformat::openWriter | ( | std::shared_ptr< iolink::View > | view, |
| std::shared_ptr< iolink::DataAccess > | dst, | ||
| const std::string & | format | ||
| ) |
Open a writer used to write an image view into an output stream.
| view | The view that will be written |
| dst | The output stream where the encoded data will be written. |
| format | The format to use to encode the image. |
| IOFORMAT_API std::shared_ptr< iolink::Writer > ioformat::openWriter | ( | std::shared_ptr< iolink::View > | view, |
| std::shared_ptr< iolink::DataAccess > | dst, | ||
| const std::string & | format, | ||
| const std::string & | plugin | ||
| ) |
Open a writer used to write an image view into an output stream.
| view | The view that will be written |
| dst | The output stream where the encoded data will be written. |
| format | The format to use to encode the image. |
| plugin | The specific plugin to use. |
| IOFORMAT_API std::shared_ptr< iolink::ImageView > ioformat::readImage | ( | const std::string & | pathFile | ) |
Access to data from given file, using the extension of the file to determine format. Image is fully loaded in memory. Limitation:
| iolink::Error | If an error occurs during the reading. |
| ioformat::UnsupportedFormat | If the file is not an image. |
| IOFORMAT_API std::shared_ptr< iolink::ImageView > ioformat::readImage | ( | const std::string & | src, |
| const GeneralOptions & | options | ||
| ) |
Read an image from a source path and store it in CPU memory.
| src | The path to the source file. |
| options | The options to use to read the file. |
| iolink::Error | When the image cannot be read. |
| ioformat::UnsupportedFormat | When the file do not contain an image. |
| IOFORMAT_API std::shared_ptr< iolink::ImageView > ioformat::readImageFromUri | ( | const std::string & | uri, |
| const GeneralOptions & | options = {} |
||
| ) |
Access to image from Uniform Resource Identifier. The scheme from the URI is used to determine the protocol to use.
| uri | The URI to open (scheme is mandatory to select the appropriate protocol plugin) |
| options | General options to use when opening the view |
| iolink::InvalidArgument | if the URI does not contain any scheme |
| iolink::InvalidArgument | if the URI is not valid |
| iolink::InvalidArgument | if the URI does not contain a valid extension |
| iolink::Error | if protocol plugin is not found |
| iolink::Error | if the format plugin is not found or cannot handle the file |
plugin chapter in IOFormat user guide for more details about the protocols and formats supported. | IOFORMAT_API void ioformat::writeView | ( | std::shared_ptr< iolink::View > | src, |
| const std::string & | dst, | ||
| const GeneralOptions & | options | ||
| ) |
Write a view to a destination path.
The format will be inferred from the path's extension.
| src | The view to write. |
| dst | The path to the destination file. |
| options | The options to use to write the file. |
| iolink::Error | When the source view cannot be written into the destination file. |
| IOFORMAT_API void ioformat::writeView | ( | std::shared_ptr< iolink::View > | src, |
| const std::string & | dst, | ||
| const std::string & | format | ||
| ) |
Write a view to a destination path.
| src | The view to write. |
| dst | The path to the destination file. |
| format | The format to use to write the file. |
| iolink::Error | When the source view cannot be written into the destination file. |
| IOFORMAT_API void ioformat::writeView | ( | std::shared_ptr< iolink::View > | src, |
| const std::string & | dst, | ||
| const std::string & | format, | ||
| const GeneralOptions & | options | ||
| ) |
Write a view to a destination path.
| src | The view to write. |
| dst | The path to the destination file. |
| format | The format to use to write the file. |
| options | The options to use to write the file. |
| iolink::Error | When the source view cannot be written into the destination file. |
| IOFORMAT_API void ioformat::writeView | ( | std::shared_ptr< iolink::View > | src, |
| std::shared_ptr< iolink::StreamAccess > | dst, | ||
| const std::string & | format | ||
| ) |
Write a view into a destination stream.
| src | The view to write. |
| dst | The stream to write into. |
| format | The format to use to write into the stream. |
| iolink::Error | When the source view cannot be written into the destination stream. |
| IOFORMAT_API void ioformat::writeView | ( | std::shared_ptr< iolink::View > | src, |
| std::shared_ptr< iolink::StreamAccess > | dst, | ||
| const std::string & | format, | ||
| const GeneralOptions & | options | ||
| ) |
Write a view into a destination stream.
| src | The view to write. |
| dst | The stream to write into. |
| format | The format to use to write into the stream. |
| options | The options to use to write the stream. |
| iolink::Error | When the source view cannot be written into the destination stream. |
| IOFORMAT_API void ioformat::writeView | ( | std::shared_ptr< iolink::View > | view, |
| const std::string & | pathFile | ||
| ) |
Save a view into a file.
| view | The view to save |
| pathFile | The path of the file where to save the image |
| iolink::Error | When the image cannot be written |
| IOFORMAT_API void ioformat::writeView | ( | std::shared_ptr< iolink::View > | view, |
| std::shared_ptr< iolink::DataAccess > | dst, | ||
| const std::string & | format | ||
| ) |
Save a view into a storage.
| view | The view to save |
| dst | The storage where to save the image |
| format | The format in which the image will be encoded |
| iolink::Error | When the image cannot be written |
| IOFORMAT_API void ioformat::writeViewToUri | ( | std::shared_ptr< iolink::View > | src, |
| const std::string & | dst, | ||
| const GeneralOptions & | options = {} |
||
| ) |
Write a view into a destination URI. Scheme is used to determine the protocol to use.
| src | The view to write. |
| dst | The URI to write into (the scheme must be included to determine the protocol). |
| options | The options to use to write the data. |
plugin chapter in IOFormat user guide for more details about the protocols and formats supported.| iolink::InvalidArgument | if the URI does not contain any scheme |
| iolink::InvalidArgument | if the URI is not valid |
| iolink::InvalidArgument | if the URI does not contain a valid extension |
| iolink::Error | When the source view cannot be written into the destination URI. |
| IOFORMAT_API void ioformat::writeViewToUri | ( | std::shared_ptr< iolink::View > | src, |
| const std::string & | dst, | ||
| const std::string & | format, | ||
| const GeneralOptions & | options = {} |
||
| ) |
Write a view into a destination URI. Scheme is used to determine the protocol to use.
| src | The view to write. |
| dst | The URI to write into (the scheme must be included to determine the protocol). |
| format | The format to use to encode the view. |
| options | The options to use to write the data. |
plugin chapter in IOFormat user guide for more details about the protocols and formats supported.| iolink::InvalidArgument | if the URI does not contain any scheme |
| iolink::InvalidArgument | if the URI is not valid |
| iolink::Error | When the source view cannot be written into the destination URI. |