# `Cauldron2D.Parallax.Bands`
[🔗](https://github.com/jaman/cauldron/blob/v0.2.2/cauldron_2d/lib/cauldron_2d/parallax/bands.ex#L1)

Horizontal bands of one layer, each scrolling at its own factor.

    bands = Cauldron2D.Parallax.Bands.new([{0..5, 0.1}, {6..11, 0.45}, {12..23, 0.9}])
    Cauldron2D.Parallax.Bands.roll(raster, bands, {focus_x, focus_y}, tile)

Ranges are tile rows from the top of the picture, read in order, the first range holding
a row deciding it. A row no range covers does not move. A band reads the focus itself, so
a layer that carries bands wants a factor of `0.0` on the axis they move along.

# `t`

```elixir
@type t() :: %Cauldron2D.Parallax.Bands{ranges: [{Range.t(), float()}]}
```

# `factor`

```elixir
@spec factor(t(), integer()) :: float()
```

The factor for tile row `row`, or `0.0` where no band covers it.

# `new`

```elixir
@spec new([{Range.t(), number()}]) :: t()
```

Bands from `[{tile_rows, factor}]`.

# `roll`

```elixir
@spec roll(FrenchCurve.Raster.t(), t() | nil, {number(), number()}, pos_integer()) ::
  FrenchCurve.Raster.t()
```

`raster` with every band's pixel rows rolled sideways by its own share of `focus`.

---

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