|
MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
|
Go to the source code of this file.
Public C API declarations for render sessions.
| void mln_json_snapshot_destroy | ( | mln_json_snapshot * | snapshot | ) |
Destroys a JSON snapshot handle. Null is accepted as a no-op.
| mln_status mln_json_snapshot_get | ( | const mln_json_snapshot * | snapshot, |
| const mln_json_value ** | out_value ) |
Borrows the root JSON value from a snapshot handle.
The returned pointer and all nested pointers remain valid until the snapshot is destroyed.
Returns:
| mln_status mln_render_session_clear_data | ( | mln_render_session * | session | ) |
Clears renderer data for the session.
Returns:
| mln_status mln_render_session_destroy | ( | mln_render_session * | session | ) |
Destroys a render session handle.
If the session is still attached, this function detaches it first.
Returns:
| mln_status mln_render_session_detach | ( | mln_render_session * | session | ) |
Detaches backend-bound render resources from the map while keeping the session handle live for destruction.
After detach, resize, render, readback, acquire, and renderer maintenance operations return MLN_STATUS_INVALID_STATE.
Returns:
| mln_status mln_render_session_dump_debug_logs | ( | mln_render_session * | session | ) |
Dumps renderer debug logs for the session through MapLibre Native logging.
Returns:
| mln_status mln_render_session_get_feature_state | ( | mln_render_session * | session, |
| const mln_feature_state_selector * | selector, | ||
| mln_json_snapshot ** | out_state ) |
Copies per-feature state from a render source in this render session.
The session renderer must already exist. selector->source_id and selector->feature_id are borrowed for the duration of the call. On success, *out_state receives an owned snapshot handle. Use mln_json_snapshot_get() to borrow its root JSON object value, and destroy it with mln_json_snapshot_destroy(). Missing native source or feature state is reported as an empty object snapshot.
Returns:
| mln_status mln_render_session_reduce_memory_use | ( | mln_render_session * | session | ) |
Asks the session renderer to release cached resources where possible.
Returns:
| mln_status mln_render_session_remove_feature_state | ( | mln_render_session * | session, |
| const mln_feature_state_selector * | selector ) |
Removes per-feature state from a render source in this render session.
The session renderer must already exist. selector->source_id is required. selector->feature_id and selector->state_key are optional. Passing both removes one state key from one feature. Passing only feature_id removes all state for that feature. Passing neither removes all feature state for the source/source-layer. The accepted command requests a map repaint.
Returns:
| mln_status mln_render_session_render_update | ( | mln_render_session * | session | ) |
Processes the latest map render update for an attached render session.
Surface sessions render and present through their native surface. Texture sessions render into their texture target.
Returns:
| mln_status mln_render_session_resize | ( | mln_render_session * | session, |
| uint32_t | width, | ||
| uint32_t | height, | ||
| double | scale_factor ) |
Resizes an attached render session.
Width and height are logical map dimensions. The scale_factor value maps them to physical backend pixels.
Returns:
| mln_status mln_render_session_set_feature_state | ( | mln_render_session * | session, |
| const mln_feature_state_selector * | selector, | ||
| const mln_json_value * | state ) |
Sets per-feature state on a render source for this render session.
The session renderer must already exist; call mln_render_session_render_update() once after loading style data before using feature state. selector->source_id and selector->feature_id are borrowed for the duration of the call. state must be a JSON object descriptor and is copied before return. The accepted command requests a map repaint.
Returns: