Blender V4.3
BLI_boxpack_2d.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15struct ListBase;
16
17/* Box Packer */
18
19typedef struct BoxPack {
20 float x;
21 float y;
22 float w;
23 float h;
24
25 /* Verts this box uses
26 * (BL,TR,TL,BR) / 0,1,2,3 */
27 struct BoxVert *v[4];
28
29 int index;
31
48 BoxPack *boxarray, unsigned int len, bool sort_boxes, float *r_tot_x, float *r_tot_y);
49
50typedef struct FixedSizeBoxPack {
52 int x, y;
53 int w, h;
55
71void BLI_box_pack_2d_fixedarea(struct ListBase *boxes,
72 int width,
73 int height,
74 struct ListBase *packed);
75
76#ifdef __cplusplus
77}
78#endif
void BLI_box_pack_2d_fixedarea(struct ListBase *boxes, int width, int height, struct ListBase *packed)
Definition boxpack_2d.c:663
struct FixedSizeBoxPack FixedSizeBoxPack
void BLI_box_pack_2d(BoxPack *boxarray, unsigned int len, bool sort_boxes, float *r_tot_x, float *r_tot_y)
Definition boxpack_2d.c:271
struct BoxPack BoxPack
int len
struct BoxVert * v[4]
struct FixedSizeBoxPack * next
struct FixedSizeBoxPack * prev