10ImageF::ImageF() =
default;
12uint ImageF::pixelF(
const QImage &image, qreal x, qreal y)
14 const QRgb &topLeftPixel = image.
pixel((
int)x, (
int)y);
24 if ((iY + 1) < image.
height()) {
25 QRgb bottomLeftPixel = image.
pixel(iX, iY + 1);
28 qreal ml_red = (1.0 - fY) * qRed(topLeftPixel) + fY * qRed(bottomLeftPixel);
29 qreal ml_green = (1.0 - fY) * qGreen(topLeftPixel) + fY * qGreen(bottomLeftPixel);
30 qreal ml_blue = (1.0 - fY) * qBlue(topLeftPixel) + fY * qBlue(bottomLeftPixel);
33 if (iX + 1 < image.
width()) {
36 QRgb topRightPixel = image.
pixel(iX + 1, iY);
37 QRgb bottomRightPixel = image.
pixel(iX + 1, iY + 1);
40 qreal mr_red = (1.0 - fY) * qRed(topRightPixel) + fY * qRed(bottomRightPixel);
41 qreal mr_green = (1.0 - fY) * qGreen(topRightPixel) + fY * qGreen(bottomRightPixel);
42 qreal mr_blue = (1.0 - fY) * qBlue(topRightPixel) + fY * qBlue(bottomRightPixel);
45 int mm_red = int(((1.0 - fX) * ml_red + fX * mr_red));
46 int mm_green = int(((1.0 - fX) * ml_green + fX * mr_green));
47 int mm_blue = int(((1.0 - fX) * ml_blue + fX * mr_blue));
49 return qRgb(mm_red, mm_green, mm_blue);
51 return qRgb(ml_red, ml_green, ml_blue);
55 if (iX + 1 < image.
width()) {
61 QRgb topRightPixel = image.
pixel(iX + 1, iY);
64 int tm_red = int(((1.0 - fX) * qRed(topLeftPixel) + fX * qRed(topRightPixel)));
65 int tm_green = int(((1.0 - fX) * qGreen(topLeftPixel) + fX * qGreen(topRightPixel)));
66 int tm_blue = int(((1.0 - fX) * qBlue(topLeftPixel) + fX * qBlue(topRightPixel)));
68 return qRgb(tm_red, tm_green, tm_blue);
Binds a QML item to a specific geodetic location in screen coordinates.
QRgb pixel(const QPoint &position) const const