MCPcopy Create free account
hub / github.com/BabylonJS/BabylonNative / FlipY

Function FlipY

Plugins/NativeEngine/Source/NativeEngine.cpp:216–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214 }
215
216 void FlipY(bimg::ImageContainer* image)
217 {
218 uint8_t* bytes = static_cast<uint8_t*>(image->m_data);
219 uint32_t rowCount = image->m_height;
220 uint32_t rowPitch = image->m_size / image->m_height;
221
222 std::vector<uint8_t> buffer(rowPitch);
223
224 for (size_t row = 0; row < rowCount / 2; row++)
225 {
226 auto frontPtr = bytes + (row * rowPitch);
227 auto backPtr = bytes + ((rowCount - row - 1) * rowPitch);
228
229 std::memcpy(buffer.data(), frontPtr, rowPitch);
230 std::memcpy(frontPtr, backPtr, rowPitch);
231 std::memcpy(backPtr, buffer.data(), rowPitch);
232 }
233 }
234
235 void GenerateMips(bx::AllocatorI* allocator, bimg::ImageContainer** image)
236 {

Callers 2

LoadTextureMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected