Module: graphics.backend.memory

Source: ./graphics/backend/memory.reef


Overview

graphics/backend/memory.reef - In-memory rendering surface Part of reef-stdlib graphics module


Functions

fn create_memory_surface(width: int, height: int): surface.Surface

Create a new in-memory surface with RGBA format

fn create_memory_surface_with_format(width: int, height: int, format: image.PixelFormat): surface.Surface

Create a new in-memory surface with specified format

fn get_surface_image(s: surface.Surface): image.Image

Get the underlying image from a surface

fn surface_to_bytes(s: surface.Surface): [uint8]

Get raw pixel data from surface

fn surface_to_rgba8_bytes(s: surface.Surface): [uint8]

Emit a canonical, tightly-packed RGBA8 byte buffer (stride = width*4), independent of the surface's internal pixel format. Consumers that expect RGBA8 can use this instead of surface_to_bytes (which exposes the raw, format-dependent buffer).


Generated by reefc doc