Compact command batch encoding and rendering.
Compact batches are useful for storage, transport, and native decode benchmarking. They are explicit API, not the default renderer path.
batch = Skia.Compact.encode(document)
binary = Skia.Compact.encode_binary(document)
{:ok, raw} = Skia.Compact.to_raw(document)
Summary
Types
@type batch() :: {pos_integer(), pos_integer(), [compact_command()]}
@type compact_command() :: {pos_integer(), [compact_value()], keyword(compact_value())}
@type compact_value() :: term()
Functions
@spec encode(Skia.Document.t()) :: batch()
@spec encode_binary(Skia.Document.t()) :: binary()
@spec encode_command(Skia.Command.t()) :: compact_command()
@spec op_id(atom()) :: pos_integer()
@spec render(Skia.Document.t(), keyword() | Skia.RenderOptions.t()) :: {:ok, binary() | map()} | {:error, atom(), map()}
@spec to_png(Skia.Document.t()) :: {:ok, binary()} | {:error, atom(), batch()}
@spec to_raw(Skia.Document.t()) :: {:ok, %{ width: pos_integer(), height: pos_integer(), stride: pos_integer(), data: binary() }} | {:error, atom(), batch()}