tools/embed/readme.md
The rs-embed tool is used for embedding binary resources into code, it is an effective solution for distributing 3D-models, raster graphics and fonts.
This tool offers a standard way this can be done across the SDK.
This tool can embed 3d object / png files into code by generating a header file with all static data. a common use case which use it inside libRealSense is rendering the 3D model on the realsense-viewer tool.
The tool will read the input obj file, compress it using LZ4 compression tool and create a header file with the compressed data and an uncompress(...) method
The tool will read the input png file, and create a header file with the compressed data array and size
| Flag | Description | Default |
|---|---|---|
-i <input-file> | png / obj file that we want to embed | |
-o <output-file> | The desired output file path | |
-n <object-name> | The embedded object name for the array/function name created | |
--version | Get the tool version string |
For example:
rs-embed.exe -n d435 -o d435.h -i "inputs/d435.obj"
Will create a header for the 3D model of the d435 obj file given as input.
The array name that will be generated is static uint32_t d435_obj_data [] {...}
and the decompress function signature will be inline void uncompress_d435_obj(...).
Here we will learn how to generate an embed a 3D model into code.
step file into an obj file. (Can be done using freecad application)