Minimal and practical Nim bindings for libyuv, focused on efficient image format conversion with a clear and predictable memory layout.
- NV12 / I420 / RGB24 / RGBA conversion
- Explicit RGBA memory layout (R, G, B, A)
- Zero-copy friendly design
- Debug output (PPM / PAM)
Memory layout is always:
R, G, B, A
Internally libyuv ABGR conversions are used to guarantee this on little-endian systems.
type
PixelRGBA = object
r, g, b, a: uint8
RgbaImage = object
width: int
height: int
stride: int
data: seq[PixelRGBA]let rgba = nv12.toRgba()savePam("out.pam", rgba)Convert to PNG:
convert out.pam out.pngMIT