# `Cauldron2D.Mask`
[🔗](https://github.com/jaman/cauldron/blob/v0.2.2/cauldron_2d/lib/cauldron_2d/mask.ex#L1)

Which pixels of a picture are solid, one bit each.

`bits` holds `height` rows, each padded to whole bytes, the leftmost pixel of a byte
in its high bit.

    mask = Cauldron2D.Mask.from_raster(raster)
    Cauldron2D.Mask.set?(mask, {3, 7})

# `t`

```elixir
@type t() :: %Cauldron2D.Mask{
  bits: binary(),
  height: pos_integer(),
  width: pos_integer()
}
```

# `from_raster`

```elixir
@spec from_raster(FrenchCurve.Raster.t(), 1..255) :: t()
```

The mask of `raster`'s pixels whose alpha is at least `threshold` (default 1).

# `new`

```elixir
@spec new(pos_integer(), pos_integer(), binary()) :: t()
```

A mask from rows of bits as described above.

# `set?`

```elixir
@spec set?(t(), {integer(), integer()}) :: boolean()
```

Whether pixel `{x, y}` is solid; pixels outside the mask are not.

---

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