Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void quadMirror()
- {
- int vertAxis=this.getWidth()/2;
- Pixel leftPixel=null;
- Pixel rightPixel=null;
- for (int y=0; y<this.getHeight(); y++)
- {
- for (int x=0; x<vertAxis; x++)
- {
- leftPixel=this.getPixel(x,y);
- rightPixel=this.getPixel(this.getWidth()-1-x,y);
- leftPixel.setColor(rightPixel.getColor());
- }
- }
- int horAxis=this.getHeight()/2;
- Pixel topPixel=null;
- Pixel bottomPixel=null;
- for (int x=0; x<this.getWidth(); x++)
- {
- for (int y=0; y<horAxis; y++)
- {
- topPixel=this.getPixel(x,y);
- bottomPixel=this.getPixel(this.getHeight()-1-x,y);
- bottomPixel.setColor(topPixel.getColor());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement