Blender V5.0
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
10
11#include <stdbool.h>
12
13struct ListBase;
14
15/* Box Packer */
16
17typedef struct BoxPack {
18 float x;
19 float y;
20 float w;
21 float h;
22
23 /* Verts this box uses
24 * (BL,TR,TL,BR) / 0,1,2,3 */
25 struct BoxVert *v[4];
26
27 int index;
29
46 BoxPack *boxarray, unsigned int len, bool sort_boxes, float *r_tot_x, float *r_tot_y);
47
48typedef struct FixedSizeBoxPack {
50 int x, y;
51 int w, h;
53
69void BLI_box_pack_2d_fixedarea(struct ListBase *boxes,
70 int width,
71 int height,
72 struct ListBase *packed);
void BLI_box_pack_2d_fixedarea(struct ListBase *boxes, int width, int height, struct ListBase *packed)
void BLI_box_pack_2d(BoxPack *boxarray, unsigned int len, bool sort_boxes, float *r_tot_x, float *r_tot_y)
#define packed
struct BoxVert * v[4]
struct FixedSizeBoxPack * next
struct FixedSizeBoxPack * prev
uint len