Thank you for your interest in contributing to OpenJP3D! This document explains how to build the project, run tests, follow coding conventions, and submit pull requests.
- CMake ≥ 3.14
- C11-compatible compiler (GCC ≥ 7, Clang ≥ 6, MSVC ≥ 2019)
- (Optional) Doxygen ≥ 1.9 for API documentation
git clone https://github.com/Raster-Lab/OpenJP3D.git
cd OpenJP3D
cmake -B build -DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTING=ON \
-DBUILD_CLI_TOOLS=ON \
-DBUILD_JPIP_3D=ON
cmake --build buildctest --test-dir build -VAll tests must pass before submitting a pull request. The test suite covers:
- Volume lifecycle and memory management
- 3-D DWT round-trips (5/3 and 9/7 filters)
- Encode → decode lossless round-trips
- HTJ2K block coder correctness
- JPIP 3-D request parsing, caching, and streaming
- SIMD correctness vs. scalar reference
- CLI tool end-to-end tests
- Parameter validation and error handling
Run tests under AddressSanitizer and UndefinedBehaviorSanitizer to catch memory errors:
cmake -B build-asan -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer" \
-DBUILD_TESTING=ON -DBUILD_CLI_TOOLS=ON -DBUILD_JPIP_3D=ON
cmake --build build-asan
ctest --test-dir build-asan -VSee CODING_STYLE.md for the full style guide. Key points:
- Language: C11 (ISO/IEC 9899:2011). No compiler-specific extensions unless wrapped behind a portability macro.
- Naming:
opj_prefix for all public symbols;snake_casefor functions and variables;UPPER_SNAKE_CASEfor macros and constants. - Formatting: 4-space indentation, no tabs. Run
clang-formatbefore committing:clang-format -i src/lib/openjp3d/*.c src/lib/openjp3d/*.h
- Documentation: Doxygen-style comments (
/** ... */) on all public types, functions, and macros with@brief,@param, and@returntags. - Licence: Every source and header file must include the BSD-2-Clause licence header.
src/lib/openjp3d/ — Core JP3D codec library
src/lib/openjpip3d/ — JPIP 3-D streaming library
src/bin/jp3d/ — CLI tools (compress, decompress, dump, transcode, server)
tests/ — CTest-based test suites
doc/ — Doxygen config, user guide, architecture docs, examples
thirdparty/ — Vendored or FetchContent-managed dependencies
cmake/ — CMake helper modules
tools/ — Benchmarks and development utilities
Place new files in the directory that matches this layout.
- Fork the repository and create a feature branch from
main. - Make your changes, keeping each PR focused on a single logical change.
- Add or update tests for your changes.
- Ensure all tests pass and the build succeeds on your platform.
- Run
clang-formatandclang-tidy:clang-format -i <changed-files> clang-tidy -p build <changed-files>
- Update documentation if your change affects the public API, build options,
or CLI tools:
- Doxygen headers for API changes
INSTALL.mdfor build option changes- Man pages for CLI tool changes
CHANGELOG.mdentry under[Unreleased]
- Open a pull request with a clear description of the change and its motivation.
- Use GitHub Issues for bug reports and feature requests.
- Include steps to reproduce, expected vs. actual behaviour, and platform details (OS, compiler, CMake version).
- For crash reports, include a sanitizer backtrace if possible.
By contributing to OpenJP3D, you agree that your contributions will be licensed under the BSD-2-Clause licence.