Skip to content

Konstantysz/vision-craft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

124 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽจ VisionCraft

Build Tests Coverage Format Static Analysis

A modern C++20 computer vision node editor with an intuitive visual programming interface. VisionCraft allows users to create complex computer vision pipelines through a drag-and-drop node-based editor. ๐Ÿš€

โœจ Features

  • Visual Node Editor: Intuitive drag-and-drop interface for building computer vision pipelines
  • Layered Architecture: Clean, modular design
  • Real-time Processing: Execute and preview computer vision operations in real-time
  • Docking Interface: Flexible workspace with dockable panels
  • Cross-platform: Supports Windows and Linux

๐Ÿ›๏ธ Architecture

VisionCraft is built using a domain-driven architecture with clear separation of concerns:

  • kappa-core: Foundation framework (as git submodule) providing Application, Window, and Layer abstractions
  • Nodes: Core node system abstractions (Node, NodeEditor, Slot, NodeData)
  • Vision: Computer vision domain (algorithms, I/O nodes, node factory)
  • Editor: Editor domain (commands, state management, persistence)
  • UI: Presentation layer (rendering, canvas, widgets, application layers)
  • App: Application composition and entry point

โšก Execution Flow Architecture

VisionCraft uses a hybrid execution model that separates control flow from data flow:

1. Execution Flow (White Arrows)

  • Defines the order of operations (what executes when).
  • Represented by white arrow pins and connections.
  • Enforces a strict 1:1 connection rule (one output to one input) to prevent ambiguity.
  • Supports branching and linear sequences.
  • Entry Points: Nodes with execution outputs but no execution inputs (e.g., Image Input) start the flow.

2. Data Flow (Colored Wires)

  • Defines data dependencies (what data goes where).
  • Represented by colored pins (Green=Image, Cyan=Int, etc.).
  • Allows 1:N connections (one output can feed multiple inputs).
  • Data is passed automatically before a node executes.

3. Execution Model

  • Compilation Phase: The graph is compiled into a linear ExecutionPlan via topological sort of the execution flow.
  • Optimization: Connection lookups are precomputed into indices for O(1) access during execution.
  • Lookahead Advancement: The instruction pointer advances before node execution, enabling robust error handling and cancellation.
  • Thread Safety: The execution engine is fully thread-safe, supporting async background execution with cancellation and progress reporting.

๐Ÿ“‹ Prerequisites

๐ŸŒ Common Requirements

  • C++20 compatible compiler
  • CMake 3.26 or higher
  • vcpkg package manager

๐ŸชŸ Windows

  • Visual Studio 2022 (or Visual Studio Build Tools)
  • Git for Windows

๐Ÿง Linux

  • GCC 11+ or Clang 13+
  • Git
  • Build essentials (build-essential on Ubuntu/Debian)

๐Ÿš€ Quick Start

๐ŸชŸ Windows

  1. Clone the repository with submodules

    git clone --recursive https://github.com/Konstantysz/vision-craft.git
    cd vision-craft
  2. Configure and build

    cmake -B build
    cmake --build build --config Release
  3. Run VisionCraft

    .\build\src\App\Release\VisionCraft.exe

๐Ÿง Linux

  1. Install dependencies

    # Ubuntu/Debian
    sudo apt update
    sudo apt install build-essential cmake libgl1-mesa-dev libglu1-mesa-dev
    
    # Fedora/RHEL
    sudo dnf install gcc-c++ cmake mesa-libGL-devel mesa-libGLU-devel
  2. Clone and build

    git clone --recursive https://github.com/Konstantysz/vision-craft.git
    cd vision-craft
    cmake -B build
    cmake --build build --config Release -j$(nproc)
  3. Run VisionCraft

    ./build/src/App/VisionCraft

๐Ÿ”ง Development Build

For development with code quality tools:

# Configure with static analysis
cmake -B build -DENABLE_CLANG_TIDY=ON -DENABLE_COMPILE_COMMANDS=ON
cmake --build build --config Release

# Run code quality checks
python scripts/run-code-quality.py

๐Ÿ“š Dependencies

VisionCraft automatically manages its dependencies through vcpkg:

  • GLFW: Window management and input handling
  • GLAD: OpenGL function loading
  • ImGui: Immediate mode GUI framework
  • GLM: Mathematics library for graphics
  • spdlog: Fast C++ logging library
  • OpenCV: Computer vision processing library
  • Google Test: Unit testing framework

๐Ÿ“ Project Structure

vision-craft/
โ”œโ”€โ”€ external/
โ”‚   โ”œโ”€โ”€ kappa-core/           # Core GUI application framework (git submodule)
โ”‚   โ””โ”€โ”€ ImGuiFileDialog/      # File dialog library
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ Nodes/                # Core node system abstractions
โ”‚   โ”‚   โ””โ”€โ”€ Core/             # Node, NodeEditor, Slot, NodeData
โ”‚   โ”œโ”€โ”€ Vision/               # Computer vision domain
โ”‚   โ”‚   โ”œโ”€โ”€ Algorithms/       # CV processing nodes (Grayscale, Threshold, CannyEdge)
โ”‚   โ”‚   โ”œโ”€โ”€ IO/               # Image I/O nodes (ImageInput, ImageOutput, Preview)
โ”‚   โ”‚   โ””โ”€โ”€ Factory/          # Node factory for registration
โ”‚   โ”œโ”€โ”€ Editor/               # Editor domain
โ”‚   โ”‚   โ”œโ”€โ”€ Commands/         # Command pattern for undo/redo
โ”‚   โ”‚   โ”œโ”€โ”€ State/            # Selection and clipboard managers
โ”‚   โ”‚   โ””โ”€โ”€ Persistence/      # Recent files, serialization
โ”‚   โ”œโ”€โ”€ UI/                   # Presentation layer
โ”‚   โ”‚   โ”œโ”€โ”€ Layers/           # Application layers (NodeEditor, DockSpace, etc.)
โ”‚   โ”‚   โ”œโ”€โ”€ Rendering/        # Node rendering and strategies
โ”‚   โ”‚   โ”œโ”€โ”€ Canvas/           # Canvas controller, connections, input handling
โ”‚   โ”‚   โ”œโ”€โ”€ Widgets/          # UI components, dialogs, constants
โ”‚   โ”‚   โ””โ”€โ”€ Events/           # Application events
โ”‚   โ””โ”€โ”€ App/                  # Application entry point
โ”‚       โ””โ”€โ”€ VisionCraftApplication  # Main executable
โ”œโ”€โ”€ tests/                    # Unit tests
โ”œโ”€โ”€ cmake/                    # Build system extensions
โ”‚   โ””โ”€โ”€ CodeQuality.cmake     # Code quality integration
โ”œโ”€โ”€ scripts/                  # Development tools
โ”‚   โ””โ”€โ”€ run-code-quality.py   # Code quality runner
โ”œโ”€โ”€ .pre-commit-config.yaml   # Pre-commit hooks configuration
โ”œโ”€โ”€ .clang-format            # Code formatting rules
โ”œโ”€โ”€ .clang-tidy              # Static analysis configuration
โ”œโ”€โ”€ CMakeLists.txt           # Main build configuration
โ””โ”€โ”€ vcpkg.json              # Package dependencies

๐ŸŽฎ Usage

  1. Launch VisionCraft using the executable from the build process
  2. Create nodes by right-clicking in the canvas area
  3. Connect nodes by dragging from output pins to input pins
  4. Edit properties using the property panel when a node is selected
  5. Execute the graph using the Run button in the menu bar
  6. View results in the results panel

๐Ÿ‘จโ€๐Ÿ’ป Development

๐Ÿ› ๏ธ Code Quality Tools

VisionCraft includes integrated code quality tools:

# Install pre-commit hooks (one-time setup)
pip install pre-commit
pre-commit install

# Run all code quality checks
python scripts/run-code-quality.py

# Format code only
python scripts/run-code-quality.py --format-only

# Static analysis only
python scripts/run-code-quality.py --tidy-only

# CMake targets for individual checks
cmake --build build --target format-all        # Apply formatting
cmake --build build --target tidy-all          # Run static analysis
cmake --build build --target code-quality      # All checks

๐Ÿงช Running Tests

cd build
ctest --output-on-failure

๐Ÿ“ Code Standards

  • Language: C++20
  • Formatting: clang-format (automatically applied via pre-commit hooks)
  • Static Analysis: clang-tidy integration for modern C++ practices
  • Line Width: 120 characters
  • Indentation: 4 spaces

๐Ÿ”„ Development Workflow

  1. Setup development environment:

    cmake -B build -DENABLE_CLANG_TIDY=ON
    pip install pre-commit && pre-commit install
  2. Make changes: Edit code following project standards

  3. Test locally:

    cmake --build build
    python scripts/run-code-quality.py
  4. Commit: Pre-commit hooks automatically run formatting and checks

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes following the code standards
  4. Add tests for new functionality
  5. Ensure all code quality checks pass (python scripts/run-code-quality.py)
  6. Commit your changes (pre-commit hooks will run automatically)
  7. Push to your branch (git push origin feature/amazing-feature)
  8. Submit a pull request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

About

A modern C++20 computer vision node editor with drag-and-drop visual programming interface. Built with ImGui, OpenCV, and a clean layered architecture for creating CV pipelines.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors