#2d-graphics #drawing #canvas #instructions #graphics #context #2d-rendering

flo_canvas

Library for describing graphics context drawing actions without requiring a specific implementation

4 releases (2 breaking)

0.3.1 Mar 11, 2023
0.3.0 Aug 3, 2021
0.2.0 Feb 17, 2021
0.1.0 Mar 17, 2018

#64 in Data formats

Download history 18/week @ 2023-12-15 19/week @ 2023-12-22 3/week @ 2023-12-29 7/week @ 2024-01-05 12/week @ 2024-01-12 7/week @ 2024-01-19 5/week @ 2024-01-26 4/week @ 2024-02-02 17/week @ 2024-02-09 42/week @ 2024-02-16 55/week @ 2024-02-23 39/week @ 2024-03-01 40/week @ 2024-03-08 33/week @ 2024-03-15 36/week @ 2024-03-22 95/week @ 2024-03-29

207 downloads per month
Used in 10 crates (9 directly)

Apache-2.0

400KB
6K SLoC

flo_canvas = "0.3"

flo_canvas

flo_canvas is a library that provides a way to describe 2D drawings, without providing any concrete implementation of how those drawings should be rendered. It supports streaming updates to allow canvases to be displayed in any user interface library that understands the Draw instructions, and it provides a serialization and deserialization mechanism for sending canvas instructions to other applications.

This library was designed to support FlowBetween, an interactive animation editor. However, it has several implementations that make it useful outside that context. In particular, the flo_draw crate provides a straightforward way to render canvases into a window. flo_render and flo_render_canvas combine to provide a general-purpose way of rendering 2D canvases using modern 3D-accellerated graphics hardware: this includes the ability to render canvases off-screen to a bitmap on Linux, OS X and Windows systems.

FlowBetween itself has some implementations that are not quite so accessible but may still be of interest. In particular canvas.js provides an implementation of flo_canvas in javascript, suitable for rendering to a HTML canvas.

Dependencies

~4–9.5MB
~122K SLoC