CSC 161 Grinnell College Fall, 2012 Imperative Problem Solving and Data Structures

# CSC 161 Module 4: Image Processing with the Scribbler 2

## Summary and Main Topics

This module introduces the customizable nature of self-written programs by using structs and 2-dimensional arrays, particularly emphasizing their uses with Myro Pictures.

1. Pictures
2. Structs
3. Pixels
4. Two Dimensional Arrays
5. Insertion Sort
6. Machine-level operations

## Day-by-day Details

Day Topic Preparation In-class Due Date Availability
for
Extra
Credit
Tuesday, October 30 Module 4: Pictures
Examples
Wednesday, October 31 Supplemental Problem 3   Supplemental Problem 3 (done individually) Wednesday, October 31
Wednesday, October 31 Structs: Transform a Pixel lab exercise
Friday, November 2 Two Dimensional Arrays
lab exercise Wednesday, November 7
Monday, November 5 Insertion Sort lab exercise
Tuesday, November 6 Bitwise operations and unions
• King, Sections 16.4, 20.1
• K&R 2.9, 6.8
lab exercise
Wednesday, November 7 Module 4 Project   project Wednesday, November 14

## Project: Picture Suite

For this project, you will write the following series of functions which modify a picture. Each function should include tests and examples of pictures which it modifies.

• ### void pixelStrip (Picture * pic, char color)

This function should set the R, G, or B value of every pixel in the picture to 0 (depending on what char color is).
For example if parameter color is 'G', then this procedure should change the 'G' component of each pixel in the picture to 0; the 'R' and 'B' components would remain unchanged.

• ### void pictureRedder (Picture * pic)void pictureGreener (Picture * pic)void pictureBluer (Picture * pic)

These functions should increase the intensity of their respective colors (red, green, or blue). This increase should never go past 255. The color should increase less when it is already high than when it is low.

• ### void circleSelect (Picture * pic, int xCenter, int yCenter, int radius)

This function should select a circle from your picture and turn all of the pixels within that circle gray.

• ### a creative function of your choosing

This function should do something interesting and creative to your picture. It should not just be a rehashing of a previous exercise or lab, and there should be a good amount of thought and effort placed into this function.