Grafo
Grafo is a GPU-accelerated rendering library for Rust.
Leveraging the power of the wgpu crate, Grafo provides efficient rendering of shapes, images,
and text with support for advanced features like stencil operations and parallel processing.
The library is designed for flexibility and ease of use, making it suitable for a wide range of applications, from simple graphical interfaces to complex rendering engines.
Features
- Shape Rendering: Create and render complex vector shapes.
- Image Rendering: Render images with support for clipping to shapes.
- Text Rendering: Render text with customizable layout, alignment, and styling using the glyphon crate.
- Stencil Operations: Advanced stencil operations for clipping and masking.
- Performance Optimization: Utilizes parallel processing with
rayonto optimize rendering performance.
Grafo available on crates.io, and API Documentation is available on docs.rs.
Getting Started
Add the following to your Cargo.toml:
[]
= "0.1.0"
= "0.27" # For window creation and event handling
= "0.24" # For image processing
= "0.10" # For logging
= "0.4" # For logging
Basic Usage
Below is a simple example demonstrating how to initialize the Renderer, add shapes and text,
and render a frame using winit. For a more comprehensive example, refer to the
examples folder in the repository.
use block_on;
use ;
use ;
use Arc;
use ;
use EventLoop;
use WindowBuilder;
Examples
For a detailed example showcasing advanced features like hierarchical clipping, image rendering, and text rendering, please refer to the examples directory in the repository.
Documentation
Documentation is available on docs.rs.
Contributing
Everyone is welcome to contribute in any way or form! For further details, please read CONTRIBUTING.md.
Authors
Also, see the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE.md file for details