logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

generate_optimized_palette - Generates an optimized palette for a bitmap. Allegro game programming

Description

       Generates a 256-color palette suitable for making a reduced color  version  of  the  specified  truecolor
       image.  The  rsvd  parameter  points to a table indicating which colors it is allowed to modify: zero for
       free colors which may be set to whatever the optimiser likes, negative values for reserved  colors  which
       cannot  be  used, and positive values for fixed palette entries that must not be changed, but can be used
       in the optimisation.

Name

       generate_optimized_palette  -  Generates  an  optimized  palette  for  a bitmap. Allegro game programming
       library.

Return Value

       Returns the number of different colors recognised in the provided bitmap, zero if the  bitmap  is  not  a
       truecolor  image  or  there  wasn't enough memory to perform the operation, and negative if there was any
       internal error in the color reduction code.

See Also

generate_332_palette(3alleg4), set_color_depth(3alleg4)

Allegro                                           version 4.4.3              generate_optimized_palette(3alleg4)

Synopsis

#include<allegro.h>intgenerate_optimized_palette(BITMAP*bmp,PALETTEpal,constcharrsvd[PAL_SIZE]);

See Also