# `BB.Camera.Annotation.Types`
[🔗](https://github.com/beam-bots/bb_camera/blob/main/lib/bb/camera/annotation/types.ex#L5)

The values annotation primitives are built from.

## Points

A point is an `{x, y}` tuple of numbers in pixels of the frame the layer
describes, `x` rightwards and `y` downwards. The origin is the top-left
*corner* of the top-left pixel, as in Foxglove's `ImageAnnotations`, so a
frame `width` pixels wide spans `0..width` and the centre of the top-left
pixel is `{0.5, 0.5}`. A producer whose coordinates put whole numbers at
pixel centres, as OpenCV's do, adds `0.5` to each.

`bb` has no 2D point type, and `BB.Message.Vision.Fiducials` already uses
plain tuples for the same reason: a `BB.Math.Vec3` would claim metres.

## Colours

A colour is `%{red: r, green: g, blue: b, alpha: a}`, each channel a number
from `0` to `1` - the shape `bb` uses for a link's material colour, and the
range Foxglove's `Color` uses. `nil` where a colour is optional means that
part isn't drawn.

# `color`

```elixir
@type color() :: %{red: number(), green: number(), blue: number(), alpha: number()}
```

# `point`

```elixir
@type point() :: {number(), number()}
```

---

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