Home | History | Annotate | Download | only in common

Lines Matching refs:BITS

454 inline float channelToUnormFloat (deUint32 src, int bits)
456 const deUint32 maxVal = (1u << bits) - 1;
458 // \note Will lose precision if bits > 23
463 inline deInt32 signExtend (deUint32 src, int bits)
465 const deUint32 signBit = 1u << (bits-1);
472 bits)
474 const deUint32 range = (1u << (bits-1)) - 1;
476 // \note Will lose precision if bits > 24
477 return de::max(-1.0f, (float)signExtend(src, bits) / (float)range);
480 inline deUint32 unormFloatToChannel (float src, int bits)
482 const deUint32 maxVal = (1u << bits) - 1;
488 inline deUint32 snormFloatToChannel (float src, int bits)
490 const deInt32 range = (deInt32)((1u << (bits-1)) - 1u);
491 const deUint32 mask = (1u << bits) - 1;
497 inline deUint32 uintToChannel (deUint32 src, int bits)
499 const deUint32 maxVal = (1u << bits) - 1;
503 inline deUint32 intToChannel (deInt32 src, int bits)
505 const deInt32 minVal = -(deInt32)(1u << (bits-1));
506 const deInt32 maxVal = (deInt32)((1u << (bits-1)) - 1u);
507 const deUint32 mask = (1u << bits) - 1;
1268 #define PN(VAL, OFFS, BITS) (unormFloatToChannel((VAL), (BITS)) << (OFFS))
1269 #define PS(VAL, OFFS, BITS) (snormFloatToChannel((VAL), (BITS)) << (OFFS))
1270 #define PU(VAL, OFFS, BITS) (uintToChannel((VAL), (BITS)) << (OFFS))
1271 #define PI(VAL, OFFS, BITS) (intToChannel((VAL), (BITS)) << (OFFS))
1364 *((deUint32*)pixelPtr) = Float11(color[0]).bits() | (Float11(color[1]).bits() << 11) | (Float10(color[2]).bits() << 22);
1418 #define PU(VAL, OFFS, BITS) (uintToChannel((deUint32)(VAL), (BITS)) << (OFFS))
1419 #define PI(VAL, OFFS, BITS) (intToChannel((deUint32)(VAL), (BITS)) << (OFFS))