MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / convertHalfToRGBA32Float

Function convertHalfToRGBA32Float

Source/Falcor/Utils/Image/Bitmap.cpp:119–135  ·  view source on GitHub ↗

* Converts half float image to RGBA float image. */

Source from the content-addressed store, hash-verified

117 * Converts half float image to RGBA float image.
118 */
119static std::vector<float> convertHalfToRGBA32Float(uint32_t width, uint32_t height, uint32_t channelCount, const void* pData)
120{
121 std::vector<float> newData(width * height * 4u, 0.f);
122 const float16_t* pSrc = reinterpret_cast<const float16_t*>(pData);
123 float* pDst = newData.data();
124
125 for (uint32_t i = 0; i < width * height; ++i)
126 {
127 for (uint32_t c = 0; c < channelCount; ++c)
128 {
129 *pDst++ = float(*pSrc++);
130 }
131 pDst += (4 - channelCount);
132 }
133
134 return newData;
135}
136
137/**
138 * Converts integer image to RGBA float image.

Callers 1

convertToRGBA32FloatFunction · 0.85

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected