normalize: like qBound(a, 0.0, 1.0) but without needing the args and with "safer" behavior on NaN (isnan(a) -> return 0.0)
| 40 | // normalize: like qBound(a, 0.0, 1.0) but without needing the args and with |
| 41 | // "safer" behavior on NaN (isnan(a) -> return 0.0) |
| 42 | static inline qreal normalize(qreal a) |
| 43 | { |
| 44 | return (a < 1.0 ? (a > 0.0 ? a : 0.0) : 1.0); |
| 45 | } |
| 46 | |
| 47 | /////////////////////////////////////////////////////////////////////////////// |
| 48 | // HCY color space |