2 int n, dx, dy, sx, pp_inc_1, pp_inc_2;
5 #if defined(INTERP_RGB)
9 unsigned int rinc, ginc, binc;
17 if (p1->y > p2->y || (p1->y == p2->y && p1->x > p2->x)) {
24 pp = (PIXEL *) ((
char *) zb->pbuf + zb->linesize * p1->y + p1->x * PSZB);
26 pz = zb->zbuf + (p1->y * sx + p1->x);
41 #define RGBPIXEL *pp = RGB_TO_PIXEL(r >> 8,g >> 8,b >> 8)
44 #define RGBPIXEL *pp = color
51 zz=z >> ZB_POINT_Z_FRAC_BITS; \
59 #define PUTPIXEL() RGBPIXEL
62 #define DRAWLINE(dx,dy,inc_1,inc_2) \
64 ZZ(zinc=(p2->z-p1->z)/n);\
65 RGB(rinc=((p2->r-p1->r) << 8)/n;\
66 ginc=((p2->g-p1->g) << 8)/n;\
67 binc=((p2->b-p1->b) << 8)/n);\
71 pp_inc_1 = (inc_1) * PSZB;\
72 pp_inc_2 = (inc_2) * PSZB;\
76 RGB(r+=rinc;g+=ginc;b+=binc);\
77 if (a>0) { pp=(PIXEL *)((char *)pp + pp_inc_1); ZZ(pz+=(inc_1)); a-=dx; }\
78 else { pp=(PIXEL *)((char *)pp + pp_inc_2); ZZ(pz+=(inc_2)); a+=dy; }\
83 if (dx == 0 && dy == 0) {
87 DRAWLINE(dx, dy, sx + 1, 1);
89 DRAWLINE(dy, dx, sx + 1, sx);
94 DRAWLINE(dx, dy, sx - 1, -1);
96 DRAWLINE(dy, dx, sx - 1, sx);