Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int x = border.first;
- while (x < border.second) {
- bool fl = false;
- while (true) {
- b = img.pixel(x, y);
- c.setRgb(b);
- if (c != edgeColor && c != fillColor && x < border.second) {
- fl = true;
- ++x;
- } else {
- break;
- }
- }
- if (fl == true) {
- b = img.pixel(x, y);
- c.setRgb(b);
- if (x == border.second && c != edgeColor && c != fillColor) {
- stack.push(QPoint(x, y));
- } else {
- stack.push(QPoint(x - 1, y));
- }
- }
- fl = false;
- int xt = x;
- while (true) {
- b = img.pixel(x, y);
- c.setRgb(b);
- if (c == edgeColor) {
- if (x < border.second) {
- ++x;
- continue;
- } else {
- break;
- }
- } else {
- if (c == fillColor) {
- if (x < border.second) {
- ++x;
- continue;
- } else {
- break;
- }
- } else {
- if (x == xt) {
- ++x;
- }
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement