hdrlib is a lightweight C++ library that provides utilities to split large JPEG2000 (or similar binary) files into fixed-size packets, each packet containing a compact 4‑byte header and a payload. It is designed with performance, debuggability, and simplicity in mind and is suitable for networking, streaming, or embedded workflows.
Each packet consists of a 4‑byte header followed by a payload of 200 bytes.
| 4-byte Header | 200-byte Payload |
Manages file packetization:
- Opens the file
- Allocates packet buffer
- Packs payload + header per packet
- Provides packet accessors
Example usage can be found in samples/test.cpp
-
Clone the repository:
git clone git@github.com:pbalty/hdrlib.git -
Create your architecture-specific file. Example can be found in
make_arch/make.default -
Compile the library:
ARCH_FILE=make_arch/<your-file> make install
You can also compile the library within the related docker stored on the docker hub:
docker pull pbalty/hdrlib-dev:v0.0
If you are using VScode, the .devcontainer folder contains a pre-configured development container. You can open the project in VScode and it will prompt you to reopen in the container. Once inside the container, you can run the same build commands as mentioned above.
The library is documented using Doxygen. You can generate the documentation by running:
doxygen doc/Doxyfile
This will create a html folder with the generated documentation. You can open the index.html file in a web browser to view the documentation.