readTexture method

Future<TextureReadbackResult> readTexture()

Reads the pixels of the last frame that the session rendered.

See mln_render_session_read_texture in the C API reference.

Errors:

  • Status.unsupported when the session's capabilities lack RenderSessionCapabilityFlag.readback.
  • Status.invalidState when the session hasn't rendered a frame since it attached, resized, or changed its target.

Implementation

Future<TextureReadbackResult> readTexture() => _query(
  _resultTextureReadbackResult,
  (arena, completion) => raw.mln_render_session_read_texture(
    _handle.raw,
    completion,
    nativeDiagnostic,
  ),
);