1 #ifndef MPLAYER_PACK_RECTANGLES_H
2 #define MPLAYER_PACK_RECTANGLES_H
29 /* Reallocate packer->in for at least to desired number of items.
30 * Also sets packer->count to the same value.
32 void packer_set_size(struct bitmap_packer
*packer
, int size
);
34 /* To use this, set packer->count to number of rectangles, w_max and h_max
35 * to maximum output rectangle size, and w and h to start size (may be 0).
36 * Write input sizes in packer->in.
37 * Resulting packing will be written in packer->result.
38 * w and h will be increased if necessary for successful packing.
39 * Return value is -1 if packing failed because w and h were set to max
40 * values but that wasn't enough, 1 if w or h was increased, and 0 otherwise.
42 int packer_pack(struct bitmap_packer
*packer
);
44 /* Like above, but packer->count will be automatically set and
45 * packer->in will be reallocated if needed and filled from the
48 int packer_pack_from_subbitmaps(struct bitmap_packer
*packer
,
49 struct sub_bitmaps
*b
, int padding_pixels
);