Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def ribaltamentoOrizz(pict):
- #@param pict: picture
- widht=getWidth(pict)
- mirror=widht/2
- for x in range (0,mirror):
- for y in range (0,getHeight(pict)):
- leftPixel=getPixel(pict,x,y)
- rightPixel=getPixel(pict,widht-1-x,y)
- swap1=getColor(leftPixel)
- swap2=getColor(rightPixel)
- setColor(leftPixel,swap2)
- setColor(rightPixel,swap1)
- def ribaltamentoVert(pict):
- #@param pict: picture
- height=getHeight(pict)
- mirror=height/2
- for x in range (0,getWidth(pict)):
- for y in range (0,mirror):
- topPixel=getPixel(pict,x,y)
- bottomPixel=getPixel(pict,x,height-1-y)
- swap1=getColor(topPixel)
- swap2=getColor(bottomPixel)
- setColor(topPixel,swap2)
- setColor(bottomPixel,swap1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement