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

Function iConvG16R16ToFloat32

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

Same as iConvFloat16ToFloat32, but we have to set the blue channel to 1.0f. The destination format is RGB, and the source is R16G16 (little endian).

Source from the content-addressed store, hash-verified

1594// Same as iConvFloat16ToFloat32, but we have to set the blue channel to 1.0f.
1595// The destination format is RGB, and the source is R16G16 (little endian).
1596ILboolean iConvG16R16ToFloat32(ILuint* dest, ILushort* src, ILuint size)
1597{
1598 ILuint i;
1599 for (i = 0; i < size; i += 3) {
1600 //float: 1 sign bit, 8 exponent bits, 23 mantissa bits
1601 //half: 1 sign bit, 5 exponent bits, 10 mantissa bits
1602 *dest++ = halfToFloat(*src++);
1603 *dest++ = halfToFloat(*src++);
1604 *((ILfloat*)dest++) = 1.0f;
1605 }
1606
1607 return IL_TRUE;
1608}
1609
1610
1611// Same as iConvFloat16ToFloat32, but we have to set the green and blue channels

Callers 1

DecompressFloatFunction · 0.85

Calls 1

halfToFloatFunction · 0.85

Tested by

no test coverage detected