|
Blender V4.3
|
Generic array manipulation API. More...
Go to the source code of this file.
Macros | |
| #define | BLI_array_reverse(arr, arr_len) _bli_array_reverse(arr, arr_len, sizeof(*(arr))) |
| #define | BLI_array_wrap(arr, arr_len, dir) _bli_array_wrap(arr, arr_len, sizeof(*(arr)), dir) |
| #define | BLI_array_permute(arr, arr_len, order) _bli_array_permute(arr, arr_len, sizeof(*(arr)), order, NULL) |
| #define | BLI_array_permute_ex(arr, arr_len, order, arr_temp) _bli_array_permute(arr, arr_len, sizeof(*(arr)), order, arr_temp) |
| #define | BLI_array_deduplicate_ordered(arr, arr_len) _bli_array_deduplicate_ordered(arr, arr_len, sizeof(*(arr))) |
| #define | BLI_array_findindex(arr, arr_len, p) _bli_array_findindex(arr, arr_len, sizeof(*(arr)), p) |
| #define | BLI_array_rfindindex(arr, arr_len, p) _bli_array_rfindindex(arr, arr_len, sizeof(*(arr)), p) |
| #define | BLI_array_binary_and(arr, arr_a, arr_b, arr_len) |
| #define | BLI_array_binary_or(arr, arr_a, arr_b, arr_len) |
| #define | BLI_array_iter_span(arr, arr_len, use_wrap, use_delimit_bounds, test_fn, user_data, span_step, r_span_len) |
| #define | BLI_array_is_zeroed(arr, arr_len) _bli_array_is_zeroed(arr, arr_len, sizeof(*(arr))) |
| #define | BLI_array_iter_spiral_square(arr, arr_shape, center, test_fn, user_data) _bli_array_iter_spiral_square(arr, arr_shape, sizeof(*(arr)), center, test_fn, user_data) |
Functions | |
| void | _bli_array_reverse (void *arr_v, uint arr_len, size_t arr_stride) |
| void | _bli_array_wrap (void *arr_v, uint arr_len, size_t arr_stride, int dir) |
| void | _bli_array_permute (void *arr, uint arr_len, size_t arr_stride, const uint *order, void *arr_temp) |
| uint | _bli_array_deduplicate_ordered (void *arr, uint arr_len, size_t arr_stride) |
| int | _bli_array_findindex (const void *arr, uint arr_len, size_t arr_stride, const void *p) |
| int | _bli_array_rfindindex (const void *arr, uint arr_len, size_t arr_stride, const void *p) |
| void | _bli_array_binary_and (void *arr, const void *arr_a, const void *arr_b, uint arr_len, size_t arr_stride) |
| void | _bli_array_binary_or (void *arr, const void *arr_a, const void *arr_b, uint arr_len, size_t arr_stride) |
| bool | _bli_array_iter_span (const void *arr, uint arr_len, size_t arr_stride, bool use_wrap, bool use_delimit_bounds, bool(*test_fn)(const void *arr_item, void *user_data), void *user_data, uint span_step[2], uint *r_span_len) |
| bool | _bli_array_is_zeroed (const void *arr_v, uint arr_len, size_t arr_stride) |
| bool | _bli_array_iter_spiral_square (const void *arr_v, const int arr_shape[2], size_t elem_size, const int center[2], bool(*test_fn)(const void *arr_item, void *user_data), void *user_data) |
Generic array manipulation API.
Definition in file BLI_array_utils.h.
| #define BLI_array_binary_and | ( | arr, | |
| arr_a, | |||
| arr_b, | |||
| arr_len ) |
Definition at line 79 of file BLI_array_utils.h.
| #define BLI_array_binary_or | ( | arr, | |
| arr_a, | |||
| arr_b, | |||
| arr_len ) |
Definition at line 86 of file BLI_array_utils.h.
Referenced by wpaint_stroke_test_start().
| #define BLI_array_deduplicate_ordered | ( | arr, | |
| arr_len ) _bli_array_deduplicate_ordered(arr, arr_len, sizeof(*(arr))) |
Definition at line 57 of file BLI_array_utils.h.
Referenced by ui_block_interaction_begin().
| #define BLI_array_findindex | ( | arr, | |
| arr_len, | |||
| p ) _bli_array_findindex(arr, arr_len, sizeof(*(arr)), p) |
Definition at line 68 of file BLI_array_utils.h.
Referenced by editmesh_partial_update_begin_fn(), gizmo_mesh_extrude_invoke_prepare(), gizmo_modal(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and WIDGETGROUP_gizmo_invoke_prepare().
| #define BLI_array_is_zeroed | ( | arr, | |
| arr_len ) _bli_array_is_zeroed(arr, arr_len, sizeof(*(arr))) |
Definition at line 132 of file BLI_array_utils.h.
Referenced by editmball_from_undomball(), text_undosys_step_encode_init(), text_undosys_step_encode_to_state(), undoarm_from_editarm(), undocurve_from_editcurve(), undocurve_from_paintcurve(), undofont_from_editfont(), undolatt_from_editlatt(), and undomesh_from_editmesh().
| #define BLI_array_iter_span | ( | arr, | |
| arr_len, | |||
| use_wrap, | |||
| use_delimit_bounds, | |||
| test_fn, | |||
| user_data, | |||
| span_step, | |||
| r_span_len ) |
Definition at line 116 of file BLI_array_utils.h.
Referenced by curve_dissolve_exec().
| #define BLI_array_iter_spiral_square | ( | arr, | |
| arr_shape, | |||
| center, | |||
| test_fn, | |||
| user_data ) _bli_array_iter_spiral_square(arr, arr_shape, sizeof(*(arr)), center, test_fn, user_data) |
Definition at line 147 of file BLI_array_utils.h.
Referenced by DRW_select_buffer_find_nearest_to_point(), and ED_view3d_depth_read_cached().
| #define BLI_array_permute | ( | arr, | |
| arr_len, | |||
| order ) _bli_array_permute(arr, arr_len, sizeof(*(arr)), order, NULL) |
Definition at line 44 of file BLI_array_utils.h.
Referenced by BKE_object_material_remap().
| #define BLI_array_permute_ex | ( | arr, | |
| arr_len, | |||
| order, | |||
| arr_temp ) _bli_array_permute(arr, arr_len, sizeof(*(arr)), order, arr_temp) |
Definition at line 46 of file BLI_array_utils.h.
| #define BLI_array_reverse | ( | arr, | |
| arr_len ) _bli_array_reverse(arr, arr_len, sizeof(*(arr))) |
Definition at line 25 of file BLI_array_utils.h.
Referenced by BKE_gpencil_stroke_flip(), TEST(), TEST(), TEST(), TEST(), TEST(), and test_polyfill_template_main().
| #define BLI_array_rfindindex | ( | arr, | |
| arr_len, | |||
| p ) _bli_array_rfindindex(arr, arr_len, sizeof(*(arr)), p) |
| #define BLI_array_wrap | ( | arr, | |
| arr_len, | |||
| dir ) _bli_array_wrap(arr, arr_len, sizeof(*(arr)), dir) |
Definition at line 34 of file BLI_array_utils.h.
| void _bli_array_binary_and | ( | void * | arr, |
| const void * | arr_a, | ||
| const void * | arr_b, | ||
| uint | arr_len, | ||
| size_t | arr_stride ) |
Definition at line 139 of file array_utils.c.
| void _bli_array_binary_or | ( | void * | arr, |
| const void * | arr_a, | ||
| const void * | arr_b, | ||
| uint | arr_len, | ||
| size_t | arr_stride ) |
Definition at line 152 of file array_utils.c.
In-place array de-duplication of an ordered array.
Access via BLI_array_deduplicate_ordered
Definition at line 93 of file array_utils.c.
References POINTER_OFFSET, and UNLIKELY.
Find the first index of an item in an array.
Access via BLI_array_findindex
Definition at line 116 of file array_utils.c.
| bool _bli_array_is_zeroed | ( | const void * | arr_v, |
| uint | arr_len, | ||
| size_t | arr_stride ) |
Simple utility to check memory is zeroed.
Definition at line 275 of file array_utils.c.
| bool _bli_array_iter_span | ( | const void * | arr, |
| uint | arr_len, | ||
| size_t | arr_stride, | ||
| bool | use_wrap, | ||
| bool | use_delimit_bounds, | ||
| bool(* | test_fn )(const void *arr_item, void *user_data), | ||
| void * | user_data, | ||
| uint | span_step[2], | ||
| uint * | r_span_len ) |
Utility function to iterate over contiguous items in an array.
| use_wrap | Detect contiguous ranges across the first/last points. In this case the second index of span_step may be lower than the first, which indicates the values are wrapped. |
| use_delimit_bounds | When false, ranges that defined by the start/end indices are excluded. This option has no effect when use_wrap is enabled. |
| test_fn | Function to test if the item should be included in the range. |
| user_data | User data for test_fn. |
| span_step | Indices to iterate over, initialize both values to the array length to initialize iteration. |
| r_span_len | The length of the span, useful when use_wrap is enabled, where calculating the length isn't a simple subtraction. |
Definition at line 165 of file array_utils.c.
References BLI_assert, NULL, POINTER_OFFSET, and UNLIKELY.
| bool _bli_array_iter_spiral_square | ( | const void * | arr_v, |
| const int | arr_shape[2], | ||
| size_t | elem_size, | ||
| const int | center[2], | ||
| bool(* | test_fn )(const void *arr_item, void *user_data), | ||
| void * | user_data ) |
Smart function to sample a rectangle spiraling outside. Nice for selection ID.
| arr_shape | dimensions [w, h]. |
| center | coordinates [x, y] indicating where to start traversing. |
Definition at line 287 of file array_utils.c.
References BLI_assert, CLAMP, int, max_iiii(), min_iiii(), and steps.
| void _bli_array_permute | ( | void * | arr, |
| uint | arr_len, | ||
| size_t | arr_stride, | ||
| const uint * | order, | ||
| void * | arr_temp ) |
In-place array permute. (re-arrange elements based on an array of indices).
Access via BLI_array_wrap
Definition at line 64 of file array_utils.c.
References BLI_assert, len, MEM_freeN(), MEM_mallocN, NULL, and POINTER_OFFSET.
| void _bli_array_reverse | ( | void * | arr_v, |
| uint | arr_len, | ||
| size_t | arr_stride ) |
In-place array reverse.
Access via BLI_array_reverse
Definition at line 27 of file array_utils.c.
References BLI_array_alloca.
A version of BLI_array_findindex that searches from the end of the list.
Definition at line 127 of file array_utils.c.
In-place array wrap. (rotate the array one step forward or backwards).
Access via BLI_array_wrap
Definition at line 44 of file array_utils.c.
References BLI_array_alloca, and BLI_assert_unreachable.
Referenced by testbuffer_list_state_random_data().