| 45 | } |
| 46 | |
| 47 | static QColor offsetPixel(std::shared_ptr<QImage> img, int dx, int dy) { |
| 48 | const int cx = img->width() / 2 + dx; |
| 49 | const int cy = img->height() / 2 + dy; |
| 50 | return img->pixelColor(std::clamp(cx, 0, img->width() - 1), |
| 51 | std::clamp(cy, 0, img->height() - 1)); |
| 52 | } |
| 53 | |
| 54 | // Loose classifiers for our colored guide lines |
| 55 | static bool is_red(QColor c) { return c.red() >= 200 && c.green() <= 60 && c.blue() <= 60; } |