Recorded Skia picture resource.
Pictures store reusable drawing subtrees. Record a document once, replay it as a draw command, serialize it, or turn it into an image/shader.
{:ok, picture} = Skia.Picture.record(document)
{:ok, bytes} = Skia.Picture.encode(picture)
{:ok, picture} = Skia.Picture.decode(bytes, width: 64, height: 64)
Summary
Types
@type t() :: %Skia.Picture{ height: pos_integer(), ref: reference(), width: pos_integer() }
Functions
@spec decode(binary(), pos_integer(), pos_integer()) :: {:ok, t()} | {:error, atom()}
@spec height(t()) :: pos_integer()
@spec info(t()) :: {:ok, %{ cull_rect: cull_rect(), op_count: non_neg_integer(), nested_op_count: non_neg_integer(), bytes_used: non_neg_integer() }} | {:error, atom()}
@spec record(Skia.Document.t()) :: {:ok, t()} | {:error, atom(), map()}
@spec width(t()) :: pos_integer()