From 69d5950f2cbd81e5f6e8d3c8c203ed06ce9c4652 Mon Sep 17 00:00:00 2001 From: Xi Xu Date: Tue, 1 Oct 2024 21:28:13 +0800 Subject: [PATCH] Update Fill.cpp --- NationalFlag/NationalFlag/Fill.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/NationalFlag/NationalFlag/Fill.cpp b/NationalFlag/NationalFlag/Fill.cpp index e42299b..3604720 100644 --- a/NationalFlag/NationalFlag/Fill.cpp +++ b/NationalFlag/NationalFlag/Fill.cpp @@ -142,19 +142,15 @@ void CFill::Gouraud(CDC *pDC) { } BOOL bInFlag = FALSE; double xb, xe; - CRGB cb, ce, c; for (pT1 = pHeadE; pT1 != NULL; pT1 = pT1->pNext) { if (FALSE == bInFlag) { xb = pT1->x; - cb = LinearDifferential(pT1->ps.y, pCurrentB->ScanLine, pT1->pe.y, pT1->ps.c, pT1->pe.c); bInFlag = TRUE; } else { xe = pT1->x; - ce = LinearDifferential(pT1->ps.y, pCurrentB->ScanLine, pT1->pe.y, pT1->ps.c, pT1->pe.c); for (double x = xb; x < xe; x++) { - c = LinearDifferential(xb, x, xe, cb, ce); - pDC->SetPixelV(ROUND(x), pCurrentB->ScanLine, RGB(c.red * 255, c.green * 255, c.blue * 255)); + pDC->SetPixelV(ROUND(x), pCurrentB->ScanLine, RGB(255, 255, 0)); } bInFlag = FALSE; } @@ -232,11 +228,3 @@ void CFill::DeleteAETChain(CAET *pAET) { pAET = pAETTemp; } } - -CRGB CFill::LinearDifferential(double y0, double y, double y1, CRGB c0, CRGB c1) { - CRGB c; - double t; - t = (y - y0) / (y1 - y0); - c = (1 - t) * c0 + t * c1; - return c; -}