A picture made from another by a short line of operations, so one drawing gives many views: a recoloured costume, a mirrored heading, a hat laid on.
from knight; colour C #c02020; flip h
from walk; frame 2; over hat 0 -2The operations, separated by ;, in the order they run:
from NAME— the picture to start from; always firstcolour KEY COLOUR(orcolor) — whatKEYmeans, as a palette line takes itswap KEY KEY— exchange what two keys meanflip h/flip v— mirror left to right, or top to bottomturn 90/180/270— clockwise, a quarter turn at a timeshift DX DY— move the picture, what leaves the edge lost, what enters transparentframe N— keep theNth frame alone, counting from 1reverse— the frames in the other orderover NAME [DX DY]— layNAME's first frame on every frame, its transparent keys letting the picture through, moved byDX DY; the palettes are merged, and a key the two pictures use for different colours is refused
Everything works on the text of a .pic — keys, not pixels — so a derived picture is
a picture like any other, edited in the same editors and rendered the same way.
derive/2 takes the line and a function from a name to the text it names — {:ok, text}, :error for a name it does not know, or {:error, message} with a reason of
its own.
Summary
Functions
The picture line describes, with lookup giving the text behind each name it uses.
The operations in line, or why it could not be read.
The picture the operations make, as text.
Types
Functions
The picture line describes, with lookup giving the text behind each name it uses.
The operations in line, or why it could not be read.
Examples
iex> Linocut.Derive.parse("from ship; flip h; colour H #fff")
{:ok, [{:from, "ship"}, {:flip, :h}, {:colour, "H", "#fff"}]}
The picture the operations make, as text.