import java.awt.*; import java.awt.image.*; public class ImageRotationReflection { static ImageTool imTool = new ImageTool (); public static void main (String[] argv) { Image image = imTool.readImageFile ("device.jpg"); imTool.showImage (image, "original"); Image rotatedImage = rotateRight (image); } static Image rotateRight (Image image) { // Extract pixels and dimensions. int[][][] pixels = imTool.imageToPixels (image); int numRows = pixels.length; int numCols = pixels[0].length; // Storage for new image. int[][][] rotatedPixels = new int [numCols][numRows][4]; for (int i=0; i