Lines Matching defs:context

88 STBRP_DEF int stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects);
128 STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes);
149 STBRP_DEF void stbrp_setup_allow_out_of_mem (stbrp_context *context, int allow_out_of_mem);
155 STBRP_DEF void stbrp_setup_heuristic (stbrp_context *context, int heuristic);
228 STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic)
230 switch (context->init_mode) {
233 context->heuristic = heuristic;
240 STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_out_of_mem)
247 context->align = 1;
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)
270 context->init_mode = STBRP__INIT_skyline;
271 context->heuristic = STBRP_HEURISTIC_Skyline_default;
272 context->free_head = &nodes[0];
273 context->active_head = &context->extra[0];
274 context->width = width;
275 context->height = height;
276 context->num_nodes = num_nodes;
277 stbrp_setup_allow_out_of_mem(context, 0);
280 context->extra[0].x = 0;
281 context->extra[0].y = 0;
282 context->extra[0].next = &context->extra[1];
283 context->extra[1].x = (stbrp_coord) width;
285 context->extra[1].y = (1<<30);
287 context->extra[1].y = 65535;
289 context->extra[1].next = NULL;
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);
454 if (res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) {
460 node = context->free_head;
464 context->free_head = node->next;
485 cur->next = context->free_head;
486 context->free_head = cur;
497 cur = context->active_head;
498 while (cur->x < context->width) {
506 cur = context->active_head;
511 cur = context->free_head;
516 STBRP_ASSERT(count == context->num_nodes+2);
549 STBRP_DEF int stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects)
565 stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h);