ExYUV

Hex.pmAPI Docs

Elixir binding for libyuv.

libyuv is an open source project that includes YUV scaling and conversion functionality.

Formats

Formats (FOURCC) supported by libyuv are detailed here.

Core Formats

There are 2 core formats supported by libyuv - I420 and ARGB. All YUV formats can be converted to/from I420. All RGB formats can be converted to/from ARGB.

Filtering functions such as scaling and planar functions work on I420 and/or ARGB.

Planar Formats

Format Planes Description
I420 3 Y full resolution. U half width, half height. V half width, half height

Packed Formats

Format Bits Per Pixel Pixel Memory Layout
RAW (RGB) 24 <<r::8, g::8, b::8>>
RGB24 24 <<b::8, g::8, r::8>>
ARGB 32 <<b::8, g::8, r::8, a::8>>
ABGR 32 <<r::8, g::8, b::8, a::8>>
BGRA 32 <<a::8, r::8, g::8, b::8>>
RGBA 32 <<a::8, b::8, g::8, r::8>>
RGB565 16 <<r::5, g::6, b::5>>
RGB1555 16 <<a::1, r::5, g::6, b::5>>
RGB4444 16 <<a::4, r::4, g::4, b::4>>
AR30 32 <<a::2, r::10, g::10, b::10>>
AB30 32 <<a::2, b::10, g::10, r::10>>

Installation

The package can be installed by adding ex_yuv to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_yuv, "~> 0.2.0"}
  ]
end