# bilalfakhouri/magiclantern_simplified architecture

> Architecture diagram of the GitHub repository bilalfakhouri/magiclantern_simplified, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bilalfakhouri/magiclantern_simplified
- Repository: https://github.com/bilalfakhouri/magiclantern_simplified

## Overview

Magic Lantern is an open framework of camera-side extensions that runs alongside Canon firmware, loaded from a memory card. Its user-facing capabilities include HDR, timelapse, motion detection, focus assistance, and manual audio controls; the tree also shows raw-video capture and Dual ISO processing. The graph groups these capabilities and notable runtime subsystems, plus the card-installation helper. Edges are limited to relationships documented in the README or visible in the sampled sources; unsampled module wiring is not inferred.

Main entry points: [`tools/ml-installer/IOManager.py`](https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/tools/ml-installer/IOManager.py) (Card installer I/O), [`src/tasks.c`](https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/src/tasks.c) (Task management), [`modules/dual_iso/cr2hdr.c`](https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/modules/dual_iso/cr2hdr.c) (Dual ISO processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_camera["Camera runtime"]
  node_camera["Canon camera"]
  node_runtime["Task management<br/>[tasks.c]"]
  node_platform["Camera-specific support"]
end

subgraph group_imaging["Imaging and capture"]
  node_rawvideo["Raw video capture"]
  node_dualiso["Dual ISO processing<br/>[cr2hdr.c]"]
  node_rawdevelop["Raw development<br/>[raw2dng.c]"]
  node_silent["Silent photography<br/>[silent.c]"]
end

subgraph group_extensions["Camera extensions"]
  node_hdr["HDR imaging"]
  node_timelapse["Timelapse"]
  node_motion["Motion detection"]
  node_focus["Focus assistance"]
  node_audio["Manual audio controls"]
  node_lua["Lua scripting"]
  node_tinycc["Tiny C compiler<br/>[tccgen.c]"]
  node_tinypy["TinyPy interpreter<br/>[tinypy.c]"]
end

subgraph group_host["Host tools"]
  node_install["Card installer I/O<br/>[IOManager.py]"]
  node_ptpcam["PTP camera utility<br/>[ptpcam.c]"]
  node_mlvtools["MLV viewers<br/>[Program.cs]"]
  node_webdav["WebDAV server<br/>[Program.cs]"]
end

node_photographer(("Photographer"))

node_photographer -->|"starts camera"| node_camera
node_camera -->|"tracks tasks"| node_runtime
node_install -->|"sets card flags"| node_camera
node_photographer -->|"post-processes images"| node_dualiso

click node_runtime "https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/src/tasks.c"
click node_platform "https://github.com/bilalfakhouri/magiclantern_simplified/tree/dev/platform"
click node_rawvideo "https://github.com/bilalfakhouri/magiclantern_simplified/tree/dev/modules/raw_video"
click node_dualiso "https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/modules/dual_iso/cr2hdr.c"
click node_rawdevelop "https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/modules/lv_rec/raw2dng.c"
click node_silent "https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/modules/silent/silent.c"
click node_hdr "https://github.com/bilalfakhouri/magiclantern_simplified/tree/dev/modules"
click node_timelapse "https://github.com/bilalfakhouri/magiclantern_simplified/tree/dev/modules"
click node_motion "https://github.com/bilalfakhouri/magiclantern_simplified/tree/dev/modules"
click node_focus "https://github.com/bilalfakhouri/magiclantern_simplified/tree/dev/modules"
click node_audio "https://github.com/bilalfakhouri/magiclantern_simplified/tree/dev/modules"
click node_tinycc "https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/modules/tcc/tccgen.c"
click node_tinypy "https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/modules/tinypy/tinypy.c"
click node_install "https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/tools/ml-installer/IOManager.py"
click node_ptpcam "https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/tools/ptpcam/ptpcam.c"
click node_mlvtools "https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/tools/g3gg0/MLVBrowseSharp/Program.cs"
click node_webdav "https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/tools/g3gg0/WebDAVServer/WebDAVServer/Program.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_camera,node_runtime,node_platform toneBlue
class node_rawvideo,node_dualiso,node_rawdevelop,node_silent toneAmber
class node_hdr,node_timelapse,node_motion,node_focus,node_audio,node_lua,node_tinycc,node_tinypy toneMint
class node_install,node_ptpcam,node_mlvtools,node_webdav toneRose
class node_photographer toneIndigo
```

## Components

### Camera runtime

- **Canon camera**
- [Task management](https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/src/tasks.c): `src/tasks.c`
- [Camera-specific support](https://github.com/bilalfakhouri/magiclantern_simplified/tree/dev/platform): `platform`

### Imaging and capture

- [Raw video capture](https://github.com/bilalfakhouri/magiclantern_simplified/tree/dev/modules/raw_video): `modules/raw_video`
- [Dual ISO processing](https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/modules/dual_iso/cr2hdr.c): `modules/dual_iso/cr2hdr.c`
- [Raw development](https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/modules/lv_rec/raw2dng.c): `modules/lv_rec/raw2dng.c`
- [Silent photography](https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/modules/silent/silent.c): `modules/silent/silent.c`

### Camera extensions

- [HDR imaging](https://github.com/bilalfakhouri/magiclantern_simplified/tree/dev/modules): `modules`
- [Timelapse](https://github.com/bilalfakhouri/magiclantern_simplified/tree/dev/modules): `modules`
- [Motion detection](https://github.com/bilalfakhouri/magiclantern_simplified/tree/dev/modules): `modules`
- [Focus assistance](https://github.com/bilalfakhouri/magiclantern_simplified/tree/dev/modules): `modules`
- [Manual audio controls](https://github.com/bilalfakhouri/magiclantern_simplified/tree/dev/modules): `modules`
- **Lua scripting**
- [Tiny C compiler](https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/modules/tcc/tccgen.c): `modules/tcc/tccgen.c`
- [TinyPy interpreter](https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/modules/tinypy/tinypy.c): `modules/tinypy/tinypy.c`

### Host tools

- [Card installer I/O](https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/tools/ml-installer/IOManager.py): `tools/ml-installer/IOManager.py`
- [PTP camera utility](https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/tools/ptpcam/ptpcam.c): `tools/ptpcam/ptpcam.c`
- [MLV viewers](https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/tools/g3gg0/MLVBrowseSharp/Program.cs): `tools/g3gg0/MLVBrowseSharp/Program.cs`
- [WebDAV server](https://github.com/bilalfakhouri/magiclantern_simplified/blob/dev/tools/g3gg0/WebDAVServer/WebDAVServer/Program.cs): `tools/g3gg0/WebDAVServer/WebDAVServer/Program.cs`

### Other components

- **Photographer**

## Connections

- Photographer → Canon camera: starts camera
- Canon camera → Task management: tracks tasks (evidence: `src/tasks.c`)
- Card installer I/O → Canon camera: sets card flags (evidence: `tools/ml-installer/IOManager.py`)
- Photographer → Dual ISO processing: post-processes images (evidence: `modules/dual_iso/cr2hdr.c`)
