| 81 | } |
| 82 | |
| 83 | void DrawKeypoints(QPixmap* pixmap, |
| 84 | const FeatureKeypoints& points, |
| 85 | const QColor& color) { |
| 86 | if (pixmap->isNull()) { |
| 87 | return; |
| 88 | } |
| 89 | |
| 90 | const int pen_width = std::max(pixmap->width(), pixmap->height()) / 2048 + 1; |
| 91 | const int radius = 3 * pen_width + (3 * pen_width) % 2; |
| 92 | const float radius2 = radius / 2.0f; |
| 93 | |
| 94 | QPainter painter(pixmap); |
| 95 | painter.setRenderHint(QPainter::Antialiasing); |
| 96 | |
| 97 | QPen pen; |
| 98 | pen.setWidth(pen_width); |
| 99 | pen.setColor(color); |
| 100 | painter.setPen(pen); |
| 101 | |
| 102 | for (const auto& point : points) { |
| 103 | painter.drawEllipse(point.x - radius2, point.y - radius2, radius, radius); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | QPixmap DrawMatches(const QPixmap& image1, |
| 108 | const QPixmap& image2, |
no outgoing calls
no test coverage detected