|
MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
|
Go to the source code of this file.
Data Structures | |
| struct | mln_offscreen_device_options |
| struct | mln_offscreen_descriptor |
Typedefs | |
| typedef enum mln_offscreen_device_option_field | mln_offscreen_device_option_field |
| typedef uint32_t | mln_offscreen_device_option_fields |
| typedef struct mln_offscreen_device_options | mln_offscreen_device_options |
| typedef struct mln_offscreen_descriptor | mln_offscreen_descriptor |
Enumerations | |
| enum | mln_offscreen_device_option_field : uint32_t { MLN_OFFSCREEN_DEVICE_OPTION_ADAPTER_INDEX = 1U << 0U , MLN_OFFSCREEN_DEVICE_OPTION_SINGLE_CONTEXT = 1U << 1U , MLN_OFFSCREEN_DEVICE_OPTION_CLIENT_API = 1U << 2U } |
Functions | |
| mln_status | mln_offscreen_device_create (const mln_offscreen_device_options *options, mln_offscreen_device *out_device, mln_diagnostic *out_diagnostic) |
| void | mln_offscreen_device_release (mln_offscreen_device device) |
| mln_status | mln_map_attach_offscreen (mln_map map, const mln_offscreen_descriptor *descriptor, const mln_render_session_attach_options *options, mln_offscreen_device device, mln_render_session *out_session, const mln_completion *completion, mln_diagnostic *out_diagnostic) |
Render maps offscreen on a GPU device that the library creates.
| typedef struct mln_offscreen_descriptor mln_offscreen_descriptor |
The image that mln_map_attach_offscreen() renders. The session renders it at the map's scale factor.
The fields that mln_offscreen_device_options sets.
| typedef uint32_t mln_offscreen_device_option_fields |
A set of mln_offscreen_device_option_field bits.
| typedef struct mln_offscreen_device_options mln_offscreen_device_options |
Options for mln_offscreen_device_create().
| enum mln_offscreen_device_option_field : uint32_t |
The fields that mln_offscreen_device_options sets.
| Enumerator | |
|---|---|
| MLN_OFFSCREEN_DEVICE_OPTION_ADAPTER_INDEX | |
| MLN_OFFSCREEN_DEVICE_OPTION_SINGLE_CONTEXT | |
| MLN_OFFSCREEN_DEVICE_OPTION_CLIENT_API | |
| mln_status mln_map_attach_offscreen | ( | mln_map | map, |
| const mln_offscreen_descriptor * | descriptor, | ||
| const mln_render_session_attach_options * | options, | ||
| mln_offscreen_device | device, | ||
| mln_render_session * | out_session, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Attaches a render session that renders the map offscreen.
Read each image's pixels with mln_render_session_read_texture().
The session renders on device. When device is null, the session creates a device with the default options, and releases it when the session ends.
Returns:
Completes with:
| mln_status mln_offscreen_device_create | ( | const mln_offscreen_device_options * | options, |
| mln_offscreen_device * | out_device, | ||
| mln_diagnostic * | out_diagnostic ) |
Creates a GPU device for rendering maps offscreen.
mln_map_attach_offscreen() creates a device of its own when it gets none. Create one to share it among the sessions on many maps, or to pick a GPU.
In a browser WebGPU build, attach without a device instead.
Returns:
| void mln_offscreen_device_release | ( | mln_offscreen_device | device | ) |
Releases an offscreen device.
Render sessions on the device keep working until they detach.