Lines Matching defs:width

128 STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes);
130 // pack a rectangle that is 'width' by 'height' in dimensions
140 // 1. make sure 'num_nodes' >= 'width'
181 int width;
189 stbrp_node extra[2]; // we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2'
252 // I.e. num_nodes * align >= width
253 // align >= width / num_nodes
254 // align = ceil(width/num_nodes)
256 context->align = (context->width + context->num_nodes-1) / context->num_nodes;
260 STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes)
264 STBRP_ASSERT(width <= 0xffff && height <= 0xffff);
274 context->width = width;
279 // node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly)
283 context->extra[1].x = (stbrp_coord) width;
293 static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0, int width, int *pwaste)
296 int x1 = x0 + width;
331 if (under_width + visited_width > width)
332 under_width = width - visited_width;
349 static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int width, int height)
356 width = (width + c->align - 1);
357 width -= width % c->align;
358 STBRP_ASSERT(width % c->align == 0);
362 while (node->x + width <= c->width) {
364 y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste);
410 while (tail->x < width)
413 int xpos = tail->x - width;
422 y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste);
444 static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, int width, int height)
447 stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height);
482 while (cur->next && cur->next->x <= res.x + width) {
493 if (cur->x < res.x + width)
494 cur->x = (stbrp_coord) (res.x + width);
498 while (cur->x < context->width) {