13 uint ImageF::pixelF(
const QImage& image, qreal x, qreal y )
16 const QRgb& topLeftPixel = image.
pixel( (
int) x, (
int) y );
26 if ( ( iY + 1 ) < image.
height() ) {
28 QRgb bottomLeftPixel = image.
pixel( iX, iY + 1 );
31 qreal ml_red = ( 1.0 - fY ) * qRed ( topLeftPixel ) + fY * qRed ( bottomLeftPixel );
32 qreal ml_green = ( 1.0 - fY ) * qGreen( topLeftPixel ) + fY * qGreen( bottomLeftPixel );
33 qreal ml_blue = ( 1.0 - fY ) * qBlue ( topLeftPixel ) + fY * qBlue ( bottomLeftPixel );
36 if ( iX + 1 < image.
width() ) {
40 QRgb topRightPixel = image.
pixel( iX + 1, iY );
41 QRgb bottomRightPixel = image.
pixel( iX + 1, iY + 1 );
44 qreal mr_red = ( 1.0 - fY ) * qRed ( topRightPixel ) + fY * qRed ( bottomRightPixel );
45 qreal mr_green = ( 1.0 - fY ) * qGreen( topRightPixel ) + fY * qGreen( bottomRightPixel );
46 qreal mr_blue = ( 1.0 - fY ) * qBlue ( topRightPixel ) + fY * qBlue ( bottomRightPixel );
49 int mm_red = int( ( ( 1.0 - fX ) * ml_red + fX * mr_red ) );
50 int mm_green = int( ( ( 1.0 - fX ) * ml_green + fX * mr_green ) );
51 int mm_blue = int( ( ( 1.0 - fX ) * ml_blue + fX * mr_blue ) );
53 return qRgb( mm_red, mm_green, mm_blue );
56 return qRgb( ml_red, ml_green, ml_blue );
61 if ( iX + 1 < image.
width() ) {
68 QRgb topRightPixel = image.
pixel( iX + 1, iY );
71 int tm_red = int( ( ( 1.0 - fX ) * qRed ( topLeftPixel ) + fX * qRed ( topRightPixel ) ) );
72 int tm_green = int( ( ( 1.0 - fX ) * qGreen( topLeftPixel ) + fX * qGreen( topRightPixel ) ) );
73 int tm_blue = int( ( ( 1.0 - fX ) * qBlue ( topLeftPixel ) + fX * qBlue ( topRightPixel ) ) );
75 return qRgb( tm_red, tm_green, tm_blue );