

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


private GImage flipHorizontal(GImage image) { int[][] array = image.getPixelArray(); int width = array[0].length; int height = array.length; for (int row = 0; row < height; row++) { for (int p1 = 0; p1 < width / 2; p1++) { int p2 = width - p1 - 1; int temp = array[row][p1]; array[row][p1] = array[row][p2]; array[row][p2] = temp; } } return new GImage(array); }