# bjzhou/photoncamera architecture

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

- Interactive diagram: https://gitdiagram.com/bjzhou/photoncamera
- Repository: https://github.com/bjzhou/photoncamera

## Overview

Photon Camera is an Android still-photography app whose documented workflow captures images, applies photographic rendering and effects, and saves or exports results. The available tree supports a camera-control component, RAW rendering, gallery/export and import, depth-model management, stabilization, and Phantom mode. README capabilities such as LUTs, motion photos, burst, and multi-frame synthesis are represented where the tree supports a relevant subsystem; several implementation paths and connections are not sampled, so those links are omitted rather than inferred.

Main entry points: [`app/src/main/java/com/hinnka/mycamera/phantom/PhantomTileService.kt`](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/phantom/PhantomTileService.kt) (Phantom tile), [`app/src/main/java/com/hinnka/mycamera/phantom/PhantomService.kt`](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/phantom/PhantomService.kt) (Phantom service), [`app/src/main/java/com/hinnka/mycamera/ml/DepthModelManager.kt`](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/ml/DepthModelManager.kt) (Depth model manager), [`app/src/main/java/com/hinnka/mycamera/gallery/GalleryManager.kt`](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/gallery/GalleryManager.kt) (Gallery and export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and modes"]
  node_camera["Camera control"]
  node_phantom_tile["Phantom tile"]
  node_phantom_service["Phantom service<br/>[PhantomService.kt]"]
  node_burst["High-speed burst"]
end

subgraph group_render["Image processing"]
  node_raw_pipeline["RAW rendering"]
  node_tone_pass["Tone pass"]
  node_depth_model["Depth model manager"]
  node_depth_inference["Depth estimation"]
  node_eis_wrapper["EIS wrapper"]
  node_eis_engine["EIS engine"]
  node_multi_frame["Multi-frame synthesis"]
  node_lut_color["LUT color tools"]
  node_ai_color["AI color simulation"]
end

subgraph group_media["Media and imports"]
  node_gallery["Gallery and export<br/>[GalleryManager.kt]"]
  node_custom_import["Custom imports"]
  node_motion_media["Motion photo formats"]
end

subgraph group_platform["Platform services"]
  node_media_store[("Android media store")]
  node_system_camera["System camera"]
  node_model_host["Model download host"]
end

node_photographer(("Photographer"))

node_photographer -->|"controls"| node_camera
node_photographer -->|"toggles mode"| node_phantom_tile
node_phantom_tile -->|"launches"| node_system_camera
node_phantom_tile -->|"enables mode"| node_phantom_service
node_phantom_service -->|"observes media"| node_media_store
node_phantom_service -->|"processes photos"| node_gallery
node_gallery -->|"writes exports"| node_media_store
node_custom_import -->|"imports profiles"| node_lut_color
node_depth_model -.->|"downloads model"| node_model_host
node_depth_inference -->|"loads model"| node_depth_model
node_eis_wrapper -->|"calls native engine"| node_eis_engine
node_raw_pipeline -->|"renders tone"| node_tone_pass

click node_camera "https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/camera/Camera2Controller.kt"
click node_phantom_tile "https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/phantom/PhantomTileService.kt"
click node_phantom_service "https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/phantom/PhantomService.kt"
click node_raw_pipeline "https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/raw/RawRenderingEngineToneAlgorithm.kt"
click node_tone_pass "https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/raw/RawEngineTonePass.kt"
click node_depth_model "https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/ml/DepthModelManager.kt"
click node_depth_inference "https://github.com/bjzhou/photoncamera/tree/main/app/src/main/java/com/hinnka/mycamera/ml"
click node_eis_wrapper "https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/stabilization/MgcEisNativeEngine.kt"
click node_eis_engine "https://github.com/bjzhou/photoncamera/blob/main/app/src/main/cpp/mgc_eis_reconstruction/mgc_type18_engine.cpp"
click node_gallery "https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/gallery/GalleryManager.kt"
click node_custom_import "https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/data/CustomImportManager.kt"
click node_motion_media "https://github.com/bjzhou/photoncamera/tree/main/app/src/main/java/com/hinnka/mycamera/gallery"
click node_multi_frame "https://github.com/bjzhou/photoncamera/tree/main/app/src/main/java/com/hinnka/mycamera/gallery"
click node_lut_color "https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/data/CustomImportManager.kt"
click node_burst "https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/camera/Camera2Controller.kt"
click node_ai_color "https://github.com/bjzhou/photoncamera/tree/main/app/src/main/java/com/hinnka/mycamera"

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_phantom_tile,node_phantom_service,node_burst toneBlue
class node_raw_pipeline,node_tone_pass,node_depth_model,node_depth_inference,node_eis_wrapper,node_eis_engine,node_multi_frame,node_lut_color,node_ai_color toneAmber
class node_gallery,node_custom_import,node_motion_media toneMint
class node_media_store,node_system_camera,node_model_host toneRose
class node_photographer toneIndigo
```

## Components

### Capture and modes

- [Camera control](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/camera/Camera2Controller.kt): `app/src/main/java/com/hinnka/mycamera/camera/Camera2Controller.kt`
- [Phantom tile](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/phantom/PhantomTileService.kt): `app/src/main/java/com/hinnka/mycamera/phantom/PhantomTileService.kt`
- [Phantom service](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/phantom/PhantomService.kt): `app/src/main/java/com/hinnka/mycamera/phantom/PhantomService.kt`
- [High-speed burst](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/camera/Camera2Controller.kt): `app/src/main/java/com/hinnka/mycamera/camera/Camera2Controller.kt`

### Image processing

- [RAW rendering](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/raw/RawRenderingEngineToneAlgorithm.kt): `app/src/main/java/com/hinnka/mycamera/raw/RawRenderingEngineToneAlgorithm.kt`
- [Tone pass](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/raw/RawEngineTonePass.kt): `app/src/main/java/com/hinnka/mycamera/raw/RawEngineTonePass.kt`
- [Depth model manager](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/ml/DepthModelManager.kt): `app/src/main/java/com/hinnka/mycamera/ml/DepthModelManager.kt`
- [Depth estimation](https://github.com/bjzhou/photoncamera/tree/main/app/src/main/java/com/hinnka/mycamera/ml): `app/src/main/java/com/hinnka/mycamera/ml`
- [EIS wrapper](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/stabilization/MgcEisNativeEngine.kt): `app/src/main/java/com/hinnka/mycamera/stabilization/MgcEisNativeEngine.kt`
- [EIS engine](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/cpp/mgc_eis_reconstruction/mgc_type18_engine.cpp): `app/src/main/cpp/mgc_eis_reconstruction/mgc_type18_engine.cpp`
- [Multi-frame synthesis](https://github.com/bjzhou/photoncamera/tree/main/app/src/main/java/com/hinnka/mycamera/gallery): `app/src/main/java/com/hinnka/mycamera/gallery`
- [LUT color tools](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/data/CustomImportManager.kt): `app/src/main/java/com/hinnka/mycamera/data/CustomImportManager.kt`
- [AI color simulation](https://github.com/bjzhou/photoncamera/tree/main/app/src/main/java/com/hinnka/mycamera): `app/src/main/java/com/hinnka/mycamera`

### Media and imports

- [Gallery and export](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/gallery/GalleryManager.kt): `app/src/main/java/com/hinnka/mycamera/gallery/GalleryManager.kt`
- [Custom imports](https://github.com/bjzhou/photoncamera/blob/main/app/src/main/java/com/hinnka/mycamera/data/CustomImportManager.kt): `app/src/main/java/com/hinnka/mycamera/data/CustomImportManager.kt`
- [Motion photo formats](https://github.com/bjzhou/photoncamera/tree/main/app/src/main/java/com/hinnka/mycamera/gallery): `app/src/main/java/com/hinnka/mycamera/gallery`

### Platform services

- **Android media store**
- **System camera**
- **Model download host**

### Other components

- **Photographer**

## Connections

- Photographer → Camera control: controls
- Photographer → Phantom tile: toggles mode
- Phantom tile → System camera: launches
- Phantom tile → Phantom service: enables mode
- Phantom service → Android media store: observes media
- Phantom service → Gallery and export: processes photos
- Gallery and export → Android media store: writes exports
- Custom imports → LUT color tools: imports profiles
- Depth model manager → Model download host: downloads model
- Depth estimation → Depth model manager: loads model
- EIS wrapper → EIS engine: calls native engine
- RAW rendering → Tone pass: renders tone
