| Crates.io | pixstage |
| lib.rs | pixstage |
| version | 0.1.0 |
| created_at | 2024-03-05 16:56:51.787391+00 |
| updated_at | 2025-12-16 14:00:54.061419+00 |
| description | A canvas for drawing pixels |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1163253 |
| size | 229,790 |
Pixstage is a tiny pixel buffer library built on top of wgpu.
It targets retro game emulators and software renderers, with two core goals:
Indexed8 + Palette rendering (palette lookup happens on the GPU).Pixstage is windowing-framework-agnostic: any framework that supports raw-window-handle can be used.
PixstageRgba: RGBA8 pixel buffer with incremental texture updatesPixstageIndexed: Indexed8 + Palette with GPU palette lookup (great for palette cycling)PixstageRgb565: RGB565 input with incremental upload (converted to RGBA8 only for dirty regions)PixstageArgb1555: ARGB1555 input with incremental upload (1-bit alpha)ScalingMode::PixelPerfect and ScalingMode::FillPixstageOptions: shared configuration (backends/present_mode/scaling/clear_color)rectangle_and_line: simple drawing using PixstageRgbapalette_cycle: palette animation using PixstageIndexedrgb565_checker: RGB565 input example using PixstageRgb565argb1555_alpha: ARGB1555 (1-bit alpha) example using PixstageArgb1555Run:
cargo run --example rectangle_and_line
cargo run --example palette_cycle
cargo run --example rgb565_checker
cargo run --example argb1555_alpha
use pixstage::{PixstageRgba, SurfaceTexture};
use winit::event_loop::EventLoop;
use winit::window::Window;
# let event_loop = EventLoop::new().unwrap();
# let window = Window::new(&event_loop).unwrap();
# let size = window.inner_size();
let surface = SurfaceTexture::new(size.width, size.height, &window)?;
let mut stage = PixstageRgba::new_async(320, 240, surface).await?;
// Write pixels
stage.set_pixel(10, 10, [255, 0, 0, 255]);
stage.render()?;
# Ok::<(), pixstage::Error>(())
winit, but the library itself does not depend on it.