Sign in

    mizchi/crater-renderer/gfx_vrt does not have a README file

    RenderedImage

    pub(all) struct RenderedImage {
    width : Int
    height : Int
    pixels : Array[Int]
    }

    A rendered RGBA framebuffer: row-major, four 0..255 channels per pixel.

    RenderedImage::pixel_at

    fn RenderedImage::pixel_at(self : RenderedImage, x : Int, y : Int) -> (Int, Int, Int, Int)

    Read back a single pixel as (r, g, b, a).

    RenderedImage::to_ascii

    fn RenderedImage::to_ascii(self : RenderedImage) -> String

    Render the image as ASCII art for snapshotting: each pixel maps to a ramp character by brightness (light -> space, dark -> '@'). Fully transparent pixels render as a space.

    render_html_to_image

    fn render_html_to_image(html : String, viewport :
    Size
    [Double]) -> RenderedImage

    Render an HTML document to an RGBA image at viewport, reusing the existing VRT HTML -> paint tree pipeline.

    render_paint_tree_to_image

    fn render_paint_tree_to_image(root :
    PaintNode
    , width : Int, height : Int) -> RenderedImage

    Render a paint tree to an RGBA image of the given size via the software backend. The tree is expected to be laid out in the same pixel space (its root box matching the viewport).

    render_text_to_image

    fn render_text_to_image(text : String, width : Int, height : Int, x? : Int, y? : Int, scale? : Int) -> RenderedImage

    Render text to an RGBA image with the built-in 5x7 bitmap font (black on white) via the software backend. scale is the pixel size of each font cell. A self-contained text-to-pixels path that needs no external font.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io