Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def mirroringVerticale():
- pict=makePicture(pickAFile())
- width=getWidth(pict)
- mirrorPoint=width/2
- for y in range(getHeight(pict)):
- for x in range(mirrorPoint):
- leftPixel=getPixel(pict, x, y)
- rightPixel=getPixel(pict, width-x-1, y)
- color=getColor(leftPixel)
- setColor(rightPixel, color)
- repaint(pict)
- def mirroringOrizzontale():
- pict=makePicture(pickAFile())
- height=getHeight(pict)
- mirrorPoint=height/2
- for x in range(getWidth(pict)):
- for y in range(mirrorPoint):
- uppixel=getPixel(pict, x, y)
- downpixel=getPixel(pict, x, height-y-1)
- color=getColor(uppixel)
- setColor(downpixel, color)
- repaint(pict)
- def speculare():
- pict=makePicture(pickAFile())
- h=getHeight(pict)
- w=getWidth(pict)
- for x in range(w/2):
- for y in range(h):
- pixel=getPixel(pict, x, y)
- pixel2=getPixel(pict, w-x-1, y)
- color=getColor(pixel)
- color2=getColor(pixel2)
- setColor(pixel2, color)
- setColor(pixel, color2)
- repaint(pict)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement