Pudu programming language
Menu
API reference

Std.Ui.Canvas.render

1 declaration

fn

render: &Std.Ui.Canvas.Canvas -> Result[Std.Ui.Canvas.Surface, Std.Ui.Canvas.CanvasError]

This is a callable function.

What it does

Render the display list into an opaque row-major RGBA framebuffer.

Rendered by bands and spans rather than by pixels. Rows between two

consecutive command edges are identical, so each band is composed once as

a list of spans and its bytes are repeated for the band's height; a command

blends into a span once, not into each pixel. The work follows the number of

edges, and the pixels are produced by whole-run copies. A program rendering

a 512 by 512 frame with a full-frame fill and a translucent 128 by 128 fill

runs in 0.10s at -O2, the same as one that renders nothing, against 4.35s

and 2.8 times the resident memory when each pixel is written into the buffer.

Read the signature

  • The text after the name is the type checked by Pudu.
  • Read arrows from left to right: inputs come first, and the final type is returned.
  • & borrows a value for this call instead of moving or copying it.
  • Names inside [ ] are type arguments, such as the item type held by a collection.
  • Result makes success and recoverable failure part of the function's type.

Back to Std.Ui.CanvasSearch related declarations