Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- for(unsigned short x = 0; x < header.myWidth; ++x)
- {
- for(unsigned short y = 0;y < header.myHeight;++y)
- {
- unsigned char destination40 = source[((header.myHeight - y - 1)*header.myWidth + x) * 4 + 2]; // convert BGRA to RGBA
- unsigned char destination41 = source[((header.myHeight - y - 1)*header.myWidth + x) * 4 + 1];
- unsigned char destination42 = source[((header.myHeight - y - 1)*header.myWidth + x) * 4 + 0];
- unsigned char destination43 = source[((header.myHeight - y - 1)*header.myWidth + x) * 4 + 3];
- destination[(y*header.myWidth + x) * 4 + 0] = destination40;
- destination[(y*header.myWidth + x) * 4 + 1] = destination41;
- destination[(y*header.myWidth + x) * 4 + 2] = destination42;
- destination[(y*header.myWidth + x) * 4 + 3] = destination43;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement