public static void rotateCCW ( GrayS64 input , GrayS64 output ) { if ( input . width != output . height || input . height != output . width ) throw new IllegalArgumentException ( "Incompatible shapes" ) ; int w = input . width - 1 ; for ( int y = 0 ; y < input . height ; y ++ ) { int indexIn = input . startIndex + y * input . stride ; for ( int x = 0 ; x < input . width ; x ++ ) { output . unsafe_set ( y , w - x , input . data [ indexIn ++ ] ) ; } } }
Rotates the image 90 degrees in the counter - clockwise direction .