summaryrefslogtreecommitdiff
path: root/graymap_alleg.h
blob: 87a35e73aaea09f4ec2aef71dc430885a46cdf69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef _graymap_alleg_h_
#define _graymap_alleg_h_

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @file graymap_alleg.h
 * 
 * This header file conatins a function to render graymaps to allegro 4 bitmaps.
 */
#include <allegro.h>
#include "graymap.h"

/**
 * Render a graymap to a allegro 4 bitmap.
 *
 * A palette is represented by two arrays. One array contains colors, the other
 * one contains the corresponding grayscale values. This palette now represents
 * a color gradient. The color which fits to the grayscale value will be
 * returned.
 *
 * @param canvas The allegro 4 bitmap.
 * @param gm The graymap.
 * @param pal_cols Array of colors.
 * @param pal_grays Array of grayscale values
 * @param pal_n length of the arrays.
 */
extern void render_graymap_alleg(BITMAP* canvas, graymap_t* gm,
 color_t* pal_cols, double* pal_grays, int pal_n);

#ifdef __cplusplus
}
#endif

#endif