|
MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
|
Go to the source code of this file.
Data Structures | |
| struct | mln_metal_owned_texture_descriptor |
| struct | mln_metal_borrowed_texture_descriptor |
| struct | mln_metal_owned_texture_frame |
| struct | mln_vulkan_owned_texture_descriptor |
| struct | mln_vulkan_borrowed_texture_descriptor |
| struct | mln_vulkan_owned_texture_frame |
| struct | mln_opengl_owned_texture_descriptor |
| struct | mln_opengl_borrowed_texture_descriptor |
| struct | mln_opengl_owned_texture_frame |
| struct | mln_texture_image_info |
Public C API declarations for texture render targets.
| mln_status mln_metal_borrowed_texture_attach | ( | mln_map * | map, |
| const mln_metal_borrowed_texture_descriptor * | descriptor, | ||
| mln_render_session ** | out_session ) |
Attaches a Metal caller-owned texture render target to a map.
The map may have at most one live render session. The session and every texture-session call are owner-thread affine to the map owner thread. The session renders into descriptor->texture. The caller owns the texture, keeps it valid until detach or destroy, and synchronizes any use outside this session. On success, *out_session receives a handle the caller destroys with mln_render_session_destroy().
Returns:
| mln_metal_borrowed_texture_descriptor mln_metal_borrowed_texture_descriptor_default | ( | void | ) |
Returns Metal borrowed-texture descriptor defaults for this C API version.
| mln_status mln_metal_owned_texture_acquire_frame | ( | mln_render_session * | session, |
| mln_metal_owned_texture_frame * | out_frame ) |
Acquires the most recently rendered Metal texture frame.
Use this function with sessions created by mln_metal_owned_texture_attach().
The returned texture and device pointers are borrowed and remain valid only until mln_metal_owned_texture_release_frame() is called for the same frame. While acquired, resize, render update, detach, destroy, and a second acquire return MLN_STATUS_INVALID_STATE.
Returns:
| mln_status mln_metal_owned_texture_attach | ( | mln_map * | map, |
| const mln_metal_owned_texture_descriptor * | descriptor, | ||
| mln_render_session ** | out_session ) |
Attaches a Metal texture render target owned by the session to a map.
The map may have at most one live render session. The session and every texture-session call are owner-thread affine to the map owner thread. The session renders into a session-owned texture created on descriptor->context.device. On success, *out_session receives a handle the caller destroys with mln_render_session_destroy().
Returns:
| mln_metal_owned_texture_descriptor mln_metal_owned_texture_descriptor_default | ( | void | ) |
Returns Metal owned-texture descriptor defaults for this C API version.
| mln_status mln_metal_owned_texture_release_frame | ( | mln_render_session * | session, |
| const mln_metal_owned_texture_frame * | frame ) |
Releases a Metal texture frame acquired from a session-owned texture target.
Returns:
| mln_status mln_opengl_borrowed_texture_attach | ( | mln_map * | map, |
| const mln_opengl_borrowed_texture_descriptor * | descriptor, | ||
| mln_render_session ** | out_session ) |
Attaches an OpenGL caller-owned texture render target to a map.
The map may have at most one live render session. The session and every texture-session call are owner-thread affine to the map owner thread. The session renders into descriptor->texture. The caller owns the texture, keeps it valid until detach or destroy, and synchronizes any use outside this session. On success, *out_session receives a handle the caller destroys with mln_render_session_destroy().
Returns:
| mln_opengl_borrowed_texture_descriptor mln_opengl_borrowed_texture_descriptor_default | ( | void | ) |
Returns OpenGL borrowed-texture descriptor defaults for this C API version.
| mln_status mln_opengl_owned_texture_acquire_frame | ( | mln_render_session * | session, |
| mln_opengl_owned_texture_frame * | out_frame ) |
Acquires the most recently rendered OpenGL texture frame.
Use this function with sessions created by mln_opengl_owned_texture_attach().
The returned texture object is borrowed and remains valid only until mln_opengl_owned_texture_release_frame() is called for the same frame. While acquired, resize, render update, detach, destroy, and a second acquire return MLN_STATUS_INVALID_STATE.
Returns:
| mln_status mln_opengl_owned_texture_attach | ( | mln_map * | map, |
| const mln_opengl_owned_texture_descriptor * | descriptor, | ||
| mln_render_session ** | out_session ) |
Attaches an OpenGL texture render target owned by the session to a map.
The map may have at most one live render session. The session and every texture-session call are owner-thread affine to the map owner thread. The session creates an OpenGL texture in a context that shares objects with descriptor->context. Host sampling may use the acquired texture from a context in the same share group after acquire succeeds and before release. On success, *out_session receives a handle the caller destroys with mln_render_session_destroy().
Returns:
| mln_opengl_owned_texture_descriptor mln_opengl_owned_texture_descriptor_default | ( | void | ) |
Returns OpenGL owned-texture descriptor defaults for this C API version.
| mln_status mln_opengl_owned_texture_release_frame | ( | mln_render_session * | session, |
| const mln_opengl_owned_texture_frame * | frame ) |
Releases an OpenGL texture frame acquired from a session-owned texture target.
Returns:
| mln_texture_image_info mln_texture_image_info_default | ( | void | ) |
Returns texture image info defaults for this C API version.
| mln_status mln_texture_read_premultiplied_rgba8 | ( | mln_render_session * | session, |
| uint8_t * | out_data, | ||
| size_t | out_data_capacity, | ||
| mln_texture_image_info * | out_info ) |
Reads the most recently rendered session-owned texture frame into caller-owned storage.
The copied image is premultiplied RGBA8 in physical pixels. The function fills out_info with the required byte length and image layout metadata. When out_data is null or out_data_capacity is too small, out_info is still filled and the function returns MLN_STATUS_INVALID_ARGUMENT.
Returns:
| mln_status mln_vulkan_borrowed_texture_attach | ( | mln_map * | map, |
| const mln_vulkan_borrowed_texture_descriptor * | descriptor, | ||
| mln_render_session ** | out_session ) |
Attaches a Vulkan caller-owned texture render target to a map.
The map may have at most one live render session. The session and every texture-session call are owner-thread affine to the map owner thread. The session renders into descriptor->image through descriptor->image_view. The caller owns the image and view, keeps them valid until detach or destroy, and handles queue-family ownership and synchronization outside this session. On success, *out_session receives a handle the caller destroys with mln_render_session_destroy().
Before each mln_render_session_render_update(), make the image available on descriptor->context.graphics_queue in descriptor->initial_layout and keep it out of concurrent use. The session submits rendering on that queue, waits for the submitted work to finish, and leaves the image in descriptor->final_layout before mln_render_session_render_update() returns.
Returns:
| mln_vulkan_borrowed_texture_descriptor mln_vulkan_borrowed_texture_descriptor_default | ( | void | ) |
Returns Vulkan borrowed-texture descriptor defaults for this C API version.
| mln_status mln_vulkan_owned_texture_acquire_frame | ( | mln_render_session * | session, |
| mln_vulkan_owned_texture_frame * | out_frame ) |
Acquires the most recently rendered Vulkan texture frame.
Use this function with sessions created by mln_vulkan_owned_texture_attach().
The returned image, image view, and device pointers are borrowed and remain valid only until mln_vulkan_owned_texture_release_frame() is called for the same frame. While acquired, resize, render update, detach, destroy, and a second acquire return MLN_STATUS_INVALID_STATE.
Returns:
| mln_status mln_vulkan_owned_texture_attach | ( | mln_map * | map, |
| const mln_vulkan_owned_texture_descriptor * | descriptor, | ||
| mln_render_session ** | out_session ) |
Attaches a Vulkan texture render target owned by the session to a map.
The map may have at most one live render session. The session and every texture-session call are owner-thread affine to the map owner thread. The session renders into a session-owned image created on descriptor->context.device. Vulkan handles are borrowed and must remain valid until detach or destroy. On success, *out_session receives a handle the caller destroys with mln_render_session_destroy().
Returns:
| mln_vulkan_owned_texture_descriptor mln_vulkan_owned_texture_descriptor_default | ( | void | ) |
Returns Vulkan owned-texture descriptor defaults for this C API version.
| mln_status mln_vulkan_owned_texture_release_frame | ( | mln_render_session * | session, |
| const mln_vulkan_owned_texture_frame * | frame ) |
Releases a Vulkan texture frame acquired from a session-owned texture target.
Returns: