56 if (obj_eval->runtime->last_update_transform > last_update) {
82 rcti rect_clamp = *rect;
125 *r_buf_len = buf_len;
146 rcti rect_px = *rect;
152 if (buf ==
nullptr) {
160 const uint *buf_iter = buf;
162 const uint index = *buf_iter - 1;
163 if (index < bitmap_len) {
171 *r_bitmap_len = bitmap_len;
187 rect.
xmin = center[0] - radius;
188 rect.
xmax = center[0] + radius + 1;
189 rect.
ymin = center[1] - radius;
190 rect.
ymax = center[1] + radius + 1;
194 if (buf ==
nullptr) {
202 const uint *buf_iter = buf;
203 const int radius_sq = radius * radius;
204 for (
int yc = -radius; yc <= radius; yc++) {
205 for (
int xc = -radius; xc <= radius; xc++, buf_iter++) {
206 if (xc * xc + yc * yc < radius_sq) {
208 const uint index = *buf_iter - 1;
209 if (index < bitmap_len) {
218 *r_bitmap_len = bitmap_len;
237 }
while (++
x != x_end);
249 rcti rect_px = *rect;
255 if (buf ==
nullptr) {
262 poly_mask_data.
px = buf_mask;
277 const uint *buf_iter = buf;
280 const uint index = *buf_iter - 1;
291 *r_bitmap_len = bitmap_len;
314 rect.
xmin = center[0];
315 rect.
xmax = center[0] + 1;
316 rect.
ymin = center[1];
317 rect.
ymax = center[1] + 1;
341 if (hit_id && hit_id >=
data->id_min && hit_id < data->id_max) {
343 data->val_ptr = value;
344 data->r_index = (hit_id -
data->id_min) + 1;
374 if (buf ==
nullptr) {
378 const int shape[2] = {height, width};
379 const int center_yx[2] = {(height - 1) / 2, (width - 1) / 2};
384 size_t offset = (size_t(
data.val_ptr) - size_t(buf)) /
sizeof(*buf);
385 int hit_x = offset % width;
386 int hit_y = offset / width;
387 *dist =
uint(
abs(hit_y - center_yx[0]) +
abs(hit_x - center_yx[1]));
417 return r_base_index != -1;
423 return r_base_index != -1;
429 return r_base_index != -1;
474 Object *obj = bases[
i]->object;
Generic array manipulation API.
#define BLI_array_iter_spiral_square(arr, arr_shape, center, test_fn, user_data)
#define BLI_BITMAP_NEW(_num, _alloc_string)
#define BLI_BITMAP_TEST(_bitmap, _index)
#define BLI_BITMAP_ENABLE(_bitmap, _index)
void BLI_bitmap_draw_2d_poly_v2i_n(int xmin, int ymin, int xmax, int ymax, blender::Span< blender::int2 > verts, void(*callback)(int x, int x_end, int y, void *), void *user_data)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
bool BLI_rcti_compare(const struct rcti *rect_a, const struct rcti *rect_b)
void BLI_rcti_init_pt_radius(struct rcti *rect, const int xy[2], int size)
bool BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
bool BLI_rcti_is_empty(const struct rcti *rect)
uint64_t DEG_get_update_count(const Depsgraph *depsgraph)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
void DRW_gpu_context_disable()
void DRW_gpu_context_enable()
void DRW_draw_select_id(Depsgraph *depsgraph, ARegion *region, View3D *v3d)
void GPU_framebuffer_restore()
void GPU_framebuffer_read_color(blender::gpu::FrameBuffer *fb, int x, int y, int width, int height, int channels, int slot, eGPUDataFormat data_format, void *r_data)
void GPU_framebuffer_bind(blender::gpu::FrameBuffer *fb)
void GPU_select_buffer_stride_realign(const rcti *src, const rcti *dst, uint *r_buf)
int GPU_texture_height(const blender::gpu::Texture *texture)
int GPU_texture_width(const blender::gpu::Texture *texture)
Read Guarded memory(de)allocation.
BMesh const char void * data
BPy_StructRNA * depsgraph
unsigned long long int uint64_t
Value lookup_default(const Key &key, const Value &default_value) const
ItemIterator items() const &
void reinitialize(const int64_t new_size)
int64_t first_index_of_try(const T &value) const
constexpr int64_t start() const
constexpr bool contains(int64_t value) const
constexpr int64_t size() const
constexpr IndexRange index_range() const
uint * DRW_select_buffer_bitmap_from_rect(Depsgraph *depsgraph, ARegion *region, View3D *v3d, const rcti *rect, uint *r_bitmap_len)
static bool select_buffer_test_fn(const void *__restrict value, void *__restrict userdata)
uint * DRW_select_buffer_bitmap_from_circle(Depsgraph *depsgraph, ARegion *region, View3D *v3d, const int center[2], const int radius, uint *r_bitmap_len)
void DRW_select_buffer_context_create(Depsgraph *depsgraph, const blender::Span< Base * > bases, short select_mode)
uint * DRW_select_buffer_bitmap_from_poly(Depsgraph *depsgraph, ARegion *region, View3D *v3d, const Span< int2 > poly, const rcti *rect, uint *r_bitmap_len)
bool DRW_select_buffer_elem_get(const uint sel_id, uint &r_elem, uint &r_base_index, char &r_elem_type)
uint DRW_select_buffer_sample_point(Depsgraph *depsgraph, ARegion *region, View3D *v3d, const int center[2])
uint DRW_select_buffer_context_offset_for_object_elem(Depsgraph *depsgraph, Object *object, char elem_type)
uint DRW_select_buffer_find_nearest_to_point(Depsgraph *depsgraph, ARegion *region, View3D *v3d, const int center[2], const uint id_min, const uint id_max, uint *dist)
uint * DRW_select_buffer_read(Depsgraph *depsgraph, ARegion *region, View3D *v3d, const rcti *rect, uint *r_buf_len)
static void drw_select_mask_px_cb(int x, int x_end, int y, void *user_data)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
bool is_equal(const MatBase< T, NumCol, NumRow > &a, const MatBase< T, NumCol, NumRow > &b, const T epsilon=T(0))
MatBase< float, 4, 4 > float4x4
VecBase< int32_t, 2 > int2
blender::gpu::Texture * DRW_engine_select_texture_get()
blender::gpu::FrameBuffer * DRW_engine_select_framebuffer_get()
SELECTID_Context * DRW_select_engine_context_get()
blender::IndexRange total
blender::Map< Object *, ElemIndexRanges > elem_ranges
bool is_dirty(Depsgraph *depsgraph, RegionView3D *rv3d)
blender::Vector< Object * > objects
uint64_t depsgraph_last_update
blender::float4x4 persmat