CauldronGPU.PNG (CauldronGPU v0.3.3)

Copy Markdown View Source

RGBA pixels as a PNG file, for saving what CauldronGPU.capture/2 returns.

{:ok, frame} = CauldronGPU.capture(gpu)
File.write!("frame.png", CauldronGPU.PNG.encode(frame))

Summary

Functions

PNG bytes for %{width: w, height: h, pixels: rgba}, rows from the top.

Functions

encode(map)

@spec encode(%{width: pos_integer(), height: pos_integer(), pixels: binary()}) ::
  binary()

PNG bytes for %{width: w, height: h, pixels: rgba}, rows from the top.