MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / flipImage

Function flipImage

TheForceEngine/TFE_Asset/imageAsset.cpp:149–159  ·  view source on GitHub ↗

Return the flipped image in a temporary buffer.

Source from the content-addressed store, hash-verified

147
148 // Return the flipped image in a temporary buffer.
149 u32* flipImage(const u32* srcImage, u32 width, u32 height)
150 {
151 s_buffer.resize(width * height * 4);
152 const u32* srcBuffer = srcImage;
153 u32* dstBuffer = (u32*)s_buffer.data();
154 for (u32 y = 0; y < height; y++)
155 {
156 memcpy(&dstBuffer[y * width], &srcBuffer[(height - y - 1) * width], width * 4);
157 }
158 return dstBuffer;
159 }
160
161 void writeImage(const char* path, u32 width, u32 height, u32* pixelData)
162 {

Callers 1

writeImageFunction · 0.85

Calls 2

dataMethod · 0.80
resizeMethod · 0.45

Tested by

no test coverage detected