convert line ends
[canaan.git] / prj / tech / libsrc / g2 / plyparam.h
blob49e2f7a3c340f37be4714cab021ecfabd06e714b
1 // $Header: x:/prj/tech/libsrc/g2/RCS/plyparam.h 1.5 1998/04/28 14:29:16 KEVIN Exp $
3 #ifndef __PLYPARAM_H
4 #define __PLYPARAM_H
6 #include <dev2d.h>
7 #include <plyrast.h>
8 #include <g2spoint.h>
10 #define G2C_NUM_POLY_COORD 8
12 typedef struct g2s_poly_params g2s_poly_params;
14 typedef void (g2il_func)(g2s_raster *r, g2s_poly_params *p);
15 typedef void (g2raster_func)(g2s_poly_params *p, int num_scanlines);
16 typedef void (g2edge_func)(g2s_point *prev, g2s_point *next, g2s_poly_params *p);
17 typedef int (g2poly_func)(int n, g2s_point **ppl);
18 typedef void (g2grad_func)(g2s_point *p0, g2s_point *p1, g2s_point *p2, g2s_poly_params *p);
20 typedef struct g2s_raster_list {
21 union {
22 uchar *bytes;
23 g2s_raster *raster;
25 } g2s_raster_list;
27 typedef struct left_edge {
28 int x,dx;
29 ulong x_frac, dx_frac;
30 fix coord_val[G2C_NUM_POLY_COORD];
31 fix coord_delta[G2C_NUM_POLY_COORD];
32 } left_edge;
34 typedef struct right_edge {
35 fix x,dx;
36 } right_edge;
38 struct g2s_poly_params {
39 g2s_raster_list raster_list;
40 int raster_row;
41 union {
42 uchar *p;
43 int y;
45 union {
46 int canvas_row;
47 int dy;
49 ulong flags;
50 grs_bitmap *bm;
51 union {
52 gdupix_func *pix_func;
53 gdulin_func *hline_func;
55 gdlpix_func *lpix_func;
56 union { // coordinate gradients wrt canvas x (dc/dx)
57 fix dcx[G2C_NUM_POLY_COORD];
58 // first five coords are intensity, texture u, texture v, haze, dryness
59 struct {
60 fix dix, dux, dvx, dhx, ddx;
63 union { // coordinate gradients wrt canvas y (dc/dy)
64 fix dcy[G2C_NUM_POLY_COORD];
65 struct {
66 fix diy, duy, dvy, dhy, ddy;
69 union { // Scale factor for each coordinate; Applied when calculating gradients.
70 float scale[G2C_NUM_POLY_COORD];
71 struct {
72 float i_scale, u_scale, v_scale, h_scale, d_scale;
75 left_edge left;
76 right_edge right;
77 g2il_func *inner_loop;
78 g2raster_func *raster_func;
79 g2edge_func *left_edge_func;
80 g2edge_func *right_edge_func;
81 g2poly_func *poly_func;
82 g2grad_func *grad_func;
83 int clip_type;
84 int ytop, yright, yleft;
87 #endif