convert line ends
[canaan.git] / prj / tech / libsrc / dev2d / tluctab.h
blob5c867e2f03eff0f7d93c0542b5e6771681412ebe
1 /*
2 * $Source: x:/prj/tech/libsrc/dev2d/RCS/tluctab.h $
3 * $Revision: 1.4 $
4 * $Author: KEVIN $
5 * $Date: 1997/01/22 12:54:25 $
7 * Declarations and macros for translucency
8 * table generation.
10 * This file is part of the dev2d library.
14 #ifndef _TLUCTAB
15 #define _TLUCTAB
17 #include <grd.h>
18 #include <grmalloc.h>
19 #include <alpha.h>
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
25 extern void gr_init_clut16_vector(ushort *clut16, int color, alpha_vector *opacity, int format);
26 extern void gr_init_clut16(ushort *clut16, int color, alpha_real opacity, int format);
27 extern void gr_init_clut565(ushort *clut16, int color, float opacity);
28 extern void gr_init_clut555(ushort *clut16, int color, float opacity);
30 extern uchar *gr_init_simple_translucency_table(uchar *p, fix opacity, grs_rgb color, uchar *pal);
31 extern uchar *gr_init_translucency_table(uchar *p, fix opacity, fix purity, grs_rgb color);
32 extern uchar *gr_init_lit_translucency_table(uchar *p, fix opacity, fix purity, grs_rgb color, grs_rgb light);
33 extern uchar *gr_init_lit_translucency_tables(uchar *p, fix opacity, fix purity, grs_rgb color, int n);
35 extern int gr_dump_tluc8_table(uchar *buf, int nlit);
36 extern void gr_read_tluc8_table(uchar *buf);
38 #define gr_alloc_translucency_table(n) \
39 ((uchar *)gr_malloc(n*256))
40 #define gr_free_translucency_table(tab) (gr_free(tab))
42 #define gr_make_translucency_table(op, pu, co) \
43 (gr_init_translucency_table(gr_alloc_translucency_table(1), op, pu, co))
44 #define gr_make_lit_translucency_table(op, pu, co, li) \
45 (gr_init_translucency_table(gr_alloc_translucency_table(1), op, pu, co, li))
46 #define gr_make_lit_translucency_tables(op, pu, co, lnum) \
47 (gr_init_lit_translucency_tables(gr_alloc_translucency_table(lnum), op, pu, co, lnum))
49 #define gr_make_tluc8_table(num, op, pu, co) \
50 (tluc8tab[num]=gr_make_translucency_table(op, pu, co))
51 #define gr_make_lit_tluc8_table(num, op, pu, co, li) \
52 (tluc8ltab[num]=gr_make_lit_translucency_tables(op, pu, co, li), \
53 gr_make_tluc8_table(num, op, pu, co))
54 #define gr_alloc_tluc8_spoly_table(num) \
55 (tluc8nstab=num, tluc8stab=gr_alloc_translucency_table(num))
56 #define gr_init_tluc8_spoly_table(num, op, pu, co, li) \
57 (gr_init_lit_translucency_table(tluc8stab+(256*num), op, pu, co, li))
58 #define gr_init_tluc8_spoly_tables(num, op, pu, co, li) \
59 (gr_init_lit_translucency_tables(tluc8stab+(256*num), op, pu, co, li))
60 #define gr_bind_tluc8_table(num, p) (tluc8tab[num]=p)
61 #define gr_bind_lit_tluc8_table(num, p) (tluc8ltab[num]=p)
62 #define gr_bind_tluc8_spoly_table(p) (tluc8stab=p)
64 #ifdef __cplusplus
66 #endif
67 #endif