Write a function that will scale up just part of the picture. Try making someone’s nose longer.

What will be an ideal response?


```
def noseLongerifier (scr, x, y, w, h):
canvas = makeEmptyPicture(getWidth(scr), getHeight(scr))
for i in range(0, getWidth(scr)):
for j in range(0, getHeight(scr)):
p = getPixel(canvas, i, j)
p2 = getPixel(scr, i, j)
color = getColor(p2)
setColor(p, color)

sourceX = 0.0
for targetX in range(x,x+w*2):
sourceY = 0.0
for targetY in range(y,y+h):
px = getPixel(scr,int(sourceX),int(sourceY))
color = getColor(px)
setColor(getPixel(canvas ,int(targetX) ,int(targetY)), color)
sourceY = sourceY + 1
sourceX = sourceX + 0.5
show(canvas)
return canvas
```

Note: This function doubles the width of a past in area, so can be used to lengthen a nose.

Computer Science & Information Technology

You might also like to view...

Compare RPC call semantics with the semantics of WS-ReliableMessaging:

i) State the entities to which each refers. ii) Compare the differing meanings of the available semantics (for example, at-least-once, at-most-once, exactly-once).

Computer Science & Information Technology

FIGURE WD 8-1Referring to Figure WD 8-1 above, to open a dialog box and browse for documents, you would click the ____.

A. the open folder icon to the right of the Original document box or Revised document box B. list arrow to the right of the Original document box or Revised document box C. either a. or b. D. neither a. nor b.

Computer Science & Information Technology

The connection between the clients and the providers

What will be an ideal response?

Computer Science & Information Technology

Formats and ____ can be applied to selected characters or to entire paragraphs.

A. fonts B. formatting C. styles D. designs

Computer Science & Information Technology