lc_render_scene function

  1. @Native<Int32 Function(Int32, Int32, Pointer<LcLayerDesc>, Int32, Int32, Pointer<Pointer<Uint8>>, Pointer<Size>)>(ffi.Int32, ffi.Int32, ffi.Pointer<LcLayerDesc>, ffi.Int32, ffi.Int32, ffi.Pointer<ffi.Pointer<ffi.Uint8>>, ffi.Pointer<ffi.Size>)>()
int lc_render_scene(
  1. int width,
  2. int height,
  3. Pointer<LcLayerDesc> layers,
  4. int layer_count,
  5. int format,
  6. Pointer<Pointer<Uint8>> out_data,
  7. Pointer<Size> out_len,
)

Composes a whole scene in one call: creates a width x height canvas, paints layers onto it in array order, and encodes the result as format (LcOutputFormat) into *out_data/*out_len. Returns 0 on success. On success, the caller must release the buffer with lc_buffer_free.

The caller (the Dart side) is responsible for resolving stacking order (Layer.zIndex) into layers' array order and dropping invisible layers before calling this - see scene_desc.h. layers may be NULL only if layer_count is 0.

Implementation

@ffi.Native<
  ffi.Int32 Function(
    ffi.Int32,
    ffi.Int32,
    ffi.Pointer<LcLayerDesc>,
    ffi.Int32,
    ffi.Int32,
    ffi.Pointer<ffi.Pointer<ffi.Uint8>>,
    ffi.Pointer<ffi.Size>,
  )
>()
external int lc_render_scene(
  int width,
  int height,
  ffi.Pointer<LcLayerDesc> layers,
  int layer_count,
  int format,
  ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_data,
  ffi.Pointer<ffi.Size> out_len,
);