Metadata-Version: 2.4
Name: bayerlink
Version: 0.3.0
Summary: Raw sensor data over an HDMI/DVI link: the bayerlink protocol and its reference implementation
Author: Serge Rabyking
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/bayerlink/bayerlink
Project-URL: Source, https://github.com/bayerlink/bayerlink
Project-URL: Issues, https://github.com/bayerlink/bayerlink/issues
Keywords: bayer,raw,hdmi,dvi,fpga,camera,protocol,video
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Software Development :: Embedded Systems
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

# bayerlink

**Raw sensor data over an HDMI/DVI link.**

FPGA boards rarely have camera connectors; nearly everything has HDMI. The
bayerlink protocol treats a display link's active area as a byte container:
packed raw Bayer samples, one camera line per display line, self-described by
a 48-byte header (magic, version, V4L2 fourcc, geometry, frame counter,
stripe and source identity for multi-link use, CRC).
Real sensor data into any board with HDMI-in — no MIPI hardware, no
deserialisers, no per-sensor bring-up on the receiver.

**[PROTOCOL.md](PROTOCOL.md) is the specification.** This package is its
reference implementation, and `vectors/` pins the exact bytes, so a
conforming implementation in any language never has to run this one.

Independent implementations are unrestricted and encouraged; say "speaks
bayerlink v2" and you are conforming, not licensing. See
[TRADEMARK.md](TRADEMARK.md) for the one thing the name asks of you.

## The package

```python
import bayerlink

frame = bayerlink.encode_frame(raw, "RGGB", frame_seq=7)   # (H, W, 3) uint8 out
header, raw = bayerlink.decode_frame(captured)              # and back
header.bayer_order, header.width, header.frame_seq
```

It runs on **both ends**: encoders build containers with it, and a receiver's
host software decodes captured frames with the same module — one
implementation to disagree with the spec, which is the fewest possible.

`bayerlink.pattern` carries the link-proving test patterns (`counting`,
`gradient`, `checker`, `corners`) every encoder and receiver bring-up uses;
`checker` and `corners` pin 0 and full scale, the first casualties of a
limited-range link.

## Implementations

The registry lives at the end of [PROTOCOL.md](PROTOCOL.md). Reference
encoder: [picam2hdmi](https://github.com/bayerlink/picam2hdmi) (Raspberry Pi,
every libcamera sensor). To be listed: implement the spec, pass the vectors,
open an issue.

## Licence

Apache-2.0 — chosen over MIT for two of its clauses, not for anything this
project owns. Section 3 means every contributor grants implementers a licence
to any patent claims their contribution would infringe: no such patents are
known or claimed, and the clause is insurance FOR implementers, not an
assertion by this project. Section 6 makes explicit that the licence covers
the text and code, never the name (see TRADEMARK.md). A protocol meant for many independent implementers benefits
from both being written down.
