vivid v0.4.1 API Reference
Modules
Vivid is a 2D rendering engine implemented purely in Elixir
This module represents an Arc, otherwise known as a circle segment
Provides information about the bounds of a box and pixel positions within it
Short-hand for creating rectangle polygons
Used to convert a Frame into a buffer for display
Represents a circle based on it’s center point and radius
This module takes characters generated by the Hershey module and converts them into groups of shapes using the character’s specified left and right padding
Describes an individual character defined by a Hershey font file
Frame represents a collection of colours and shapes
Represents a collection of shapes which can be Rasterized in a single pass
Supports reading the Hershey Vector Font format and converting them into paths
Represents a line segment between two Points in 2D space
I made this because I was constantly importing a small selection of
Erlang’s :math
module, and then manually implementing
degrees_to_radians/1
which got pretty annoying after a while
Describes a path as a series of vertices
Represents an individual point in (2D) space
Describes a Polygon as a series of vertices
Defines a colour in RGBA colour space
Scanline Polygon Filling Algorithm, as per https://hackernoon.com/computer-graphics-scan-line-polygon-fill-algorithm-3cb47283df6#.20fac9f40
Doesn’t do anything - is merely a type to represent an arbitrary shape
Handle conversions of arbitrary shapes into strings
Creates and applies a “pipeline” of transformations to a shape.
Transformation operations are collected up and only run once, when apply
is called
Standard transformations which can be applied to points without knowing the details of the geometry
Protocols
This protocol is used to calculate the bounds of a given shape
The Rasterize protocol is responsible for converting shapes into bitmaps
This protocol is used to apply point transformations to a shape