`joy_cubetostereo.py`

### What it is for
A command-line cubemap conversion tool that:

1. loads a 6-face skybox / cubemap
2. stitches it into an equirectangular panorama
3. optionally rotates/flips it
4. generates a “tiny planet” / reflection-map style output

This turns a standard skybox into a reflection-map texture (winreflmap) used for reflections in Kingpin.

### Dependencies
```bash
pip install pillow numpy opencv-python
```

### Expected filenames
By default it expects cubemap face suffixes:
- `ft`
- `bk`
- `lf`
- `rt`
- `up`
- `dn`

It can infer the common filename prefix automatically, or you can supply one.

### Usage
```bash
python joy_cubetostereo.py [options]
```

### Arguments
- `--input_path`, `-i`  
  Folder containing the cubemap face images. Default: current folder.

- `--output_path`, `-o`  
  Output folder. Defaults to the input folder.

- `--prefix`, `-p`  
  Filename prefix for the cubemap faces.  
  Example: `mysky` for files like `myskyft.tga`.

- `--type`, `-t`  
  Output file type / extension, such as `png`, `jpg`, or `tga`.  
  If omitted, it uses the first face’s extension when possible.

- `--size`, `-s`  
  Output equirectangular size as `WIDTHxHEIGHT`.  
  Default: `2048x1024`.

- `--pan`  
  Rotation around the X axis, in degrees.  
  Default depends on reflection-map mode.

- `--roll`  
  Rotation around the Y axis. Default: `0`.

- `--tilt`  
  Rotation around the Z axis. Default: `0`.

- `--flipX`  
  Flip each cubemap face horizontally before stitching.

- `--flipY`  
  Flip each cubemap face vertically before stitching.

- `--mirror`  
  Forces reflection-map style vertical mirroring of each face.  
  In practice, reflection-map mode is already enabled by default unless disabled.

- `--noreflmap`  
  Disables reflection-map mode.

### Default behavior worth knowing
- Reflection-map mode is effectively **on by default** unless `--noreflmap` is used.
- If reflection-map mode is on and `--pan` is not supplied, pan defaults to `180`.
- If reflection-map mode is off and `--pan` is not supplied, pan defaults to `0`.

### Output files
This script writes two files:

1. Equirectangular panorama:
   - `equirect_result.<ext>`

2. Tiny-planet / reflection-map image:
   - `<prefix>reflmap.<ext>`

### Example
```bash
python joy_cubetostereo.py -i skyboxes -o out -p city -t tga -s 2048x1024 --noreflmap
```