|
MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
|
Go to the source code of this file.
Data Structures | |
| struct | mln_style_expression_type |
| struct | mln_style_expression_options |
| struct | mln_style_expression_inputs |
| struct | mln_style_expression_info |
Typedefs | |
| typedef enum mln_style_expression_type_kind | mln_style_expression_type_kind |
| typedef struct mln_style_expression_type | mln_style_expression_type |
| typedef enum mln_style_expression_option_field | mln_style_expression_option_field |
| typedef uint32_t | mln_style_expression_option_fields |
| typedef struct mln_style_expression_options | mln_style_expression_options |
| typedef enum mln_style_expression_input_field | mln_style_expression_input_field |
| typedef uint32_t | mln_style_expression_input_fields |
| typedef struct mln_style_expression_inputs | mln_style_expression_inputs |
| typedef struct mln_style_expression_info | mln_style_expression_info |
Enumerations | |
| enum | mln_style_expression_type_kind : uint32_t { MLN_STYLE_EXPRESSION_TYPE_VALUE = 0 , MLN_STYLE_EXPRESSION_TYPE_NUMBER = 1 , MLN_STYLE_EXPRESSION_TYPE_STRING = 2 , MLN_STYLE_EXPRESSION_TYPE_BOOLEAN = 3 , MLN_STYLE_EXPRESSION_TYPE_COLOR = 4 , MLN_STYLE_EXPRESSION_TYPE_OBJECT = 5 , MLN_STYLE_EXPRESSION_TYPE_FORMATTED = 6 , MLN_STYLE_EXPRESSION_TYPE_IMAGE = 7 , MLN_STYLE_EXPRESSION_TYPE_PADDING = 8 , MLN_STYLE_EXPRESSION_TYPE_VARIABLE_ANCHOR_OFFSET_COLLECTION = 9 , MLN_STYLE_EXPRESSION_TYPE_ARRAY = 10 } |
| enum | mln_style_expression_option_field : uint32_t { MLN_STYLE_EXPRESSION_OPTION_EXPECTED_TYPE = 1U << 0U } |
| enum | mln_style_expression_input_field : uint32_t { MLN_STYLE_EXPRESSION_INPUT_ZOOM = 1U << 0U , MLN_STYLE_EXPRESSION_INPUT_COLOR_RAMP_PARAMETER = 1U << 1U , MLN_STYLE_EXPRESSION_INPUT_CANONICAL_TILE_ID = 1U << 3U } |
Functions | |
| mln_status | mln_style_expression_create (mln_buffer_view expression, const mln_style_expression_options *options, mln_style_expression *out_expression, mln_diagnostic *out_diagnostic) |
| void | mln_style_expression_release (mln_style_expression expression) |
| mln_status | mln_style_expression_get_info (mln_style_expression expression, mln_style_expression_info *out_info, mln_diagnostic *out_diagnostic) |
| mln_status | mln_style_expression_evaluate (mln_style_expression expression, const mln_style_expression_inputs *inputs, char *out_json, size_t json_capacity, size_t *out_json_length, mln_diagnostic *out_diagnostic) |
Parse and evaluate style expressions without a map.
| typedef struct mln_style_expression_info mln_style_expression_info |
What a style expression's result depends on.
The fields that mln_style_expression_inputs sets.
| typedef uint32_t mln_style_expression_input_fields |
A set of mln_style_expression_input_field bits.
| typedef struct mln_style_expression_inputs mln_style_expression_inputs |
The inputs that a style expression reads while it evaluates.
The fields that mln_style_expression_options sets.
| typedef uint32_t mln_style_expression_option_fields |
A set of mln_style_expression_option_field bits.
| typedef struct mln_style_expression_options mln_style_expression_options |
Options for parsing a style expression.
| typedef struct mln_style_expression_type mln_style_expression_type |
The type of a style expression's result.
The type of a style expression's result, or of the items of an array result.
| enum mln_style_expression_input_field : uint32_t |
The fields that mln_style_expression_inputs sets.
| Enumerator | |
|---|---|
| MLN_STYLE_EXPRESSION_INPUT_ZOOM | |
| MLN_STYLE_EXPRESSION_INPUT_COLOR_RAMP_PARAMETER | |
| MLN_STYLE_EXPRESSION_INPUT_CANONICAL_TILE_ID | |
| enum mln_style_expression_option_field : uint32_t |
The fields that mln_style_expression_options sets.
| Enumerator | |
|---|---|
| MLN_STYLE_EXPRESSION_OPTION_EXPECTED_TYPE | |
| enum mln_style_expression_type_kind : uint32_t |
The type of a style expression's result, or of the items of an array result.
| mln_status mln_style_expression_create | ( | mln_buffer_view | expression, |
| const mln_style_expression_options * | options, | ||
| mln_style_expression * | out_expression, | ||
| mln_diagnostic * | out_diagnostic ) |
Parses a style expression to evaluate without a map.
Returns:
| mln_status mln_style_expression_evaluate | ( | mln_style_expression | expression, |
| const mln_style_expression_inputs * | inputs, | ||
| char * | out_json, | ||
| size_t | json_capacity, | ||
| size_t * | out_json_length, | ||
| mln_diagnostic * | out_diagnostic ) |
Evaluates a style expression and writes its result as JSON.
A number in the result that isn't finite becomes null. A color is ["rgba", r, g, b, a], with red, green, and blue from 0 to 255 and alpha from 0 to 1, each exact only to single precision. Formatted text is a ["format", …] expression, an image is {"name": …, "available": …}, padding is [top, right, bottom, left], and a variable anchor offset is [anchor, [x, y], …].
Returns:
Lifetimes: The function writes the result and a terminating NUL to out_json only when json_capacity is greater than the result's length. It always sets out_json_length to the length without the NUL.
| mln_status mln_style_expression_get_info | ( | mln_style_expression | expression, |
| mln_style_expression_info * | out_info, | ||
| mln_diagnostic * | out_diagnostic ) |
Reads what a style expression's result depends on.
| void mln_style_expression_release | ( | mln_style_expression | expression | ) |
Releases a parsed style expression.