|
Blender
V2.93
|
Go to the source code of this file.
Classes | |
| struct | BoxPack |
| struct | FixedSizeBoxPack |
Typedefs | |
| typedef struct BoxPack | BoxPack |
| typedef struct FixedSizeBoxPack | FixedSizeBoxPack |
Functions | |
| void | BLI_box_pack_2d (BoxPack *boxarray, const unsigned int len, float *r_tot_x, float *r_tot_y) |
| void | BLI_box_pack_2d_fixedarea (struct ListBase *boxes, int width, int height, struct ListBase *packed) |
| typedef struct FixedSizeBoxPack FixedSizeBoxPack |
Main box-packing function accessed from other functions This sets boxes x,y to positive values, sorting from 0,0 outwards. There is no limit to the space boxes may take, only that they will be packed tightly into the lower left hand corner (0,0)
| boxarray | a pre-allocated array of boxes. only the 'box->x' and 'box->y' are set, 'box->w' and 'box->h' are used, 'box->index' is not used at all, the only reason its there is that the box array is sorted by area and programs need to be able to have some way of writing the boxes back to the original data. |
| len | the number of boxes in the array. |
| r_tot_x,r_tot_y | set so you can normalize the data. |
Definition at line 294 of file boxpack_2d.c.
References A, B, BL, BoxVert::blb, BLF, BLI_assert, box_areasort(), VertSortContext::box_height, box_isect(), VertSortContext::box_width, box_xmax_get(), box_xmax_set(), box_xmin_get(), box_xmin_set(), box_ymax_get(), box_ymax_set(), box_ymin_get(), box_ymin_set(), BR, BoxVert::brb, BRF, CORNERFLAGS, EPSILON_MERGE, fabsf, BoxVert::free, BoxPack::h, BoxVert::index, BoxVert::isect_cache, len, MASK, max_ff(), MEM_freeN, MEM_mallocN, NULL, qsort_r, quad_flag(), TL, BoxVert::tlb, TLF, TR, BoxVert::trb, TRF, UNLIKELY, BoxVert::used, BoxPack::v, vert_bias_update(), VertSortContext::vertarray, vertex_sort(), BoxPack::w, BoxPack::x, BoxVert::x, BoxPack::y, and BoxVert::y.
Referenced by ED_uvedit_pack_islands_multi(), M_Geometry_box_pack_2d(), and param_pack().
| void BLI_box_pack_2d_fixedarea | ( | struct ListBase * | boxes, |
| int | width, | ||
| int | height, | ||
| struct ListBase * | packed | ||
| ) |
Definition at line 693 of file boxpack_2d.c.
References BLI_addhead(), BLI_addtail(), BLI_freelistN(), BLI_remlink(), FixedSizeBoxPack::h, height, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, MEM_callocN, MEM_freeN, NULL, FixedSizeBoxPack::w, and width.
Referenced by gpu_texture_create_tile_array().