Skip to main content

Crate cranpose_render_pixels

Crate cranpose_render_pixels 

Source
Expand description

§Cranpose Pixels Renderer

cranpose-render-pixels draws Cranpose scenes into a caller-owned RGBA byte buffer. Renderer and host authors use PixelsRenderer when a software frame fits the target surface. App authors can select the renderer-pixels feature on cranpose.

PixelsRenderer::draw_scaled writes the current scene into a host-owned RGBA buffer at the requested device scale:

use cranpose_render_pixels::PixelsRenderer;

let renderer = PixelsRenderer::new();
let mut rgba = vec![0; 64 * 64 * 4];
renderer.draw_scaled(&mut rgba, 64, 64, 2.0);

AppShell supplies the scene before each frame. The host presents the image. The watchOS host shows the complete integration.

Default features are empty. The optional embedded-default-font feature supplies a fallback font. The renderer-pixels feature selects this backend through cranpose; the watchos feature selects the same backend.

See the PixelsRenderer API, the renderer architecture guide and the crate source.

Modules§

scene
style

Structs§

HitRegion
PixelsRenderer
Scene

Enums§

PixelsRendererError

Functions§

draw_scene