public class PictureTransformation {
  private Picture _picture;
  
  public void loadPicture(String n){
   String _filename = "/eng/class/notes/cse113/intro-prog-java/mediasources/" + n;
   _picture = new Picture(_filename);
   _picture.show();
  }
    
    public void transform(int a, int b, int w, int h)
    {
  
  for (int y = b; y < b + h/2; y = y + 1) {
    for (int x = a; x < a + w; x = x +1){
      Pixel p = _picture.getPixel(x,y);
      java.awt.Color c = p.getColor();
      Pixel p2 = _picture.getPixel(x,(h-1)-y);
      p2.setColor(c);
    }
  }
  _picture.repaint();
    }

}
      
      
    
  