GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
create_color_table(3) Allegro manual create_color_table(3)

create_color_table - Fills a color mapping table for customised effects. Allegro game programming library.

#include <allegro.h>

void create_color_table(COLOR_MAP *table, const PALETTE pal, void (*blend)(PALETTE pal, int x, int y, RGB *rgb), void (*callback)(int pos));

Fills the specified color mapping table with lookup data for doing customised effects with the specified palette, calling the blend function to determine the results of each color combination.

Your blend routine will be passed a pointer to the palette and the two indices of the colors which are to be combined, and should fill in the RGB structure with the desired result in 0-63 format. Allegro will then search the palette for the closest match to the RGB color that you requested, so it doesn't matter if the palette has no exact match for this color.

If the callback function is not NULL, it will be called 256 times during the calculation, allowing you to display a progress indicator. Example:

   COLOR_MAP greyscale_table;
   ...
   void return_grey_color(const PALETTE pal,
                          int x, int y, RGB *rgb)
   {
      ...
   }
   ...
      /* Build a color lookup table for greyscale effect. */
      create_color_table(&greyscale_table, pal,
                         return_grey_color, NULL);

color_map(3), create_light_table(3), create_trans_table(3), create_blender_table(3), draw_trans_sprite(3), draw_lit_sprite(3), draw_gouraud_sprite(3), rgb_map(3), excolmap(3)
version 4.4.3 Allegro

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.