Metadata-Version: 2.4
Name: rivoli
Version: 2.0.0a1
Author-email: François Margall <fr.margall@proton.me>
License-Expression: MIT
Project-URL: Repository, https://github.com/fmargall/rivoli.git
Project-URL: Tracker, https://github.com/fmargall/rivoli/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: numpy
Dynamic: license-file

<div align="center">
    <img src="docs/images/header.png">
</div>

## Usage

### Reading a MERL BRDF file

```python
from rivoli.io import readMERL

brdf = readMERL("alum-bronze.binary")
print(brdf.shape)  # (90, 90, 180, 3)
```

The returned array is indexed by `(thetaH, thetaD, phiD, channel)` in the
Rusinkiewicz half-vector parameterization:

| Axis     | Bins | Mapping                                               |
|----------|------|-------------------------------------------------------|
| `thetaH` | 90   | square-root, concentrating resolution near specular   |
| `thetaD` | 90   | linear, 1° per bin over [0, π/2]                      |
| `phiD`   | 180  | linear, 1° per bin over [0, π], folded by reciprocity |
| channel  | 3    | RGB                                                   |

Values are BRDF values in sr⁻¹, with the MERL per-channel scale factors already
applied. Bins for which no measurement is available are negative and should be
masked before use:

```python
valid = brdf >= 0
```
