A sprite sheet cut into frames.
Linocut.Sheet.cut(raster, band: 0, gap: 6)The sheet's background must already be clear. Rows of frames are found as bands of pixels separated by blank rows, and frames within a band as runs of columns separated by blank columns. Every frame comes back the same size, each centred across and standing on the band's own floor, so a walk cycle keeps its feet on one line.
Summary
Functions
The frames of raster, left to right.
Every band's frames, top band first, all padded to one size.
The rows of raster holding any pixel, as {row, holds?}.
Runs of true in flags, as {first, last}, joining runs closer than gap apart.
Types
@type box() :: {integer(), integer(), pos_integer(), pos_integer()}
Functions
@spec cut(FrenchCurve.Raster.t(), keyword()) :: [FrenchCurve.Raster.t()]
The frames of raster, left to right.
Options
:band— which row of frames to cut, counting from the top. Default0:gap— how many blank columns or rows separate one frame or row from the next. Default6:alpha— the alpha at or above which a pixel counts. Default16
@spec cut_all(FrenchCurve.Raster.t(), keyword()) :: [FrenchCurve.Raster.t()]
Every band's frames, top band first, all padded to one size.
Takes cut/2's :gap and :alpha.
@spec rows(FrenchCurve.Raster.t(), non_neg_integer()) :: [boolean()]
The rows of raster holding any pixel, as {row, holds?}.
@spec runs([boolean()], non_neg_integer()) :: [{non_neg_integer(), non_neg_integer()}]
Runs of true in flags, as {first, last}, joining runs closer than gap apart.