# `Emerge.Config.BinaryFrames`
[🔗](https://github.com/emerge-elixir/emerge/blob/v0.5.1/lib/emerge/config/binary_frames.ex#L1)

Owned pixel data for headless output. Set this record as
`Emerge.Config.Headless.frames`. The recipient does not need to release frames.

```elixir
%Emerge.Config{
  output: %Emerge.Config.Headless{
    target: self(),
    frames: %Emerge.Config.BinaryFrames{pixel_format: :bw1, dither: true}
  },
  renderer: %Emerge.Config.Renderer{api: :raster},
  assets: %Emerge.Config.Assets{otp_app: :my_app}
}
```

## Fields

- `pixel_format` — `:rgba8888` (default), `:bgra8888`, `:rgb888`, `:gray8`,
  `:gray2` or `:bw1`. RGBA/BGRA use four bytes per pixel; RGB uses three;
  Gray8 uses one. Gray2 packs four pixels per byte and BW1 packs eight,
  most-significant pixel first in each row. BGRA uses premultiplied alpha.
- `bw1_polarity` — `:one_is_black` (default) or `:one_is_white`. This chooses
  what a set bit means in BW1 output; it does not affect other formats.
- `dither` — `false` by default. Set `true` to improve grayscale approximation
  in raster BW1/Gray2 output. Other formats and GPU renderers do not support it.

Read the frame's stride rather than assuming tightly packed rows.
All fields require a new viewport to change.

# `normalized_t`

```elixir
@type normalized_t() :: t()
```

Canonical form after nested keyword records have been expanded.

# `pixel_format`

```elixir
@type pixel_format() :: :rgba8888 | :bgra8888 | :rgb888 | :gray8 | :gray2 | :bw1
```

Frame pixel encoding.

# `polarity`

```elixir
@type polarity() :: :one_is_black | :one_is_white
```

Meaning of a set bit in BW1 output.

# `t`

```elixir
@type t() :: %Emerge.Config.BinaryFrames{
  bw1_polarity: polarity(),
  dither: boolean(),
  pixel_format: pixel_format()
}
```

---

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