Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Blast

def test(a, b, c):
  picture = makePicture(pickAFile())
  show(picture)
  blast(picture, a, b, c)
  repaint(picture)

# Increase the red, green and blue values of every pixel
# by different amounts.
# For high values of redFactor, greenFactor, and blueFactor
# and depending on the "modulo pixel values by 256" setting in
# the JES Edit/Options settings, this will either lead to
# the picture going very RGB or having weird psychedelic patches.
# For fun, experiment with different input values and pictures
# that are either very colorful or fairly monochromatic. 
#
def blast(pic, redFactor, greenFactor, blueFactor):
  for pixel in getPixels(pic):
    setRed(pixel, getRed(pixel)*redFactor)
    setGreen(pixel, getGreen(pixel)*greenFactor)
    setBlue(pixel, getBlue(pixel)*blueFactor)


Links to this Page