A picture kept in a file: a palette, a blank line, and the picture.
R #c33
W white
..RR..
.RWWR.Each palette line is one character, a space, and a colour as Linocut.Palette reads
it: #rgb, #rrggbb, #rrggbbaa or a colour name. . and space in the picture are
transparent. parse/2 takes Linocut.sprite/3's options.
Summary
Functions
The frames the text describes, one raster each, or why it could not be read.
The raster the text describes, or why it could not be read.
The text as data, nothing rendered: the palette as {key, colour_spec} pairs in the
order written, and the frames as their rows of keys. write/1 turns it back.
The line that separates frames in a pic.
The text of a picture given as read/1 gives it.
Types
Functions
@spec frames(String.t(), keyword()) :: {:ok, [FrenchCurve.Raster.t()]} | {:error, term()}
The frames the text describes, one raster each, or why it could not be read.
@spec parse(String.t(), keyword()) :: {:ok, FrenchCurve.Raster.t()} | {:error, term()}
The raster the text describes, or why it could not be read.
Frames separated by a --- line come back as one raster with the frames side by
side, left to right, as a strip; frames/2 gives them one by one.
The text as data, nothing rendered: the palette as {key, colour_spec} pairs in the
order written, and the frames as their rows of keys. write/1 turns it back.
Examples
iex> Linocut.Pic.read("R #c33\n\n.R\nR.\n---\nR.\n.R\n")
{:ok, %{palette: [{"R", "#c33"}], frames: [[".R", "R."], ["R.", ".R"]]}}
@spec separator() :: String.t()
The line that separates frames in a pic.
The text of a picture given as read/1 gives it.