I'm working on an image processing app to rotate and image 90 degrees with this function, and could use some help with the logic. Integers i and j are coordinates, height and width are the total pixel height and width, rgb array is the color vavlues that need to be re-written into the new array. I know I need an array with height and width swapped, and I need to write the new color values into the correct locations, but I don't really know what to do.
Here is the function, any help would be appreciated.
private void rotate()
{
for(int i=0; i<height; i++)
   for(int j=0; j<width; j++)
   {    
      int rgbArray[] = new int[4];
      rgbArray = getPixelArray(picture[i][j]);
       picture[i][j] = getPixels(rgbArray);
    } 
 resetPicture();
}
 
    