|
Lagrange
|
Binary serialization of meshes and scenes. More...
Functions | |
| constexpr uint32_t | mesh_format_version () |
| Current mesh serialization format version. | |
| template<typename Scalar, typename Index> | |
| LA_SERIALIZATION2_API std::vector< uint8_t > | serialize_mesh (const SurfaceMesh< Scalar, Index > &mesh, const SerializeOptions &options={}) |
| Serialize a SurfaceMesh to a byte buffer. | |
| template<typename MeshType> | |
| LA_SERIALIZATION2_API MeshType | deserialize_mesh (span< const uint8_t > buffer, const DeserializeOptions &options={}) |
| Deserialize a SurfaceMesh from a byte buffer. | |
| template<typename Scalar, typename Index> | |
| LA_SERIALIZATION2_API void | save_mesh (const fs::path &filename, const SurfaceMesh< Scalar, Index > &mesh, const SerializeOptions &options={}) |
| Save a SurfaceMesh to a file. | |
| template<typename MeshType> | |
| LA_SERIALIZATION2_API MeshType | load_mesh (const fs::path &filename, const DeserializeOptions &options={}) |
| Load a SurfaceMesh from a file. | |
| constexpr uint32_t | scene_format_version () |
| Current scene serialization format version. | |
| template<typename Scalar, typename Index> | |
| LA_SERIALIZATION2_API std::vector< uint8_t > | serialize_scene (const scene::Scene< Scalar, Index > &scene, const SerializeOptions &options={}) |
| Serialize a Scene to a byte buffer. | |
| template<typename SceneType> | |
| LA_SERIALIZATION2_API SceneType | deserialize_scene (span< const uint8_t > buffer, const DeserializeOptions &options={}) |
| Deserialize a Scene from a byte buffer. | |
| template<typename Scalar, typename Index> | |
| LA_SERIALIZATION2_API void | save_scene (const fs::path &filename, const scene::Scene< Scalar, Index > &scene, const SerializeOptions &options={}) |
| Save a Scene to a file. | |
| template<typename SceneType> | |
| LA_SERIALIZATION2_API SceneType | load_scene (const fs::path &filename, const DeserializeOptions &options={}) |
| Load a Scene from a file. | |
| constexpr uint32_t | simple_scene_format_version () |
| Current simple scene serialization format version. | |
| template<typename Scalar, typename Index, size_t Dimension> | |
| LA_SERIALIZATION2_API std::vector< uint8_t > | serialize_simple_scene (const scene::SimpleScene< Scalar, Index, Dimension > &scene, const SerializeOptions &options={}) |
| Serialize a SimpleScene to a byte buffer. | |
| template<typename SceneType> | |
| LA_SERIALIZATION2_API SceneType | deserialize_simple_scene (span< const uint8_t > buffer, const DeserializeOptions &options={}) |
| Deserialize a SimpleScene from a byte buffer. | |
| template<typename Scalar, typename Index, size_t Dimension> | |
| LA_SERIALIZATION2_API void | save_simple_scene (const fs::path &filename, const scene::SimpleScene< Scalar, Index, Dimension > &scene, const SerializeOptions &options={}) |
| Save a SimpleScene to a file. | |
| template<typename SceneType> | |
| LA_SERIALIZATION2_API SceneType | load_simple_scene (const fs::path &filename, const DeserializeOptions &options={}) |
| Load a SimpleScene from a file. | |
Binary serialization of meshes and scenes.
The suggested file extension for serialized meshes is .lgm, and .lgs for serialized scenes (both SimpleScene and Scene).
Serialize and deserialize SurfaceMesh, SimpleScene, and Scene objects to and from a compact binary format.
|
constexpr |
#include <lagrange/serialization/serialize_mesh.h>
Current mesh serialization format version.
| LA_SERIALIZATION2_API std::vector< uint8_t > serialize_mesh | ( | const SurfaceMesh< Scalar, Index > & | mesh, |
| const SerializeOptions & | options = {} ) |
#include <lagrange/serialization/serialize_mesh.h>
Serialize a SurfaceMesh to a byte buffer.
| [in] | mesh | The mesh to serialize. |
| [in] | options | Serialization options (compression, etc.). |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
| LA_SERIALIZATION2_API MeshType deserialize_mesh | ( | span< const uint8_t > | buffer, |
| const DeserializeOptions & | options = {} ) |
#include <lagrange/serialization/serialize_mesh.h>
Deserialize a SurfaceMesh from a byte buffer.
The function auto-detects whether the buffer is compressed. If the buffer contains a SimpleScene or Scene instead of a SurfaceMesh, it can be automatically converted to a mesh when DeserializeOptions::allow_scene_conversion is enabled. If the buffer was serialized with different Scalar/Index types, type casting can be enabled via DeserializeOptions::allow_type_cast.
| [in] | buffer | A byte buffer containing the serialized data. |
| [in] | options | Deserialization options. |
| MeshType | Mesh type (e.g. SurfaceMesh<float, uint32_t>). |
| LA_SERIALIZATION2_API void save_mesh | ( | const fs::path & | filename, |
| const SurfaceMesh< Scalar, Index > & | mesh, | ||
| const SerializeOptions & | options = {} ) |
#include <lagrange/serialization/serialize_mesh.h>
Save a SurfaceMesh to a file.
The suggested file extension is .lgm.
| [in] | filename | Output file path. |
| [in] | mesh | The mesh to save. |
| [in] | options | Serialization options (compression, etc.). |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
| LA_SERIALIZATION2_API MeshType load_mesh | ( | const fs::path & | filename, |
| const DeserializeOptions & | options = {} ) |
#include <lagrange/serialization/serialize_mesh.h>
Load a SurfaceMesh from a file.
Reads the file into memory and calls deserialize_mesh(). The function auto-detects whether the file contents are compressed.
| [in] | filename | Input file path. |
| [in] | options | Deserialization options. |
| MeshType | Mesh type (e.g. SurfaceMesh<float, uint32_t>). |
|
constexpr |
#include <lagrange/serialization/serialize_scene.h>
Current scene serialization format version.
| LA_SERIALIZATION2_API std::vector< uint8_t > serialize_scene | ( | const scene::Scene< Scalar, Index > & | scene, |
| const SerializeOptions & | options = {} ) |
#include <lagrange/serialization/serialize_scene.h>
Serialize a Scene to a byte buffer.
| [in] | scene | The scene to serialize. |
| [in] | options | Serialization options (compression, etc.). |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
| LA_SERIALIZATION2_API SceneType deserialize_scene | ( | span< const uint8_t > | buffer, |
| const DeserializeOptions & | options = {} ) |
#include <lagrange/serialization/serialize_scene.h>
Deserialize a Scene from a byte buffer.
The function auto-detects whether the buffer is compressed. If the buffer contains a SurfaceMesh or SimpleScene instead of a Scene, it can be automatically converted when DeserializeOptions::allow_scene_conversion is enabled. If the buffer was serialized with different Scalar/Index types, type casting can be enabled via DeserializeOptions::allow_type_cast.
| [in] | buffer | A byte buffer containing the serialized data. |
| [in] | options | Deserialization options. |
| SceneType | Scene type (e.g. scene::Scene<float, uint32_t>). |
| LA_SERIALIZATION2_API void save_scene | ( | const fs::path & | filename, |
| const scene::Scene< Scalar, Index > & | scene, | ||
| const SerializeOptions & | options = {} ) |
#include <lagrange/serialization/serialize_scene.h>
Save a Scene to a file.
The suggested file extension is .lgs.
| [in] | filename | Output file path. |
| [in] | scene | The scene to save. |
| [in] | options | Serialization options (compression, etc.). |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
| LA_SERIALIZATION2_API SceneType load_scene | ( | const fs::path & | filename, |
| const DeserializeOptions & | options = {} ) |
#include <lagrange/serialization/serialize_scene.h>
Load a Scene from a file.
Reads the file into memory and calls deserialize_scene(). The function auto-detects whether the file contents are compressed.
| [in] | filename | Input file path. |
| [in] | options | Deserialization options. |
| SceneType | Scene type (e.g. scene::Scene<float, uint32_t>). |
|
constexpr |
#include <lagrange/serialization/serialize_simple_scene.h>
Current simple scene serialization format version.
| LA_SERIALIZATION2_API std::vector< uint8_t > serialize_simple_scene | ( | const scene::SimpleScene< Scalar, Index, Dimension > & | scene, |
| const SerializeOptions & | options = {} ) |
#include <lagrange/serialization/serialize_simple_scene.h>
Serialize a SimpleScene to a byte buffer.
| [in] | scene | The scene to serialize. |
| [in] | options | Serialization options (compression, etc.). |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
| Dimension | Scene dimension (2 or 3). |
| LA_SERIALIZATION2_API SceneType deserialize_simple_scene | ( | span< const uint8_t > | buffer, |
| const DeserializeOptions & | options = {} ) |
#include <lagrange/serialization/serialize_simple_scene.h>
Deserialize a SimpleScene from a byte buffer.
The function auto-detects whether the buffer is compressed. If the buffer contains a SurfaceMesh or Scene instead of a SimpleScene, it can be automatically converted when DeserializeOptions::allow_scene_conversion is enabled. If the buffer was serialized with different Scalar/Index types, type casting can be enabled via DeserializeOptions::allow_type_cast.
| [in] | buffer | A byte buffer containing the serialized data. |
| [in] | options | Deserialization options. |
| SceneType | SimpleScene type (e.g. scene::SimpleScene<float, uint32_t, 3>). |
| LA_SERIALIZATION2_API void save_simple_scene | ( | const fs::path & | filename, |
| const scene::SimpleScene< Scalar, Index, Dimension > & | scene, | ||
| const SerializeOptions & | options = {} ) |
#include <lagrange/serialization/serialize_simple_scene.h>
Save a SimpleScene to a file.
The suggested file extension is .lgs.
| [in] | filename | Output file path. |
| [in] | scene | The scene to save. |
| [in] | options | Serialization options (compression, etc.). |
| Scalar | Mesh scalar type. |
| Index | Mesh index type. |
| Dimension | Scene dimension (2 or 3). |
| LA_SERIALIZATION2_API SceneType load_simple_scene | ( | const fs::path & | filename, |
| const DeserializeOptions & | options = {} ) |
#include <lagrange/serialization/serialize_simple_scene.h>
Load a SimpleScene from a file.
Reads the file into memory and calls deserialize_simple_scene(). The function auto-detects whether the file contents are compressed.
| [in] | filename | Input file path. |
| [in] | options | Deserialization options. |
| SceneType | SimpleScene type (e.g. scene::SimpleScene<float, uint32_t, 3>). |