import java.util.ArrayList; class ManipulatedPhotos{ public static void main(String [] args) throws Exception{ PixelTransform pixelTransform; ArrayList transform = new ArrayList (); /*---- collect transformations ----*/ pixelTransform = new ReducePixel(); transform.add( new ScaledPhoto( pixelTransform, 0.3 ) ); transform.add( new ScaledPhoto( pixelTransform, 0.666 ) ); pixelTransform = new RedPixel(); transform.add( new ScaledPhoto( pixelTransform, 1 ) ); pixelTransform = new DistortPixel(); transform.add( new ScaledPhoto( pixelTransform, 1 ) ); pixelTransform = new LocationScalePixel(0.33, 0.5); transform.add( new ScaledPhoto( pixelTransform, 0.5 ) ); pixelTransform = new LocationScalePixel(0.3, 0.7); transform.add( new ScaledPhoto( pixelTransform, 0.7 ) ); /*---- load the picture ----*/ Photo src = new Photo( args[0] ); int idx = args[0].lastIndexOf('.'); String filename = args[0].substring(0,idx); /*---- transform and store pictures ----*/ for(int i = 0; i