Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. {
  2. for(unsigned short x = 0; x < header.myWidth; ++x)
  3. {
  4. for(unsigned short y = 0;y < header.myHeight;++y)
  5. {
  6. unsigned char destination40 = source[((header.myHeight - y - 1)*header.myWidth + x) * 4 + 2]; // convert BGRA to RGBA
  7. unsigned char destination41 = source[((header.myHeight - y - 1)*header.myWidth + x) * 4 + 1];
  8. unsigned char destination42 = source[((header.myHeight - y - 1)*header.myWidth + x) * 4 + 0];
  9. unsigned char destination43 = source[((header.myHeight - y - 1)*header.myWidth + x) * 4 + 3];
  10.  
  11. destination[(y*header.myWidth + x) * 4 + 0] = destination40;
  12. destination[(y*header.myWidth + x) * 4 + 1] = destination41;
  13. destination[(y*header.myWidth + x) * 4 + 2] = destination42;
  14. destination[(y*header.myWidth + x) * 4 + 3] = destination43;
  15.  
  16. }
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement