1 void RotateRGBA(
2 const sd_uint8* src,
3 sd_uint8* result,
4 int width,
5 int height,
6 int mode
7 ){// mode 0 -> 0; 1 -> 90; 2->180; 3->270;
8 if(mode == 1){
9 int x = 0;
10 int y = 0;
11 int posR = 0;
12 int posS = 0;
13 for(x = 0; x < width; x++){
14 for(y = height - 1; y >= 0; y--){
15 posS = (y * width + x) * 4;
16 result[posR + 0] = src[posS + 0];// R
17 result[posR + 1] = src[posS + 1];// G
18 result[posR + 2] = src[posS + 2];// B
19 result[posR + 3] = src[posS + 3];// A
20 posR += 4;
21 }
22 }
23 }
24 }