| 131 | } |
| 132 | |
| 133 | QImage IntensityMap::convertToQImage() const { |
| 134 | QImage result(this->getWidth(), this->getHeight(), QImage::Format_ARGB32); |
| 135 | |
| 136 | for(int y = 0; y < this->getHeight(); y++) { |
| 137 | QRgb *scanline = (QRgb*) result.scanLine(y); |
| 138 | |
| 139 | for(int x = 0; x < this->getWidth(); x++) { |
| 140 | const int c = 255 * map.at(y).at(x); |
| 141 | scanline[x] = qRgba(c, c, c, 255); |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | return result; |
| 146 | } |
no test coverage detected