Advertisement
davide1409

modQuadrata

Dec 19th, 2019
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. def modQuadrata(pict,x):
  2. #@param pict: Picture; immagine nxn
  3. #@param x: int
  4.   w = getWidth(pict)
  5.   if x<0 or x>=w:
  6.     return
  7.  
  8.   else:
  9.  
  10.     for j in range:
  11.       pxR = getPixel(pict,j,x) #pixel riga
  12.       pxC = getPixel(pict,x,j) #pixel colonna
  13.       cColor = getColor(pxC) #colore del pixel della colonna
  14.       setColor(pxC,getColor(pxR))
  15.       setColor(pxR,cColor)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement