# `QQR.SVG`
[🔗](https://github.com/dannote/qqr/blob/main/lib/qqr/svg.ex#L1)

SVG renderer for QR code matrices.

## Dot shapes

    :square          ■  (default)
    :rounded         ▢  rounded corners (25% radius)
    :dots            ●  circles
    :diamond         ◆  diamond / rotated square

## Finder pattern shapes

Finder patterns (the three big squares in corners) can be styled
independently with `:finder_shape`:

    :square          default
    :rounded         rounded outer ring + rounded inner
    :dots            circular outer ring + circular inner

## Logo embedding

Pass a `:logo` option to embed an image or SVG in the center.
Modules behind the logo are automatically cleared.

    QQR.SVG.render(matrix,
      logo: %{svg: ~s(<circle r="0.4" cx="0.5" cy="0.5" fill="red"/>), size: 0.25}
    )

# `dot_shape`

```elixir
@type dot_shape() :: :square | :rounded | :dots | :diamond
```

# `finder_shape`

```elixir
@type finder_shape() :: :square | :rounded | :dots
```

# `logo_opts`

```elixir
@type logo_opts() :: %{
  optional(:svg) =&gt; String.t(),
  optional(:image_url) =&gt; String.t(),
  optional(:size) =&gt; float(),
  optional(:margin) =&gt; number(),
  optional(:background) =&gt; String.t()
}
```

# `option`

```elixir
@type option() ::
  {:module_size, number()}
  | {:quiet_zone, non_neg_integer()}
  | {:color, String.t()}
  | {:background, String.t()}
  | {:dot_shape, dot_shape()}
  | {:dot_size, float()}
  | {:finder_shape, finder_shape()}
  | {:logo, logo_opts()}
```

# `render`

```elixir
@spec render(QQR.BitMatrix.t(), [option()]) :: String.t()
```

Render a `QQR.BitMatrix` as an SVG string.

See `to_iodata/2` for options.

# `to_iodata`

```elixir
@spec to_iodata(QQR.BitMatrix.t(), [option()]) :: iodata()
```

Render a `QQR.BitMatrix` as SVG iodata.

Returns iodata (nested list of strings) — avoids an extra binary copy.
Pass to `IO.iodata_to_binary/1` when you need a string, or use directly
in Phoenix templates with `raw/1`.

## Options

  * `:module_size` — pixel size per module (default: `10`)
  * `:quiet_zone` — quiet zone in modules (default: `4`)
  * `:color` — dark module color (default: `"#000"`)
  * `:background` — background color (default: `"#fff"`)
  * `:dot_shape` — `:square`, `:rounded`, `:dots`, or `:diamond` (default: `:square`)
  * `:dot_size` — module size multiplier, 0.1–1.0 (default: `1.0`)
  * `:finder_shape` — `:square`, `:rounded`, or `:dots` (default: matches `:dot_shape` or `:square`)
  * `:logo` — logo options map (see module doc)

---

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