Rewrite the mirror functions as methods in the MyPicture class.
Note: What mirror “functions” this question refers to are unclear, simply rewriting two of the mirror functions used in the book is sufficient.
```
class MyPicture(Picture):
def mirrorHorizontal(self):
mirrorPoint = getHeight(self) / 2
height = getHeight(self)
for x in range(0,getWidth(self)):
for y in range(0,mirrorPoint):
topPixel = getPixel(self ,x,y)
bottomPixel = getPixel(self,x,height - y - 1)
color = getColor(topPixel)
setColor(bottomPixel ,color)
def mirrorVertical(self):
mirrorPoint = getWidth(self) / 2
width = getWidth(self)
for y in range(0,getHeight(self)):
for x in range(0,mirrorPoint):
leftPixel = getPixel(self ,x,y)
rightPixel = getPixel(self,width - x - 1,y)
color = getColor(leftPixel)
setColor(rightPixel ,color)
```
You might also like to view...
In establishing a coding system, the analyst should do all except:
A) make codes that are diversified. B) keep codes concise. C) keep codes uniform. D) allow for modification of codes. E) make codes meaningful.
____ must be used if you want clients outside your network to access services on your servers.
A. Static NAT B. Dynamic NAT C. PAT D. Dynamic PAT
The _________________________ panel allows you to work with up to five cloning sources at the same time.
Fill in the blank(s) with the appropriate word(s).
? May has experience developing applications using XSLT 1.0, and would like to take advantage of some of the added features of XSLT 2.0 in developing a new application. She comes to you for help implementing some of these new features. May is working with regular expressions, and would like to write a function that splits the contents of the employees element into a sequence of strings at every occurrence of a white space character such as a blank space, tab, or newline character. You recommend she use the function _____.
A. ?tokenize(employees, '\s-') B. ?tokenize(employees, '\x+') C. ?tokenize(employees, '\s+') D. ?tokenize(employees, '\x-')