grixy

Crates.iogrixy
lib.rsgrixy
version0.6.0-alpha.3
created_at2025-07-13 02:05:16.405204+00
updated_at2025-08-05 05:25:48.107254+00
descriptionZero-cost 2D grids for embedded systems and graphics
homepage
repositoryhttps://github.com/crates-lurey-io/grixy
max_upload_size
id1749897
size186,797
Matan Lurey (matanlurey)

documentation

README

grixy

Zero-cost 2D grids focused on memory consumption and performance.

Test Docs Crates.io Version codecov

Grixy provides a set of traits and types for working with 2D grids, including traits for reading and writing to grids, as well as implementations for common buffer types based on linear arrays or vectors. The crate is no_std compatible, and operates without a dynamic memory allocator; as a result most1 APIs are lazily evaluated, returning or operating on iterators or references rather than copying data around.

Possible use-cases include:

  • 2D games, where grids can represent tile maps, collision detection, or game state
  • Simulations, where grids can represent physical systems, cellular automata, or spatial data
  • Pixel rasterization, where grids can represent images, textures, or graphical data
  • Any other 2D grid-based data structure, such as matrices, graphs, or spatial indexing

Example

Drawing glyphs

Grixy can be used for more complex operations like software blending or scaling:

cargo run --example mono-font-raster

This example:

  • loads a bitmap font, and views it as a grid of glyphs;
  • creates an in-memory buffer of rgba pixels;
  • draws the glyphs into the pixel buffer;
  • (using the png crate) saves the pixel buffer as a PNG file, seen below.

Loading and rendering an 8x8 font

Contributing

This project uses just to run commands the same way as the CI:

  • cargo just check to check formatting and lints.
  • cargo just coverage to generate and preview code coverage.
  • cargo just doc to generate and preview docs.
  • cargo just test to run tests.

For a full list of commands, see the Justfile.

Footnotes

  1. The alloc feature enables additional functionality based on alloc.

Commit count: 0

cargo fmt