LCOV - code coverage report
Current view: top level - src/Display - DisplayInterface.cpp (source / functions) Hit Total Coverage
Test: e224b347cd670555e44f06608ac41bd1ace9d9d8 Lines: 0 43 0.0 %
Date: 2020-09-08 17:44:46 Functions: 0 5 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #include "DisplayInterface.hpp"
       2             : 
       3             : BEGIN_CS_NAMESPACE
       4             : 
       5             : DoublyLinkedList<DisplayInterface> DisplayInterface::elements;
       6             : 
       7           0 : void DisplayInterface::begin() {
       8           0 :     clear();
       9           0 :     drawBackground();
      10           0 :     display();
      11           0 : }
      12             : 
      13           0 : void DisplayInterface::fillRect(int16_t x, int16_t y, int16_t w, int16_t h,
      14             :                                 uint16_t color) {
      15           0 :     for (int16_t r = y; r < y + h; r++)
      16           0 :         drawFastHLine(x, r, w, color);
      17           0 : }
      18             : 
      19           0 : void DisplayInterface::drawCircle(int16_t x0, int16_t y0, int16_t r,
      20             :                                   uint16_t color) {
      21           0 :     int x = r;
      22           0 :     int y = 0;
      23           0 :     int err = 0;
      24             : 
      25           0 :     while (x >= y) {
      26           0 :         drawPixel(x0 + x, y0 + y, color);
      27           0 :         drawPixel(x0 + y, y0 + x, color);
      28           0 :         drawPixel(x0 - y, y0 + x, color);
      29           0 :         drawPixel(x0 - x, y0 + y, color);
      30           0 :         drawPixel(x0 - x, y0 - y, color);
      31           0 :         drawPixel(x0 - y, y0 - x, color);
      32           0 :         drawPixel(x0 + y, y0 - x, color);
      33           0 :         drawPixel(x0 + x, y0 - y, color);
      34             : 
      35           0 :         if (err <= 0)
      36           0 :             err += 2 * ++y + 1;
      37             :         else
      38           0 :             err -= 2 * --x + 1;
      39             :     }
      40           0 : }
      41             : 
      42           0 : void DisplayInterface::fillCircle(int16_t x0, int16_t y0, int16_t r,
      43             :                                   uint16_t color) {
      44           0 :     int x = r;
      45           0 :     int y = 0;
      46           0 :     int err = 0;
      47             : 
      48           0 :     while (x >= y) {
      49           0 :         drawFastHLine(x0 - x, y0 + y, 2 * x, color);
      50           0 :         drawFastHLine(x0 - y, y0 + x, 2 * y, color);
      51           0 :         drawFastHLine(x0 - y, y0 - x, 2 * y, color);
      52           0 :         drawFastHLine(x0 - x, y0 - y, 2 * x, color);
      53             : 
      54           0 :         if (err <= 0)
      55           0 :             err += 2 * ++y + 1;
      56             :         else
      57           0 :             err -= 2 * --x + 1;
      58             :     }
      59           0 : }
      60             : 
      61           0 : void DisplayInterface::beginAll() {
      62           0 :     for (DisplayInterface &el : elements)
      63           0 :         el.begin();
      64           0 : }
      65             : 
      66             : END_CS_NAMESPACE

Generated by: LCOV version 1.14-6-g40580cd