A block of pixels in the framebuffer's own format: 4 bytes per pixel, BGRX.
Colours can be given as a hex string ("#1C1C1E", "1c1c1e") or an
{red, green, blue} tuple of 0..255, anywhere the SDK takes a colour.
Summary
Functions
Normalises a colour to an {r, g, b} tuple.
Wraps raw BGRX pixel data.
An image filled with one colour.
Builds a colour tuple.
Row y of the image as a binary.
Encodes the image as a PNG (8-bit RGB), e.g. for a screenshot.
Types
@type rgb() :: {0..255, 0..255, 0..255}
@type t() :: %NestGen2.Image{ data: binary(), height: pos_integer(), width: pos_integer() }
Functions
Normalises a colour to an {r, g, b} tuple.
iex> NestGen2.Image.color("#1C1C1E")
{28, 28, 30}
@spec from_raw(pos_integer(), pos_integer(), binary()) :: t()
Wraps raw BGRX pixel data.
@spec new(pos_integer(), pos_integer(), color()) :: t()
An image filled with one colour.
@spec rgb(0..255, 0..255, 0..255) :: rgb()
Builds a colour tuple.
@spec row(t(), non_neg_integer()) :: binary()
Row y of the image as a binary.
Encodes the image as a PNG (8-bit RGB), e.g. for a screenshot.