Lines Matching refs:context

100 STBRP_DEF int stbrp_pack_rects(stbrp_context * context, stbrp_rect * rects, int num_rects);
138 STBRP_DEF void stbrp_init_target(stbrp_context * context, int width, int height, stbrp_node * nodes…
159 STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context * context, int allow_out_of_mem);
164 STBRP_DEF void stbrp_setup_heuristic(stbrp_context * context, int heuristic);
231 STBRP_DEF void stbrp_setup_heuristic(stbrp_context * context, int heuristic) in stbrp_setup_heuristic() argument
233 switch(context->init_mode) { in stbrp_setup_heuristic()
236 context->heuristic = heuristic; in stbrp_setup_heuristic()
243 STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context * context, int allow_out_of_mem) in stbrp_setup_allow_out_of_mem() argument
250 context->align = 1; in stbrp_setup_allow_out_of_mem()
259 context->align = (context->width + context->num_nodes - 1) / context->num_nodes; in stbrp_setup_allow_out_of_mem()
263 STBRP_DEF void stbrp_init_target(stbrp_context * context, int width, int height, stbrp_node * nodes… in stbrp_init_target() argument
270 context->init_mode = STBRP__INIT_skyline; in stbrp_init_target()
271 context->heuristic = STBRP_HEURISTIC_Skyline_default; in stbrp_init_target()
272 context->free_head = &nodes[0]; in stbrp_init_target()
273 context->active_head = &context->extra[0]; in stbrp_init_target()
274 context->width = width; in stbrp_init_target()
275 context->height = height; in stbrp_init_target()
276 context->num_nodes = num_nodes; in stbrp_init_target()
277 stbrp_setup_allow_out_of_mem(context, 0); in stbrp_init_target()
280 context->extra[0].x = 0; in stbrp_init_target()
281 context->extra[0].y = 0; in stbrp_init_target()
282 context->extra[0].next = &context->extra[1]; in stbrp_init_target()
283 context->extra[1].x = (stbrp_coord) width; in stbrp_init_target()
284 context->extra[1].y = (1 << 30); in stbrp_init_target()
285 context->extra[1].next = NULL; in stbrp_init_target()
448 static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context * context, int width, int heig… in stbrp__skyline_pack_rectangle() argument
451 stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height); in stbrp__skyline_pack_rectangle()
458 if(res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) { in stbrp__skyline_pack_rectangle()
464 node = context->free_head; in stbrp__skyline_pack_rectangle()
468 context->free_head = node->next; in stbrp__skyline_pack_rectangle()
490 cur->next = context->free_head; in stbrp__skyline_pack_rectangle()
491 context->free_head = cur; in stbrp__skyline_pack_rectangle()
502 cur = context->active_head; in stbrp__skyline_pack_rectangle()
503 while(cur->x < context->width) { in stbrp__skyline_pack_rectangle()
511 cur = context->active_head; in stbrp__skyline_pack_rectangle()
516 cur = context->free_head; in stbrp__skyline_pack_rectangle()
521 STBRP_ASSERT(count == context->num_nodes + 2); in stbrp__skyline_pack_rectangle()
546 STBRP_DEF int stbrp_pack_rects(stbrp_context * context, stbrp_rect * rects, int num_rects) in stbrp_pack_rects() argument
563 stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h); in stbrp_pack_rects()