Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.
/ rootvg Public archive

A 2D vector graphics library optimized for GUIs, written in Rust and wgpu

License

Notifications You must be signed in to change notification settings

MeadowlarkDAW/rootvg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RootVG

Documentation Crates.io License

A 2D vector graphics library optimized for GUIs, written in Rust and wgpu

How it Works

Unlike other 2D vector graphics libraries which have a streaming drawing API similar to HTML5's Canvas API, users of RootVG construct reusable "primitives" that can be cheaply cloned and added in any order with any z index and inside of any scissoring rectangle. Primitives of the same type, z index, and scissoring rectangle are automatically batched together so that the number of draw calls to the GPU are greatly reduced.

See the demo for a quick overview of how the API works.

Primitive Types

RootVG provides six primitive types:

  • SolidQuadPrimitive and GradientQuadPrimitive - based on the quad primitives from Iced
  • SolidMeshPrimitive and GradientMeshPrimitive - draws arbitrary triangles with a solid color or a gradient. The lyon crate is used to generate meshes.
  • TextPrimitive - powered by glyphon
  • ImagePrimitive - supports scale and rotation. The output of a previous render pass can also be used as a texture source.

Additionally, users can create custom primitives with custom rendering pipelines. This can be useful for creating things like efficient spectrometer and oscilloscope displays.

Primitives types that aren't needed can be disabled in the feature flags.

Motivation

This library was created for the Yarrow GUI library which powers the Meadowlark DAW.

About

A 2D vector graphics library optimized for GUIs, written in Rust and wgpu

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published