![]() |
ImFusion C++ SDK 4.5.0
|
Reading and writing OpticalTrackingMarker instances to/from various file formats. More...
Reading and writing OpticalTrackingMarker instances to/from various file formats.
This namespace provides functions to serialize and deserialize optical tracking markers using different file formats. Supported formats include JSON, INI, and ROM (binary). The file format is automatically determined by the file extension.
Example usage:
Typedefs | |
| using | SaveHandler = std::function<bool(const OpticalTrackingMarker&, const Filesystem::Path&)> |
| Function type for saving a marker to a file. | |
| using | LoadHandler = std::function<std::unique_ptr<OpticalTrackingMarker>(const Filesystem::Path&)> |
| Function type for loading a marker from a file. | |
Functions | |
| bool | saveToFile (const OpticalTrackingMarker &marker, const Filesystem::Path &filename) |
| Saves a marker to a file. | |
| std::unique_ptr< OpticalTrackingMarker > | loadFromFile (const Filesystem::Path &filename) |
| Loads a marker from a file. | |
| void | registerFileFormat (const std::string &extension, SaveHandler saveHandler, LoadHandler loadHandler) |
| Registers a file format handler for a specific extension. | |
| bool | isFileFormatSupported (const std::string &extension) |
| Checks if a file format handler is registered for the given extension. | |
| std::vector< std::string > | supportedFileExtensions () |
| Returns a list of all supported file extensions. | |
| bool ImFusion::OpticalTrackingMarkerIO::saveToFile | ( | const OpticalTrackingMarker & | marker, |
| const Filesystem::Path & | filename ) |
Saves a marker to a file.
Format is determined by file extension.
| marker | The marker to save |
| filename | Path to the output file |
| std::unique_ptr< OpticalTrackingMarker > ImFusion::OpticalTrackingMarkerIO::loadFromFile | ( | const Filesystem::Path & | filename | ) |
Loads a marker from a file.
Format is determined by file extension.
| filename | Path to the input file |
| void ImFusion::OpticalTrackingMarkerIO::registerFileFormat | ( | const std::string & | extension, |
| SaveHandler | saveHandler, | ||
| LoadHandler | loadHandler ) |
Registers a file format handler for a specific extension.
| extension | File extension (e.g., "ini", "rom", "json") without the dot |
| saveHandler | Function to save marker to file |
| loadHandler | Function to load marker from file |
| bool ImFusion::OpticalTrackingMarkerIO::isFileFormatSupported | ( | const std::string & | extension | ) |
Checks if a file format handler is registered for the given extension.
| extension | File extension without the dot |