CSC151.02 2015S, Class 16: Transforming Images
==============================================

* New partners!

_Overview_

* Preliminaries.
    * Admin.
    * Upcoming Work.
    * Extra Credit.
    * Questions.
* Debrief on Friday
* Key Ideas from Reading
* Lab

Preliminaries
-------------

### Admin

* Mentor session Monday at 7:00 p.m.
* Friday the 13th falls on Friday next month.  Be careful.
* *Exam 1 to be returned tomorrow*.  
* Congrats to all of our athletes who competed this weekend.

### Upcoming Work

* [Homework](../assignments/assignment.04.html).
    * Due Tuesday night at 10:30 p.m.
* Lab writeup for today: Problem 3
  <http://bit.ly/151-2015S-lab16>
* Reading for Tuesday:
    * [Making and Manipulating Homogeneous Lists](../readings/homogeneous-lists-reading.html)

### Extra Credit Opportunities

#### Academic 

* TEDx Grinnell, February 21
* Pioneer Diversity Council talk

#### Peer Support (Afternoon Section)

* Men's Basketball vs. Knox, Wednesday at 7:30 p.m., New Darby
* Spring new year's celebration, 5:30-7:30 in Harris on Saturday

### Other Good Things

* Host Prospies!
* Women's Basketball vs. Knox on Wednesday at 5:30 p.m..

### Questions

_Do we have to document every procedure?_

> 6P's required for those that say "write and document"; just a sentence
  for every other procedure.

_What does purity have to do with procedures?  Are unicorn horns involved?_

> A "pure" procedure does not modify its parameters or the environment.
  Things like `drawing-hshift` and `irgb-redder`, but not `image-set-pixel!`.

Lessons from Friday
-------------------

* We can write new Boolean procedures.
* Computers are built from basic Boolean procedures (well, hardware
  that implements them)
* Boolean values and binary go hand in hand.
* It's useful to make a chart of expected outputs.
    * Finite for Booleans
    * Perhaps too large for other inputs
    * Once you've "sampled" the chart, you can write test cases

Lessons from the Reading
------------------------

* We can compose procedures: Make a new procedure that applies multiple
  procedures.  Why do we care?
    * Something in Scheme that's easier to read - fewer parentheses,
      shorter, more concise, less repetitious, less repetitious
                (image-variant kitten (o rgb-redder rgb-bluer))
    * vs.
                (image-variant (image-variant kitten rgb-bluer) rgb-redder)
    * Potentially more efficient, particularly when we think about making
      images, in which setting and getting pixels is expensive.
* `image-variant` takes a procedure as a parameter and makes a variant of
  a picture by applying that procedure to every pixel
    * A form of repetition
    * Procedures can be parameters
    * `image-variant` is pure, does not modify the image, creates a new one
    * `image-transform` is impure, it modifies the image
    
