93#define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2) { \
102 incr1 = -2 * dx + 2 * (dy) * m1; \
103 incr2 = -2 * dx + 2 * (dy) * m; \
104 d = 2 * m * (dy) - 2 * dx - 2 * (dy); \
108 incr1 = 2 * dx - 2 * (dy) * m1; \
109 incr2 = 2 * dx - 2 * (dy) * m; \
110 d = -2 * m * (dy) + 2 * dx; \
115#define BRESINCRPGON(d, minval, m, m1, incr1, incr2) { \
153#define BRESINITPGONSTRUCT(dmaj, min1, min2, bres) \
154 BRESINITPGON(dmaj, min1, min2, bres.minor_axis, bres.d, \
155 bres.m, bres.m1, bres.incr1, bres.incr2)
157#define BRESINCRPGONSTRUCT(bres) \
158 BRESINCRPGON(bres.d, bres.minor_axis, bres.m, bres.m1, bres.incr1, bres.incr2)
211#define COUNTERCLOCKWISE -1
242#define SLLSPERBLOCK 25
264#define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET) { \
265 if (pAET->ymax == y) { \
266 pPrevAET->next = pAET->next; \
267 pAET = pPrevAET->next; \
270 pAET->back = pPrevAET; \
273 BRESINCRPGONSTRUCT(pAET->bres); \
287#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y) { \
288 if (pAET->ymax == y) { \
289 pPrevAET->next = pAET->next; \
290 pAET = pPrevAET->next; \
292 pAET->back = pPrevAET; \
295 BRESINCRPGONSTRUCT(pAET->bres); \
301#define LARGE_COORDINATE 1000000
302#define SMALL_COORDINATE -LARGE_COORDINATE
321 pSLL = pPrevSLL->
next;
322 while (pSLL && (pSLL->
scanline < scanline)) {
330 if ((!pSLL) || (pSLL->
scanline > scanline)) {
333 (*SLLBlock)->
next = tmpSLLBlock;
335 *SLLBlock = tmpSLLBlock;
338 pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]);
342 pPrevSLL->
next = pSLL;
393 if (count < 2)
return;
411 PrevPt = &pts[count-1];
424 if (PrevPt->
fY > CurrPt->
fY) {
425 bottom = PrevPt, top = CurrPt;
428 bottom = CurrPt, top = PrevPt;
435 if (bottom->
fY != top->
fY) {
436 pETEs->
ymax = bottom->
fY-1;
441 dy = bottom->
fY - top->
fY;
476 ETEs->
back = pPrevAET;
477 pPrevAET->
next = ETEs;
503 pETEchase = pETEchase->
back;
507 if (pETEchase != pETEinsert) {
508 pETEchaseBackTMP = pETEchase->
back;
513 pETEinsert->
next = pETEchase;
515 pETEchase->
back = pETEinsert;
516 pETEinsert->
back = pETEchaseBackTMP;
531 tmpSLLBlock = pSLLBlock->
next;
533 pSLLBlock = tmpSLLBlock;
struct _EdgeTableEntry EdgeTableEntry
struct _ScanLineListBlock ScanLineListBlock
struct _ScanLineList ScanLineList
static int InsertionSort(EdgeTableEntry *AET)
static void loadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs)
#define BRESINITPGONSTRUCT(dmaj, min1, min2, bres)
static void FreeStorage(ScanLineListBlock *pSLLBlock)
static void InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, ScanLineListBlock **SLLBlock, int *iSLLBlock)
static void CreateETandAET(int count, TPoint *pts, EdgeTable *ET, EdgeTableEntry *AET, EdgeTableEntry *pETEs, ScanLineListBlock *pSLLBlock)
struct _EdgeTableEntry * next
struct _EdgeTableEntry * back
struct _EdgeTableEntry * nextWETE
struct _ScanLineListBlock * next
EdgeTableEntry * edgelist
struct _ScanLineList * next