1generate_optimized_palette(3) Allegro manual generate_optimized_palette(3)
2
3
4
6 generate_optimized_palette - Generates an optimized palette for a bit‐
7 map. Allegro game programming library.
8
10 #include <allegro.h>
11
12
13 int generate_optimized_palette(BITMAP *bmp, PALETTE pal, const char
14 rsvd[PAL_SIZE]);
15
17 Generates a 256-color palette suitable for making a reduced color ver‐
18 sion of the specified truecolor image. The rsvd parameter points to a
19 table indicating which colors it is allowed to modify: zero for free
20 colors which may be set to whatever the optimiser likes, negative val‐
21 ues for reserved colors which cannot be used, and positive values for
22 fixed palette entries that must not be changed, but can be used in the
23 optimisation.
24
26 Returns the number of different colors recognised in the provided bit‐
27 map, zero if the bitmap is not a truecolor image or there wasn't enough
28 memory to perform the operation, and negative if there was any internal
29 error in the color reduction code.
30
31
33 generate_332_palette(3), set_color_depth(3)
34
35
36
37Allegro version 4.2.2 generate_optimized_palette(3)