* Converts half float image to RGBA float image. */
| 117 | * Converts half float image to RGBA float image. |
| 118 | */ |
| 119 | static 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. |
no test coverage detected