# `CauldronGPU.Sectors.Live.Lightmap`
[🔗](https://github.com/jaman/cauldron/blob/v0.3.3/cauldron_gpu/lib/cauldron_gpu/sectors/live/lightmap.ex#L2)

Every sector's light level as a lightmap, for a `CauldronGPU.Sectors.Live.LightTable`
to turn into light: a texture three texels wide and one row per sector, the row's
texels the sector's light level with `-16`, `0` and `16` added (a wall's contrast),
each written as `(level + 0.5) / 256` with the level clamped to `0..255`, the column of
the light table that level reads.

    texture = CauldronGPU.Sectors.Live.Lightmap.texture([160, 255], 0, nil)
    CauldronGPU.Sectors.Live.Lightmap.uv({1, 16}, 2)

`extra` is light added to every level; a `fixed` light table other than `nil` writes
every texel as full light, `1.0`.

# `code`

```elixir
@spec code(integer(), non_neg_integer() | nil) :: float()
```

The value light `level` is written as: the light table column it reads.

# `texture`

```elixir
@spec texture([integer()], integer(), non_neg_integer() | nil) ::
  CauldronGPU.Texture.t()
```

The lightmap of sectors whose light levels are `levels`, in sector order.

# `uv`

```elixir
@spec uv({non_neg_integer(), integer()}, pos_integer()) :: {float(), float()}
```

The lightmap coordinates of `{sector, contrast}` in a lightmap of `count` sectors.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
