Skip to content

garbsam97/RAW_DEV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAW_DEV

Build License: Apache 2.0 Linux macOS Windows Qt6 LLVM LibRaw

C++20 playground for experimenting with RAW image processing primitives.

The core implementation lives in rawdev_core; the CLI is intentionally minimal for now, and most behavior is validated through tests.

Current status

  • rawdev_core: image model, pipeline, PNG writer, processing stages, a LibRaw-backed RAW import boundary (rawdev::coreapi::importRawImage), and a core processing facade (rawdev::coreapi::processImage) for frontend integration
    • WhiteBalanceStage
    • BlackLevelStage
    • ColorMatrixStage
    • GammaCorrectionStage
    • ToneMappingStage (OpenMP-enabled on a safe pixel loop when available)
    • ColorTransformSrgbStage
  • rawdev_cli: command-line interface with argument parsing and command routing (--help, --version, process), linked to rawdev_core; supports end-to-end RAW-to-PNG with structured --white-balance r,g,b parsing and full pipeline option coverage
  • rawdev_tests: GoogleTest suite for IO, pipeline, golden behavior, coreapi/CLI coverage, and LLVM JIT examples, now including stage-contract coverage, deterministic golden fixtures, interleaved-layout/copy-back regressions, OpenMP parity coverage for tone mapping, and RAW import success/failure coverage
  • rawdev_benchmarks: lightweight benchmark harness for Milestone 5 baseline capture in tests/benchmark/benchmark_pipeline.cpp
  • rawdev_gui: Qt6 GUI executable in src/gui/ (rawdev_gui), with phase-1 wiring, phase-2 preview widget behavior, and phase-3 GUI-core adapter integration (rawdev::gui::adapters::toQImage used by AppController)

Repository layout

  • src/core/: core library (rawdev_core)
  • src/cli/: CLI executable (rawdev_cli) with main.cpp, cli_options.*, and cli_runner.*
  • src/modules/: third-party integration (libraw, libraw-cmake, llvm submodules)
  • src/gui/: Qt6 GUI (rawdev_gui) with main_gui.cpp, main_window.*, controllers/, and widgets/
  • tests/: test and benchmark code (rawdev_tests, rawdev_benchmarks)

Data model notes

rawdev::image::Image stores pixel data in std::vector<float> sized width * height * 3.

Layout is interleaved RGB (not planar), matching ImageView::at(x, y, c):

index = y * stride + x * channels + c
stride = width * 3

When writing tests directly against Image::data, keep indexing consistent with this layout.

Build and test

CLion-first workflow (recommended)

  1. Open project in CLion
  2. Reload/Update CMake
  3. Build targets (rawdev_tests, rawdev_benchmarks, rawdev_cli, or rawdev_gui)
  4. Run tests from CLion (GoogleTest/CTest)

CLI fallback

cmake -S . -B build
cmake --build build
ctest --test-dir build --output-on-failure

Milestone 5 baseline flow

cmake --build build --target rawdev_benchmarks
./build/tests/benchmark/rawdev_benchmarks --out tests/benchmark/baseline_0.3.0-alpha.csv --runs 20 --warmup 5 --max-size 4096 --tag m5-baseline-macos

Baseline artifacts are tracked under tests/benchmark/ for reproducible trend comparisons.

Dependencies and configuration

  • C++20
  • CMake (project currently requires cmake_minimum_required(VERSION 4.1))
  • GoogleTest via FetchContent (v1.14.0) with gtest_discover_tests(rawdev_tests)
  • LibRaw via submodules (src/modules/libraw, src/modules/libraw-cmake)
  • LLVM required by tests (find_package(LLVM REQUIRED CONFIG) in tests/CMakeLists.txt)
  • OpenMP optional in rawdev_core
  • Qt6 (Core, Gui, Widgets) required by src/gui/CMakeLists.txt

macOS notes

If OpenMP is not found in CLion:

-DOpenMP_ROOT=/opt/homebrew/opt/libomp

If LLVM is not found in tests, set LLVM_DIR to a folder containing LLVMConfig.cmake (for example .../dist/lib/cmake/llvm).

If Qt6 is not found in CLion, set one of these CMake options:

-DCMAKE_PREFIX_PATH=/opt/homebrew/opt/qt

or

-DQt6_DIR=/opt/homebrew/opt/qt/lib/cmake/Qt6

Known constraints

  • Pipeline::execute() now includes empty/single-stage fast paths and a reusable scratch buffer, but the general multi-stage path still uses ping-pong + copy-back.
  • Benchmark timing is sensitive to thermals/frequency scaling; compare medians across runs/machines.
  • RAW import is implemented in core via LibRaw and wired in CLI process; GUI has phase-1/2/3 foundations (state wiring, preview widget, GUI-core adapter), but end-to-end file-processing flow is still pending
  • LLVM test target can expose warnings from LLVM headers depending on compiler flags
  • CLI white-balance parsing now validates strict r,g,b float format; all major options covered

CLI scaffolding

  • rawdev_cli is structured in three parts:
    • main.cpp: collects argv and dispatches parsed commands
    • cli_options.*: parses CLI flags into typed command options
    • cli_runner.*: executes commands and manages exit codes/messages
  • Current command surface includes --help, --version, and process options scaffolding.
  • Integration strategy: keep parsing/execution flow in CLI modules and move reusable image-processing logic to rawdev_core.

Qt6 GUI

  • rawdev_gui is an executable target created with qt_add_executable.
  • Layer responsibilities:
    • main_gui.cpp: QApplication bootstrap
    • main_window.*: window composition and user actions
    • controllers/app_controller.*: orchestrates GUI-to-core operations
    • widgets/image_view_widget.*: image preview surface
  • Current phase-1/phase-2/phase-3 behavior:
    • AppController stores minimal state (hasImage_, currentPath_, lastStatus_)
    • MainWindow consumes statusMessageChanged and imageAvailabilityChanged
    • Run Pipeline is disabled until an image is considered loaded
    • ImageViewWidget provides setImage(...), clearImage(), hasImage() and fit-centered rendering for loaded images
    • AppController::openRaw() currently converts a synthetic core image through rawdev::gui::adapters::toQImage(...) and emits previewImageChanged
  • Keep image-processing logic in rawdev_core; GUI code should call core APIs via controllers.
  • Avoid using Qt types in public rawdev_core headers unless strictly necessary.

License

Apache License 2.0. See LICENSE.

About

RAW image processing playground with a modular core, CLI workflow, and Qt6 GUI.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Contributors