c - Rotate pixels 90 / -90 degrees without extra memory allocation -


currently use next algorithm rotate 2d pixel array 90 degrees, requires memory buffer allocation. there way without allocating new entire buffer? , simple way specify if needs 90 , -90?

 unsigned int *output = (unsigned int*)malloc(inputbuffersize);   (int pixel = 0, x = width - 1; x > -1; --x)  {      (int y = 0; y < height; ++y)      {          output[pixel++] = input[width * y + x];      }  } 


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -