bicubic interpolating zoom

Sven Langkamp longamp at reallygood.de
Sun Aug 15 23:53:29 CEST 2004


Michael Thaler wrote:

>I have a simple question: in the scaling code the function (or maybe it is a 
>macro) qRound is used. Where is this function documented. I could not find it 
>in the Qt documentation. 
>
qRound is a function in qglobal.h:

inline int qRound( double d )
{
    return d >= 0.0 ? int(d + 0.5) : int( d - ((int)d-1) + 0.5 ) + 
((int)d-1);
}

>I need a function that always rounds down a floating 
>point number (a double) to an integer, e.g. 6.8->6. Is there a Qt function to 
>do that? (I know there is a function like that in libm).
>
You could use trunc, which cuts off the decimal places.

Sven



More information about the kimageshop mailing list