masx1996

Untitled

Mar 25th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 20.02 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include "GDI+ image.h"
  4.  
  5. typedef boost::gil::bgr8_pixel_t Pixel;
  6. typedef boost::gil::bgr8_view_t View;
  7. typedef boost::gil::bgr8c_view_t ViewReadOnly;
  8. typedef boost::gil::bgr8_view_t::x_iterator Iterator_X;
  9. typedef boost::gil::bgr8_view_t::y_iterator Iterator_Y;
  10. typedef boost::gil::bgr8_view_t::locator Iterator_XY;
  11.  
  12.  
  13. /// READ ME FIRST
  14. void TheLookAtMeFakeFunction(View& view, const unsigned short& x, const unsigned short& y)
  15. {
  16.     // a View is the access to image's pixels ect.
  17.  
  18.     // pixel access, slow but easy to understand
  19.     view(x, y);
  20.     view(x, y) = Pixel(0, 0, 255); // blue, green, red channels
  21.  
  22.     // pixel access, optimalize for small x/y increments
  23.     Iterator_XY position = view.xy_at(x, y);
  24.     *position = Pixel(0, 0, 255);
  25.     ++position.x();        // point at pixel(x+1, y)
  26.     --position.y();        // point at pixel(x, y-1)
  27.    
  28.     // pixel access, row and column interators
  29.     unsigned int row_number = 0;
  30.     unsigned int column_number = 0;
  31.     Iterator_X itr_x = view.row_begin(row_number);
  32.     Iterator_Y itr_y = view.col_begin(column_number);
  33.  
  34.     // the Windows applications coordinates system is used in this code
  35.     // origin point (0, 0) in the left upper corner
  36.     // do not forget: pixel(b,g,r), full_red(0, 0, 255), bright_red(130, 130, 255)
  37. };
  38.  
  39.  
  40. ////////////////////////////////////////////////////////////////////////////////
  41.  
  42.  
  43. // function declarations, draw line
  44. void AntiAliasingDda(View& view, const unsigned short& x1, const unsigned short& y1,
  45.                      const unsigned short& x2, const unsigned short& y2);
  46. void SymmetricDda(View& view, const unsigned short& x1, const unsigned short& y1,
  47.                   const unsigned short& x2, const unsigned short& y2);
  48. void Bresenhama(View& view,    const unsigned short& x1, const unsigned short& y1,
  49.                 const unsigned short& x2, const unsigned short& y2);
  50. // function declarations, draw circle
  51. void Circle1Div4(View& view, const unsigned short& x1, const unsigned short& y1,
  52.                  const unsigned short& x2, const unsigned short& y2);
  53. void MidpointCircle1(View& view, const unsigned short& x1, const unsigned short& y1,
  54.                      const unsigned short& x2, const unsigned short& y2);
  55. void MidpointCircle2(View& view, const unsigned short& x1, const unsigned short& y1,
  56.                      const unsigned short& x2, const unsigned short& y2);
  57. // function declarations, draw eliphsis
  58. void Ellipsis(View& view, const unsigned short& x1, const unsigned short& y1,
  59.               const unsigned short& a, const unsigned short& b);
  60. // function declarations, flood area
  61. void BoundryFill1Div4(View& view, const unsigned short& x, const unsigned short& y,
  62.                       const Pixel& fill_color, const Pixel& border_color);
  63. void BoundryFill1Div8(View& view, const unsigned short& x, const unsigned short& y,
  64.                       const Pixel& fill_color, const Pixel& border_color);
  65.  
  66.  
  67. ////////////////////////////////////////////////////////////////////////////////
  68.  
  69.  
  70. /// DrawThisLine, function used in WndProc()
  71. void DrawThisLine(View& view,
  72.     const unsigned short& zx1, const unsigned short& zy1,
  73.     const unsigned short& zx2, const unsigned short& zy2)
  74. {
  75.     // NOTE: Pixel(0, 0, 255) is red it's a BGR channel
  76.  
  77.     unsigned short x1, x2, y1, y2 = 0;
  78.  
  79.     if (zx2 < zx1)
  80.     {
  81.         x1 = zx2;
  82.         x2 = zx1;
  83.         y1 = zy2;
  84.         y2 = zy1;
  85.     }
  86.     else
  87.     {
  88.         x1 = zx1;
  89.         x2 = zx2;
  90.         y1 = zy1;
  91.         y2 = zy2;
  92.     }
  93.  
  94.     double m = 0.0;
  95.     if (x2 == x1) {
  96.         m = 1.0;
  97.     }
  98.     else {
  99.         m = (double)(y2 - y1) / (double)(x2 - x1);
  100.     }
  101.  
  102.      double b = y1 - (m*x1);
  103.      double x, y = 0;
  104.  
  105.      const float lower_no_anti_aliasing_tolerance = 0.25f;
  106.      const float higher_no_anti_aliasing_tolerance = 0.75f;
  107.  
  108.      float anti_aliasing_delta = 0.0f;
  109.      unsigned char down_color = 0, up_color = 0;
  110.  
  111.      if (abs(m) > 1)
  112.      {
  113.          if (y2 > y1)
  114.          {
  115.              for (y = y1; y <= y2; y++) {
  116.                  x = (y - b) / m;
  117.  
  118.                  anti_aliasing_delta = x - static_cast<unsigned int>(x);
  119.                  if (anti_aliasing_delta < lower_no_anti_aliasing_tolerance)
  120.                  {
  121.                      view(x, unsigned short(y)) = Pixel(0, 0, 255);        // simplifying down
  122.                  }
  123.                  else if (anti_aliasing_delta > higher_no_anti_aliasing_tolerance)
  124.                  {
  125.                      view(x + 1, unsigned short(y)) = Pixel(0, 0, 255);    // simplifying up
  126.                  }
  127.                  else
  128.                  {
  129.                      down_color = static_cast<unsigned char>(anti_aliasing_delta * 255);
  130.                      up_color = 255 - down_color;
  131.                      view(x, unsigned short(y)) = Pixel(down_color, down_color, 255);
  132.                      view(x +1, unsigned short(y)) = Pixel(up_color, up_color, 255);
  133.                  }
  134.  
  135.                  view(x, y) = Pixel(0, 0, 255);
  136.              }
  137.          }
  138.          else
  139.          {
  140.              for (y = y1; y >= y2; y--) {
  141.                  x = (y - b) / m;
  142.  
  143.                  anti_aliasing_delta = x - static_cast<unsigned int>(x);
  144.                  if (anti_aliasing_delta < lower_no_anti_aliasing_tolerance)
  145.                  {
  146.                      view(x, unsigned short(y)) = Pixel(0, 0, 255);        // simplifying down
  147.                  }
  148.                  else if (anti_aliasing_delta > higher_no_anti_aliasing_tolerance)
  149.                  {
  150.                      view(x + 1, unsigned short(y)) = Pixel(0, 0, 255);    // simplifying up
  151.                  }
  152.                  else
  153.                  {
  154.                      down_color = static_cast<unsigned char>(anti_aliasing_delta * 255);
  155.                      up_color = 255 - down_color;
  156.                      view(x, unsigned short(y)) = Pixel(down_color, down_color, 255);
  157.                      view(x + 1, unsigned short(y)) = Pixel(up_color, up_color, 255);
  158.                  }
  159.                  view(x, y) = Pixel(0, 0, 255);
  160.              }
  161.          }
  162.      }
  163.      else
  164.      {
  165.          for (x = x1; x <= x2; x++) {
  166.  
  167.              y = m*x + b;
  168.  
  169.              anti_aliasing_delta = y - static_cast<unsigned int>(y);
  170.              if (anti_aliasing_delta < lower_no_anti_aliasing_tolerance)
  171.              {
  172.                  view(x, unsigned short(y)) = Pixel(0, 0, 255);        // simplifying down
  173.              }
  174.              else if (anti_aliasing_delta > higher_no_anti_aliasing_tolerance)
  175.              {
  176.                  view(x, unsigned short(y) + 1) = Pixel(0, 0, 255);    // simplifying up
  177.              }
  178.              else
  179.              {
  180.                  down_color = static_cast<unsigned char>(anti_aliasing_delta * 255);
  181.                  up_color = 255 - down_color;
  182.                  view(x, unsigned short(y)) = Pixel(down_color, down_color, 255);
  183.                  view(x, unsigned short(y) + 1) = Pixel(up_color, up_color, 255);
  184.              }
  185.              //view(x, y) = Pixel(0, 0, 255);
  186.          }
  187.      }
  188.  
  189.     //AntiAliasingDda(view, x1, y1, x2, y2);
  190.     //SymmetricDda(view, x1, y1, x2, y2);
  191.     //Bresenhama(view, x1, y1, x2, y2);
  192. }
  193. /// DrawThisCircle, function used in WndProc()
  194. void DrawThisCircle(View& view,
  195.                     const unsigned short& x1, const unsigned short& y1,
  196.                     const unsigned short& x2, const unsigned short& y2)
  197. {
  198.     //Circle1Div4(view, x1, y1, x2, y2);
  199.     //MidpointCircle1(view, x1, y1, x2, y2);
  200.     MidpointCircle2(view, x1, y1, x2, y2);
  201.  
  202.     // fail
  203.     //Ellipsis(view, x1, y1, 50, 35);
  204. };
  205. /// FloodThisArea, function used in WndProc()
  206. void FloodThisArea(View& view, const unsigned short& x, const unsigned short& y)
  207. {
  208.     // NOTE: both works for small areas, due to perhaps filling the heap memory with recurrence calls
  209.  
  210.     //BoundryFill1Div4(view, x, y, Pixel(255, 0, 0), Pixel(0, 0, 255));    // works fine for small circles
  211.     BoundryFill1Div8(view, x, y, Pixel(255, 0, 0), Pixel(0, 0, 255));    // for know reasons ka-boom when circle
  212. };
  213.  
  214. ////////////////////////////////////////////////////////////////////////////////
  215.  
  216.  
  217. //
  218. void AntiAliasingDda(View& view, const unsigned short& x1, const unsigned short& y1,
  219.                      const unsigned short& x2, const unsigned short& y2)
  220. {
  221.     // coordinates variables
  222.     int x = x1;
  223.     float y = y1;
  224.  
  225.     // y = a*x + b, linear function
  226.     const float a = float(y2 - y1) / float(x2 - x1);
  227.  
  228.     const float lower_no_anti_aliasing_tolerance = 0.25f;
  229.     const float higher_no_anti_aliasing_tolerance = 0.75f;
  230.  
  231.     float anti_aliasing_delta_y = 0.0f;
  232.    
  233.  
  234.     unsigned char down_color = 0, up_color = 0;
  235.    
  236.     for (x, y; x < x2; ++x, y += a)
  237.     {
  238.         anti_aliasing_delta_y = y - static_cast<unsigned int>(y);
  239.        
  240.         if (anti_aliasing_delta_y < lower_no_anti_aliasing_tolerance)
  241.         {
  242.             view(x, unsigned short(y)) = Pixel(0, 0, 255);        // simplifying down
  243.         }
  244.         else if (anti_aliasing_delta_y > higher_no_anti_aliasing_tolerance)
  245.         {
  246.             view(x, unsigned short(y)+1) = Pixel(0, 0, 255);    // simplifying up
  247.         }
  248.         else
  249.         {
  250.             down_color = static_cast<unsigned char>(anti_aliasing_delta_y * 255);
  251.             up_color = 255 - down_color;
  252.             view(x, unsigned short(y)) =   Pixel(down_color, down_color, 255);
  253.             view(x, unsigned short(y)+1) = Pixel(up_color, up_color, 255);
  254.         }
  255.     };
  256. }
  257.  
  258. //
  259. void SymmetricDda(View& view, const unsigned short& x1, const unsigned short& y1,
  260.                   const unsigned short& x2, const unsigned short& y2)
  261. {
  262.     short delta_x = x2 - x1;
  263.     short delta_y = y2 - y1;
  264.  
  265.     bool positive_delta_x = delta_x >= 0;
  266.     bool positive_delta_y = delta_y >= 0;
  267.    
  268.     // maximum of two absolute values
  269.     short max_of_deltas = std::abs(delta_x) > std::abs(delta_y) ? std::abs(delta_x) : std::abs(delta_y) ;
  270.  
  271.     // log2(max_of_deltas)
  272.     short n = short(std::logf((float)max_of_deltas) / std::logf(2.0f));
  273.     short pow_2_n = static_cast<short>(std::pow(2.0f, n));
  274.     // the 2^(n-1) case
  275.     if (pow_2_n < max_of_deltas)
  276.     {
  277.         pow_2_n = static_cast<short>(std::pow(2.0f, (++n)));
  278.     };
  279.  
  280.     float epsilon = 1.0f / pow_2_n;
  281.     float increment_x = epsilon * delta_x;
  282.     float increment_y = epsilon * delta_y;
  283.  
  284.     float x = positive_delta_x ? (x1 + 0.5f) : (x1 - 0.5f);
  285.     float y = positive_delta_y ? (y1 + 0.5f) : (y1 - 0.5f);
  286.    
  287.    
  288.     for (;;)    // for is faster then while
  289.     {
  290.         if (x >= view.width() || y >= view.height()  ||
  291.             (positive_delta_x ? (x > x2) : (x < x2)) ||
  292.             (positive_delta_y ? (y > y2) : (y < y2)) )
  293.         {
  294.             break;
  295.         };
  296.  
  297.         // without anti-aliasing
  298.         view(unsigned short(x), unsigned short(y)) = Pixel(0, 0, 255);
  299.        
  300.         x += increment_x;
  301.         y += increment_y;
  302.     }
  303. }
  304.  
  305. //
  306. void Bresenhama(View& view, const unsigned short& x1, const unsigned short& y1,
  307.                 const unsigned short& x2, const unsigned short& y2)
  308. {
  309.     unsigned short delta_x = x2 - x1;
  310.     unsigned short delta_y = y2 - y1;
  311.    
  312.     short delta = 2 * delta_y - delta_x;
  313.  
  314.     short increment_e  = 2 * delta_y;
  315.     short increment_ne = 2 * (delta_y - delta_x);
  316.  
  317.     unsigned short x = x1, y = y1;
  318.     Iterator_XY position = view.xy_at(x, y);
  319.    
  320.     *position = Pixel(0, 0, 255);
  321.  
  322.  
  323.     for (; x < x2 ; ++x, ++position.x())
  324.     {
  325.         if (delta <= 0)
  326.         {
  327.             delta += increment_e;
  328.             //++x; ++position.x();
  329.         }
  330.         else
  331.         {
  332.             delta += increment_ne;
  333.             //++x; ++position.x();
  334.             ++position.y();        // going north, that is south in this coordinate system :)
  335.         };
  336.  
  337.         *position = Pixel(0, 0, 255);
  338.     }
  339. }
  340.  
  341.  
  342. ////////////////////////////////////////////////////////////////////////////////
  343.  
  344.  
  345. // draw 4 pixels
  346. void Draw4Pixels(View& view, const unsigned short& x, const unsigned short& y,
  347.                  const unsigned short& dx, const unsigned short& dy)
  348. {
  349.     unsigned short safet_variable_x, safet_variable_y;
  350.  
  351.     safet_variable_x = x + dx;
  352.     if (safet_variable_x < view.width())
  353.     {
  354.         safet_variable_y = y + dy;
  355.         if (safet_variable_y < view.height())
  356.         {
  357.             view(safet_variable_x, safet_variable_y) = Pixel(0, 0, 255);
  358.         }
  359.         safet_variable_y = y - dy;
  360.         if (safet_variable_y < view.height())
  361.         {
  362.             view(safet_variable_x, safet_variable_y) = Pixel(0, 0, 255);
  363.         }
  364.     }
  365.  
  366.     safet_variable_x = x - dx;
  367.     if (safet_variable_x < view.width())
  368.     {
  369.         safet_variable_y = y + dy;
  370.         if (safet_variable_y < view.height())
  371.         {
  372.             view(safet_variable_x, safet_variable_y) = Pixel(0, 0, 255);
  373.         }
  374.         safet_variable_y = y - dy;
  375.         if (safet_variable_y < view.height())
  376.         {
  377.             view(safet_variable_x, safet_variable_y) = Pixel(0, 0, 255);
  378.         }
  379.     }
  380. }
  381.  
  382. // draw Bresenhama circle 1/4 (old lab task)
  383. void Circle1Div4(View& view, const unsigned short& x1, const unsigned short& y1,
  384.                  const unsigned short& x2, const unsigned short& y2)
  385. {
  386.     const short radius = static_cast<short>(std::sqrt(
  387.                             std::pow(static_cast<float>(x2-x1), 2.0f) +
  388.                             std::pow(static_cast<float>(y2-y1), 2.0f)));
  389.     unsigned short x = 0;
  390.     unsigned short y = radius;
  391.     short delta = 2 - 2*radius;
  392.     short sigma;
  393.    
  394.     for (;;)
  395.     {
  396.         // draw 4 pixels
  397.         Draw4Pixels(view, x1, y1, x, y);
  398.  
  399.         if ((x == radius) && (y == 0))
  400.         {
  401.             break;
  402.         };
  403.  
  404.         //sigma = delta + delta;
  405.         sigma = 2 * delta;
  406.         if (sigma < 0)
  407.         {
  408.             sigma += 2*y - 1;
  409.             if (sigma > 0)    // choice D
  410.             {
  411.                 ++x;
  412.                 --y;
  413.                 delta += 2*(x - y + 1);
  414.             }
  415.             else            // choice H
  416.             {
  417.                 ++x;
  418.                 delta += 2*x + 1;
  419.             }
  420.         }
  421.         else
  422.         {
  423.             sigma += -2*x + 1;
  424.             if (sigma <= 0)    // choise D
  425.             {
  426.                 ++x;
  427.                 --y;
  428.                 delta += 2*(x - y + 1);
  429.             }
  430.             else            // choise V
  431.             {
  432.                 --y;
  433.                 delta += -2*y +1;
  434.             }
  435.         }
  436.     }
  437. }
  438.  
  439. //
  440. void MidpointCircle1(View& view, const unsigned short& x1, const unsigned short& y1,
  441.                      const unsigned short& x2, const unsigned short& y2)
  442. {
  443.     const short radius = static_cast<short>(std::sqrt(
  444.                             std::pow(static_cast<float>(x2-x1), 2.0f) +
  445.                             std::pow(static_cast<float>(y2-y1), 2.0f)));
  446.     unsigned short x = 0;
  447.     unsigned short y = radius;
  448.     short delta = 5 - 4*radius;
  449.  
  450.     Draw4Pixels(view, x1, y1, x, y);    // horizontal
  451.     Draw4Pixels(view, x1, y1, y, x);    // vertical
  452.  
  453.     for (;;)
  454.     {
  455.         if (x > y)
  456.         {
  457.             break;
  458.         }
  459.  
  460.         if (delta < 0)
  461.         {
  462.             delta += 4*(2*x + 3);
  463.         }
  464.         else
  465.         {
  466.             delta += 4*(2*(x - y) + 5);
  467.             --y;
  468.         }
  469.  
  470.         ++x;
  471.         Draw4Pixels(view, x1, y1, x, y);    // horizontal
  472.         Draw4Pixels(view, x1, y1, y, x);    // vertical
  473.     }
  474. }
  475.  
  476. //
  477. void MidpointCircle2(View& view, const unsigned short& x1, const unsigned short& y1,
  478.                     const unsigned short& x2, const unsigned short& y2)
  479. {
  480.     const short radius = static_cast<short>(std::sqrt(
  481.                             std::pow(static_cast<float>(x2-x1), 2.0f) +
  482.                             std::pow(static_cast<float>(y2-y1), 2.0f)));
  483.     unsigned short x = 0;
  484.     unsigned short y = radius;
  485.     short delta = 5 - radius * 4;
  486.     short delta_e = 3 * 4;
  487.     short delta_se = 4*(5 - 2*radius);
  488.  
  489.     Draw4Pixels(view, x1, y1, x, y);    // horizontal
  490.     Draw4Pixels(view, x1, y1, y, x);    // vertical
  491.  
  492.     for (;;)
  493.     {
  494.         if (x >= y)
  495.         {
  496.             break;
  497.         }
  498.  
  499.         if (delta < 0)
  500.         {
  501.             delta    += delta_e;
  502.             delta_e  += 2 * 4;
  503.             delta_se += 2 * 4;
  504.         }
  505.         else
  506.         {
  507.             delta    += delta_se;
  508.             delta_e  += 2 * 4;
  509.             delta_se += 4 * 4;
  510.             --y;
  511.         }
  512.  
  513.         ++x;
  514.         Draw4Pixels(view, x1, y1, x, y);    // horizontal
  515.         Draw4Pixels(view, x1, y1, y, x);    // vertical
  516.     }
  517. }
  518.  
  519.  
  520. ////////////////////////////////////////////////////////////////////////////////
  521.  
  522.  
  523. // TODO correct the code
  524. void Ellipsis(View& view, const unsigned short& x1, const unsigned short& y1,
  525.               const unsigned short& a, const unsigned short& b)
  526. {
  527.     unsigned short x = 0;
  528.     unsigned short y = b;
  529.    
  530.     unsigned short aa = a * a;
  531.     unsigned short bb = b * b;
  532.  
  533.     short delta = 4*bb - 4*b*aa + aa;
  534.     short condition = (aa * aa) / (aa + bb);
  535.  
  536.     Draw4Pixels(view, x1, y1, x, y);    // horizontal
  537.     Draw4Pixels(view, x1, y1, y, x);    // vertical
  538.  
  539.     for (;;)
  540.     {
  541.         if (x*x > condition)
  542.         {
  543.             break;
  544.         }
  545.  
  546.         if (delta < 0)
  547.         {
  548.             delta += 4*(2*x*bb + 3*bb);
  549.         }
  550.         else
  551.         {
  552.             delta += 4*(2*bb*(x - y) + 3*bb + 2*aa);
  553.             //delta += 4*(2*bb*x - 2*aa*y + 3*bb + 2*aa);
  554.             --y;
  555.         }
  556.  
  557.         ++x;
  558.         Draw4Pixels(view, x1, y1, x, y);    // horizontal
  559.         Draw4Pixels(view, x1, y1, y, x);    // vertical
  560.     }
  561.  
  562.     x = 0;
  563.     y = a;
  564.     aa = b * b;
  565.     bb = a * a;
  566.     condition = (bb * bb) / (bb + aa);
  567.  
  568.     Draw4Pixels(view, x1, y1, x, y);    // horizontal
  569.     Draw4Pixels(view, x1, y1, y, x);    // vertical
  570.  
  571.     for (;;)
  572.     {
  573.         if (x*x > condition)
  574.         {
  575.             break;
  576.         }
  577.  
  578.         if (delta < 0)
  579.         {
  580.             delta += 4*(2*x*bb + 3*bb);
  581.         }
  582.         else
  583.         {
  584.             delta += 4*(2*bb*(x - y) + 3*bb + 2*aa);
  585.             //delta += 4*(2*bb*x - 2*aa*y + 3*bb + 2*aa);
  586.             --y;
  587.         }
  588.  
  589.         ++x;
  590.         Draw4Pixels(view, x1, y1, x, y);    // horizontal
  591.         Draw4Pixels(view, x1, y1, y, x);    // vertical
  592.     }
  593. }
  594.  
  595.  
  596. ////////////////////////////////////////////////////////////////////////////////
  597.  
  598.  
  599. // works for small areas, due to perhaps filling the heap memory with recurrence calls
  600. void BoundryFill1Div4(View& view, const unsigned short& x, const unsigned short& y,
  601.                       const Pixel& fill_color, const Pixel& border_color)
  602. {
  603.     Pixel color = view(x, y);
  604.     if ((color != fill_color) && (color != border_color))
  605.     {
  606.         view(x, y) = fill_color;
  607.  
  608.         BoundryFill1Div4(view, x+1, y,   fill_color, border_color);
  609.         BoundryFill1Div4(view, x-1, y,   fill_color, border_color);
  610.         BoundryFill1Div4(view, x,   y+1, fill_color, border_color);
  611.         BoundryFill1Div4(view, x,   y-1, fill_color, border_color);
  612.     }
  613. }
  614.  
  615. // works for small quadratic-like areas, due to perhaps filling the heap memory with recurrence calls
  616. void BoundryFill1Div8(View& view, const unsigned short& x, const unsigned short& y,
  617.                       const Pixel& fill_color, const Pixel& border_color)
  618. {
  619.     // NOTE: the eight neighbourhood implementation is useless when dealing with e.g. circles
  620.  
  621.     Pixel color = view(x, y);
  622.     if ((color != fill_color) && (color != border_color))
  623.     {
  624.         view(x, y) = fill_color;
  625.  
  626.         BoundryFill1Div8(view, x+1, y,   fill_color, border_color);
  627.         BoundryFill1Div8(view, x-1, y,   fill_color, border_color);
  628.         BoundryFill1Div8(view, x,   y+1, fill_color, border_color);
  629.         BoundryFill1Div8(view, x,   y-1, fill_color, border_color);
  630.         BoundryFill1Div8(view, x+1, y+1, fill_color, border_color);
  631.         BoundryFill1Div8(view, x+1, y-1, fill_color, border_color);
  632.         BoundryFill1Div8(view, x-1, y+1, fill_color, border_color);
  633.         BoundryFill1Div8(view, x-1, y-1, fill_color, border_color);
  634.     }
  635. }
Advertisement
Add Comment
Please, Sign In to add comment