#include <zone_region.h>
Public Member Functions | |
void | rotFlip (uint8 rot, uint8 flip) |
Data Fields | |
sint32 | h |
std::vector< uint8 > | Tab |
sint32 | w |
|
Definition at line 336 of file zone_region.cpp. References h, sint32, Tab, uint8, and w.
00337 { 00338 uint8 nTmp; 00339 sint32 i, j; 00340 00341 if (flip == 1) 00342 { 00343 for (j = 0; j < h; ++j) 00344 for (i = 0; i < (w/2); ++i) 00345 { 00346 nTmp = Tab[i+j*w]; 00347 Tab[i+j*w] = Tab[(w-1-i)+j*w]; 00348 Tab[(w-1-i)+j*w] = nTmp; 00349 } 00350 } 00351 00352 if (rot == 1) 00353 { 00354 vector<uint8> TabDest; 00355 TabDest.resize (Tab.size()); 00356 for (j = 0; j < h; ++j) 00357 for (i = 0; i < w; ++i) 00358 TabDest[j+i*h] = Tab[i+(h-1-j)*w]; 00359 Tab = TabDest; 00360 i = w; 00361 w = h; 00362 h = i; 00363 } 00364 00365 if (rot == 2) 00366 { 00367 for (j = 0; j < (h/2); ++j) 00368 for (i = 0; i < w; ++i) 00369 { 00370 nTmp = Tab[i+j*w]; 00371 Tab[i+j*w] = Tab[(w-1-i)+(h-1-j)*w]; 00372 Tab[(w-1-i)+(h-1-j)*w] = nTmp; 00373 } 00374 if ((h/2)*2 != h) 00375 { 00376 j = (h/2); 00377 for (i = 0; i < (w/2); ++i) 00378 { 00379 nTmp = Tab[i+j*w]; 00380 Tab[i+j*w] = Tab[(w-1-i)+j*w]; 00381 Tab[(w-1-i)+j*w] = nTmp; 00382 } 00383 } 00384 } 00385 00386 if (rot == 3) 00387 { 00388 vector<uint8> TabDest; 00389 TabDest.resize (Tab.size()); 00390 for (j = 0; j < h; ++j) 00391 for (i = 0; i < w; ++i) 00392 TabDest[j+i*h] = Tab[w-1-i+j*w]; 00393 Tab = TabDest; 00394 i = w; 00395 w = h; 00396 h = i; 00397 } 00398 } |
|
Definition at line 47 of file zone_region.h. Referenced by rotFlip(). |
|
Definition at line 48 of file zone_region.h. Referenced by rotFlip(). |
|
Definition at line 47 of file zone_region.h. |