MCPcopy Create free account
hub / github.com/CruiserOne/Astrolog / DrawPointDither

Function DrawPointDither

xcharts2.cpp:1526–1546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1524// monochrome mode.
1525
1526void DrawPointDither(Bitmap *b, int x, int y, int k, int kmax)
1527{
1528 int m, n;
1529 flag f;
1530 KI ki;
1531
1532 if (kmax <= 1) {
1533 f = (k > 0);
1534 } else if (kmax == 2) {
1535 m = x&1; n = y&1;
1536 f = (k > n*2 + m);
1537 } else {
1538 m = x%3; n = y%3;
1539 f = (k > n*3 + m);
1540 }
1541 if (b != NULL) {
1542 ki = f ? gi.kiOn : gi.kiOff;
1543 BmpSetXY(b, x, y, KvFromKi(ki));
1544 } else if (f)
1545 DrawPoint(x, y);
1546}
1547
1548
1549// Draw a chart showing visibility above the horizon for 1-3 planets. This

Callers 1

XChartRisingFunction · 0.85

Calls 2

BmpSetXYFunction · 0.85
DrawPointFunction · 0.85

Tested by

no test coverage detected