Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SoftwareRendererRefMut

The software renderer allows rendering layouts entirely on the CPU. This is surprisingly fast and can be considered the default renderer.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

ptr

ptr: number

Methods

render

  • render(layoutState: LayoutStateRef, data: number, width: number, height: number, stride: number, forceRedraw: boolean): void
  • Renders the layout state provided into the image buffer provided. The image has to be an array of RGBA8 encoded pixels (red, green, blue, alpha with each channel being an u8). Some frameworks may over allocate an image's dimensions. So an image with dimensions 100x50 may be over allocated as 128x64. In that case you provide the real dimensions of 100x50 as the width and height, but a stride of 128 pixels as that correlates with the real width of the underlying buffer. By default the renderer will try not to redraw parts of the image that haven't changed. You can force a redraw in case the image provided or its contents have changed.

    Parameters

    • layoutState: LayoutStateRef
    • data: number
    • width: number
    • height: number
    • stride: number
    • forceRedraw: boolean

    Returns void

Generated using TypeDoc