How a tile maps onto the terminal's pixels once the session knows the size of a cell.
A tile is drawn at a whole multiple of its own pixels, or shrunk by a divisor of its
size, whichever comes nearest to zoom rows of cells — so every image is sent at the
size it is shown and the terminal scales nothing.
scale = Cauldron2D.Drafter.Surface.Scale.new({14, 30}, 16, 1)
scale.pixels
#=> 32
Summary
Functions
The scale for a terminal whose cells are cell pixels, an atlas whose tiles are tile
pixels square, at zoom (1 a tile the height of a row).
The pane rect (in cells) in pixels.
Where a point tiles from the pane's top left falls: {column, row, x_offset, y_offset},
the cell and the pixels into it.
A fraction of a tile as whole drawn pixels.
How many tiles across and down the pane rect shows, fractional at the edges.
Types
@type factor() :: {:magnify, pos_integer()} | {:reduce, pos_integer()}
@type t() :: %Cauldron2D.Drafter.Surface.Scale{ cell: {pos_integer(), pos_integer()}, factor: factor(), pixels: pos_integer(), tile: pos_integer() }
Functions
@spec new({pos_integer(), pos_integer()}, pos_integer(), number()) :: t()
The scale for a terminal whose cells are cell pixels, an atlas whose tiles are tile
pixels square, at zoom (1 a tile the height of a row).
@spec pane(t(), map()) :: {pos_integer(), pos_integer()}
The pane rect (in cells) in pixels.
Where a point tiles from the pane's top left falls: {column, row, x_offset, y_offset},
the cell and the pixels into it.
A fraction of a tile as whole drawn pixels.
How many tiles across and down the pane rect shows, fractional at the edges.