Metadata-Version: 2.4
Name: freekmapper
Version: 0.1.4
Summary: A projection mapping application using PyOpenGL and Tkinter
Author: Vishal Rajendra Kumar
License: MIT License
        
        Copyright (c) 2026 Vishal Rajendra Kumar
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: moderngl
Requires-Dist: glfw
Requires-Dist: dearpygui
Requires-Dist: opencv-python
Requires-Dist: numpy
Requires-Dist: Pillow
Requires-Dist: sv-ttk
Requires-Dist: pyopengltk
Dynamic: license-file

# FREEkMapper

A powerful projection mapping application built with Python, Tkinter, and OpenGL. Designed for live performance and installation art, FREEkMapper allows you to map video and images onto physical surfaces with advanced sequencing and live control capabilities.

## Features

- **Quad Surface Mapping**: Create and map multiple quad surfaces to physical objects.
- **Media Support**: Load videos and images onto individual surfaces.
- **Advanced Playback Modes**:
    - **Concurrent**: All surfaces play their media simultaneously (looping).
    - **Sequential**: Define a playlist of steps where surfaces play one after another.
- **Continuous Surfaces**: Designate specific surfaces to keep playing (e.g., background loops) regardless of the current sequence step.
- **Live Control Panel**: A separate window for triggering saved configurations and managing shows live.
- **Fullscreen Output**: High-performance OpenGL output window for the projector.
- **Configuration Persistence**: Save and load your entire mapping setup and sequence.

## Installation

```bash
pip install freekmapper
```

## Usage

To start the application:

```bash
freekmapper
```

## Workflow Guide

### 1. Mapping Surfaces
1.  **Add Surface**: Click "Add Quad Surface" to create a new mapping area.
2.  **Adjust Geometry**:
    - In the **Embedded Preview** (Right Panel), drag the corners of the surface to match your physical object.
    - Use **Shortcuts**: `r` / `R` to rotate the surface points if the orientation is wrong.
3.  **Load Media**: Select a surface in the list and click "Load Video" or "Load Image".

### 2. Sequencing & Playback
The application supports two playback modes:

-   **Concurrent (All Play)**: Default mode. All surfaces play their assigned media in a loop.
-   **Sequential (One by One)**: Plays a defined playlist of cues.

#### Setting up a Sequence
1.  Click **⚙ Setup Sequence** to open the Sequence Editor.
2.  **Add Steps**: Select a surface and media file, then click "Add to Playlist".
3.  **Order**: Use "Move Up" / "Move Down" to arrange the playback order.
4.  **Continuous Surfaces**: Check the boxes on the right for surfaces that should *always* be visible (e.g., a background layer), even when other steps are playing.
5.  **Apply**: Saves the sequence.

### 3. Live Performance
For live shows, use the **Live Control Panel**:

1.  Click **🎛 Live Control Panel**.
2.  **Slots**: You have 5 slots to assign different saved configurations (`.npy` files).
    -   Click **Assign** to choose a config file.
    -   Click **GO** to instantly load that configuration.
3.  **Looping**:
    -   Check the boxes next to the slots you want to include in a loop.
    -   Set the **Loop Duration** (in seconds).
    -   Click **Start Loop** to cycle through the selected configs automatically.
4.  **Blackout**: Click **Disable Show** to instantly blackout the projector output. Click again to resume.

### 4. Fullscreen Output
When you are ready to project:

1.  Select the target **Display** from the dropdown.
2.  Click **▶ Fullscreen Output**.
3.  **Fullscreen Shortcuts**:
    -   `ESC`: Exit fullscreen.
    -   `E`: Toggle **Edit Mode** (shows/hides corner handles).
    -   `H`: Hide/show control overlays.
    -   `R`: Rotate the selected surface.
    -   **Drag Corners**: You can fine-tune the mapping directly in the fullscreen window.

## Requirements

-   Python 3.8+
-   OpenGL 3.3+ compatible graphics card
-   Dependencies: `moderngl`, `glfw`, `dearpygui`, `opencv-python`, `numpy`, `Pillow`
