Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.42 KB | None | 0 0
  1. int x = border.first;
  2.     while (x < border.second) {
  3.         bool fl = false;
  4.         while (true) {
  5.             b = img.pixel(x, y);
  6.             c.setRgb(b);
  7.             if (c != edgeColor && c != fillColor && x < border.second) {
  8.                 fl = true;
  9.                 ++x;
  10.             } else {
  11.                 break;
  12.             }
  13.         }
  14.  
  15.         if (fl == true) {
  16.             b = img.pixel(x, y);
  17.             c.setRgb(b);
  18.             if (x == border.second && c != edgeColor && c != fillColor) {
  19.                 stack.push(QPoint(x, y));
  20.             } else {
  21.                 stack.push(QPoint(x - 1, y));
  22.             }
  23.         }
  24.  
  25.         fl = false;
  26.         int xt = x;
  27.  
  28.         while (true) {
  29.             b = img.pixel(x, y);
  30.             c.setRgb(b);
  31.             if (c == edgeColor) {
  32.                 if (x < border.second) {
  33.                     ++x;
  34.                     continue;
  35.                 } else {
  36.                     break;
  37.                 }
  38.             } else {
  39.                 if (c == fillColor) {
  40.                     if (x < border.second) {
  41.                         ++x;
  42.                         continue;
  43.                     } else {
  44.                         break;
  45.                     }
  46.                 } else {
  47.                     if (x == xt) {
  48.                         ++x;
  49.                     }
  50.                     break;
  51.                 }
  52.             }
  53.         }
  54.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement