21 const QRgb& topLeftPixel = image.
pixel( (
int) x, (
int) y );
31 if ( ( iY + 1 ) < image.
height() ) {
33 QRgb bottomLeftPixel = image.
pixel( iX, iY + 1 );
36 qreal ml_red = ( 1.0 - fY ) * qRed ( topLeftPixel ) + fY * qRed ( bottomLeftPixel );
37 qreal ml_green = ( 1.0 - fY ) * qGreen( topLeftPixel ) + fY * qGreen( bottomLeftPixel );
38 qreal ml_blue = ( 1.0 - fY ) * qBlue ( topLeftPixel ) + fY * qBlue ( bottomLeftPixel );
41 if ( iX + 1 < image.
width() ) {
45 QRgb topRightPixel = image.
pixel( iX + 1, iY );
46 QRgb bottomRightPixel = image.
pixel( iX + 1, iY + 1 );
49 qreal mr_red = ( 1.0 - fY ) * qRed ( topRightPixel ) + fY * qRed ( bottomRightPixel );
50 qreal mr_green = ( 1.0 - fY ) * qGreen( topRightPixel ) + fY * qGreen( bottomRightPixel );
51 qreal mr_blue = ( 1.0 - fY ) * qBlue ( topRightPixel ) + fY * qBlue ( bottomRightPixel );
54 int mm_red = int( ( ( 1.0 - fX ) * ml_red + fX * mr_red ) );
55 int mm_green = int( ( ( 1.0 - fX ) * ml_green + fX * mr_green ) );
56 int mm_blue = int( ( ( 1.0 - fX ) * ml_blue + fX * mr_blue ) );
58 return qRgb( mm_red, mm_green, mm_blue );
61 return qRgb( ml_red, ml_green, ml_blue );
66 if ( iX + 1 < image.
width() ) {
73 QRgb topRightPixel = image.
pixel( iX + 1, iY );
76 int tm_red = int( ( ( 1.0 - fX ) * qRed ( topLeftPixel ) + fX * qRed ( topRightPixel ) ) );
77 int tm_green = int( ( ( 1.0 - fX ) * qGreen( topLeftPixel ) + fX * qGreen( topRightPixel ) ) );
78 int tm_blue = int( ( ( 1.0 - fX ) * qBlue ( topLeftPixel ) + fX * qBlue ( topRightPixel ) ) );
80 return qRgb( tm_red, tm_green, tm_blue );
static uint pixelF(const QImage &image, qreal x, qreal y)
Returns the color value of the result tile at a given floating point position.
QRgb pixel(int x, int y) const