bicubic interpolating zoom
Adrian Page
adrian at pagenet.plus.com
Sun Aug 15 23:31:59 CEST 2004
On Sunday 15 August 2004 9:45 pm, 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.
It doesn't seem to be documented anywhere, although it's used in one of the
tutorials. It's a macro defined in qglobal.h.
> 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).
I don't think there's a Qt function for that. You can just cast the double to
an int, assuming that for negative values you still want -6.8 to become -6.
If you want -6.8 to become -7, you can use floor(), or just subtract 1 for
negative input.
Adrian
More information about the kimageshop
mailing list