Crate retro_pixel

Source
Expand description

This is a library for pushing pixels on the CPU.

It uses SIMD where possible, so it’s pretty fast. Run the benchmarks to decide if it’s fast enough for your use-case. The intent is more for smaller resolution situations like a retro console would have, but you can do 1080p if you want. Even without SIMD the indexed color mode at least can run at basically any resolution you want.

Note that this library will not put your pixels on the screen itself. You still have to use a GPU library of some sort to get stuff displayed. Examples are provided of how you might do that with glutin and gl, but you’re free to use anything else if you want.

All of the real work is done via traits, and you can create image slices to wrap around your existing image data. This allows you to quickly connect the library onto your existing image types if you need to. If you don’t have existing image types, there is a VecImage type provided. There’s also an example of an array-backed type, allowing you to use the library in a no_std situation (requires nightly). In the future, it’s hoped that this library will include feature flags to automatically support other crates, but not yet.

Re-exports§

Modules§

  • All of our macros go in here.
  • Module for color palettes you might wish to use with your indexed color images.
  • Module for code specific to u16 base images.
  • Module for code specific to u32 base images.

Macros§

Structs§

  • A struct that iterates over pixels of an Image by mutable reference.
  • A mutable sub-view of some image data.
  • A struct that iterates over pixels of an Image by reference.
  • A shared view of some image data.
  • An image the size of an NES screen, backed by an array.
  • An image backed by a Vec.

Traits§

  • Trait for anything that can be read as if it was an image.
  • The trait for anything that can be written to as if it was an image.