Solo MP

This MP, as well as all other MPs in CS 225, are to be completed without a partner.

You are welcome to get help on the MP from course staff, via open lab hours, or Piazza!

Checking Out the Code

To check out the provided code simply run

svn up

from your cs225 directory.

This should update your directory to contain a new directory called mp2. These files are used for both the curated and the creative parts of this MP.

Part 1 (Curated): The Image Class

An Image object is a subclass of the PNG class. This means it inherits all the member functions of the PNG class; so anything you could do with a PNG, you can also do with an Image.

After creating the Image class, implement the methods of the Image class documented in the Doxygen.

Testing

When you’ve finished this part, you can make and run Part 1 by running:

make mp2-1
./mp2-1

If execution goes smoothly, images named lighten.png, saturate.png, and scale2x.png will be created in your working directory.

Automated Testing

To test your code using Catch, run the following:

make test
./test

MP 2: Extra Credit Submission

For a few bonus points, you can submit the code you have implemented and tested for part one of MP 2. You must submit your work before the extra credit deadline (given above). Although this is optional, we encourage everyone to do this for a couple reasons:

Be sure your working directory is the mp2 directory that was created when you checked out the code. To hand in your code, you first need to add the new files you created to the working copy of your repository with the following commands:

svn add Makefile
svn add Image.cpp
svn add Image.h

To commit your changes to the repository type:

svn ci -m "mp2.1 submission"

Part 2 (Curated): The StickerSheet Class

Lets add stickers on top of an image!

Your goal in this part of the MP is to make a StickerSheet composed of a collection of Images. To do so, you will create a class StickerSheet that will maintain an array of pointers to Image objects. Each Image in the Scene will have an index, an $$x$$-coordinate, and a $$y$$-coordinate. The member functions described below will support creating, modifying, and drawing the collection of Image stickers in the StickerSheet.

To implement the StickerSheet class, you will write a header file that contains a declaration of the StickerSheet class (StickerSheet.h) and a source file that contains the implementation of the StickerSheet class (StickerSheet.cpp).

To see all the required functions, check out the Doxygen for MP2.

Part 3 (Creative): Create an image with stickers!

For the last part of this MP, in the main function in main.cpp create a StickerSheet that contains an image and at least three stickers. Before exiting main, save your creation to disk as myImage.png.

We’ll take a look at your photo filled of stickers! Keep it clean and something you’re okay being shared with the class so we can show the best ones off to the whole class! :)

Testing

When you’ve finished Part 2 and Part 3, you can make the full MP by running:

make test
./test

Automated Testing

To test your code using Catch, you will need to enable the Part 2 test cases. To do so, go into tests/unit_test.cpp and uncomment the commented section at end of the file.

As you saw when you uncommented the test case, the test case is deliberately insufficient. We strongly recommend augmenting these tests with your own.

Once you’re ready to run the automated tests, run:

make test
./test

Handing in your code

The following commands add the files to your mp2 working copy:

svn add Image.cpp
svn add Image.h
svn add StickerSheet.cpp
svn add StickerSheet.h
svn add myImage.png

To commit your changes to the repository type:

svn commit -m "mp2 submission"

Grading Information

The following files are used to grade mp2:

All other files including any testing files you have added will not be used for grading.