ScanLine rasterizer

git-svn-id: svn://ultimatepp.org/upp/trunk@824 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-01-29 11:06:17 +00:00
parent 989a81ecfc
commit 00580386fa
5 changed files with 46 additions and 34 deletions

View file

@ -47,8 +47,15 @@ struct App : TopWindow {
}
*/
Rasterizer r(Size(500, 500));
r.SetClip(RectfC(100, 100, 200, 200));
// r.SetClip(RectfC(100, 100, 200, 200));
#if 1
r.Move( 36.000000, 142.000000);
r.Line(480.000000, 148.000000);
r.Line(429.000000, 148.000000);
r.Line( 36.000000, 142.000000);
#endif
#if 0
r.Move(121.000000, 121.000000);
r.Line(0.000000, 0.000000);
@ -61,23 +68,16 @@ struct App : TopWindow {
r.Line(564.000000, 213.000000);
r.Line(153.000000, 297.000000);
#endif
#if 1
r.Move( 36.000000, 142.000000);
r.Line(480.000000, 148.000000);
r.Line(429.000000, 148.000000);
r.Line( 36.000000, 142.000000);
#endif
#if 0
r.Move(x1, y1);
r.Line(x2, y2);
r.Line(x3, y3);
r.Line(x1, y1);
#endif
for(int y = r.MinY(); y <= r.MaxY(); y++) {
ScanLine sl = r.Get(y);
DUMP(sl);
Apply(ib[y], 400, Blue(), sl);
Apply(ib[y], 500, Blue(), sl);
}
w.DrawRect(GetSize(), White());
@ -86,13 +86,13 @@ struct App : TopWindow {
}
App() {
Sizeable().Zoomable();
x1 = y1 = x2 = y2 = 0;
}
};
GUI_APP_MAIN {
App().Run();
return;
ScanLine a, b, c;
static byte line1[] = { 1, 50, 100, 128, 128, 128, 128, 128, 100, 50, 1 };