Return the flipped image in a temporary buffer.
| 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 | { |
no test coverage detected