Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. public void quadMirror()
  2. {
  3.   int vertAxis=this.getWidth()/2;
  4.   Pixel leftPixel=null;
  5.   Pixel rightPixel=null;
  6.   for (int y=0; y<this.getHeight(); y++)
  7.   {
  8.     for (int x=0; x<vertAxis; x++)
  9.     {
  10.       leftPixel=this.getPixel(x,y);
  11.       rightPixel=this.getPixel(this.getWidth()-1-x,y);
  12.       leftPixel.setColor(rightPixel.getColor());
  13.     }
  14.   }
  15.   int horAxis=this.getHeight()/2;
  16.   Pixel topPixel=null;
  17.   Pixel bottomPixel=null;
  18.   for (int x=0; x<this.getWidth(); x++)
  19.   {
  20.     for (int y=0; y<horAxis; y++)
  21.     {
  22.       topPixel=this.getPixel(x,y);
  23.       bottomPixel=this.getPixel(this.getHeight()-1-x,y);
  24.       bottomPixel.setColor(topPixel.getColor());
  25.     }
  26.   }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement