# `Image.Plug.Pipeline.Ops.Draw.Layer`
[🔗](https://github.com/elixir-image/image_plug/blob/v0.1.0/lib/image/plug/pipeline/ops/draw/layer.ex#L1)

A single overlay layer used by `Image.Plug.Pipeline.Ops.Draw`.

The interpreter prefers SVG composition: when the layer source
resolves to (or can be expressed as) SVG, the overlay is rendered via
`Image.from_svg/2` so it scales without raster artefacts. Bitmap
sources are decoded, optionally resized, and composited with the
configured opacity.

Position is either `nil` (centre) or `{:offset, ...}` with any
combination of `:top` / `:bottom` and `:left` / `:right` (a side and
its opposite cannot both be set; the provider rejects that at parse
time).

# `fit`

```elixir
@type fit() :: :contain | :cover | :crop | :pad | :scale_down
```

# `position`

```elixir
@type position() :: nil | {:offset, keyword()}
```

# `repeat`

```elixir
@type repeat() :: false | true | :x | :y
```

# `t`

```elixir
@type t() :: %Image.Plug.Pipeline.Ops.Draw.Layer{
  background: nil | String.t(),
  fit: fit(),
  gravity: Image.Plug.Pipeline.Ops.Resize.gravity(),
  height: nil | pos_integer(),
  opacity: float(),
  position: position(),
  repeat: repeat(),
  rotate: 0 | 90 | 180 | 270,
  source: Image.Plug.Source.t(),
  width: nil | pos_integer()
}
```

---

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