Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def rowColumnSwap(pict,k):
- #@param:
- # pict: picture;
- # k: int;
- assert getWidth(pict)==getHeight(pict), "Picture is not square"
- assert k<getWidth(pict) and k>=0, "Parameter is smaller than 0 or bigger than picture size."
- for i in range(0,getWidth(pict)):
- pix1 = getPixel(pict,i,k)
- pix2 = getPixel(pict,k,i)
- col1 = getColor(pix1)
- col2 = getColor(pix2)
- setColor(pix1,col2)
- setColor(pix2,col1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement