MCPcopy Create free account
hub / github.com/DentonW/DevIL / iConvR16ToFloat32

Function iConvR16ToFloat32

DevIL/src-IL/src/il_dds.cpp:1613–1625  ·  view source on GitHub ↗

Same as iConvFloat16ToFloat32, but we have to set the green and blue channels to 1.0f. The destination format is RGB, and the source is R16.

Source from the content-addressed store, hash-verified

1611// Same as iConvFloat16ToFloat32, but we have to set the green and blue channels
1612// to 1.0f. The destination format is RGB, and the source is R16.
1613ILboolean iConvR16ToFloat32(ILuint* dest, ILushort* src, ILuint size)
1614{
1615 ILuint i;
1616 for (i = 0; i < size; i += 3) {
1617 //float: 1 sign bit, 8 exponent bits, 23 mantissa bits
1618 //half: 1 sign bit, 5 exponent bits, 10 mantissa bits
1619 *dest++ = halfToFloat(*src++);
1620 *((ILfloat*)dest++) = 1.0f;
1621 *((ILfloat*)dest++) = 1.0f;
1622 }
1623
1624 return IL_TRUE;
1625}
1626
1627
1628ILboolean DecompressFloat(ILuint lCompFormat)

Callers 1

DecompressFloatFunction · 0.85

Calls 1

halfToFloatFunction · 0.85

Tested by

no test coverage detected