video: remove lowres support, cut "too slow" message
[mplayer.git] / libvo / bitmap_packer.h
blobc7c377cbd08ed1b4dcd7276779ef3dacbc7342dc
1 #ifndef MPLAYER_PACK_RECTANGLES_H
2 #define MPLAYER_PACK_RECTANGLES_H
4 struct pos {
5 int x;
6 int y;
7 };
9 struct bitmap_packer {
10 int w;
11 int h;
12 int w_max;
13 int h_max;
14 int padding;
15 int count;
16 struct pos *in;
17 struct pos *result;
18 int used_width;
19 int used_height;
21 // internal
22 int *scratch;
23 int asize;
26 struct ass_image;
27 struct sub_bitmaps;
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
46 * given image list.
48 int packer_pack_from_subbitmaps(struct bitmap_packer *packer,
49 struct sub_bitmaps *b, int padding_pixels);
51 #endif