MP 1 Image Manipulation

Doxygen for MP 1

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!


Ready, Set

Before starting this MP, make sure you have finished lab_intro.

  • Copy your HSLAPixel.cpp and HSLAPixel.h files from lab_intro into mp1.

  • Just like in lab_intro, these files both go into the cs225 directory within the assignment folder.

Lets Go!

This MP is the only one-week MP in CS 225 and is designed to get you set up for future MPs.

Part 1: Getting the files

As with all assignemnts in CS 225, you can download the files by running the following command in your cs225 svn directory:

svn up 

If something goes wrong, our SVN Reference has common problems and fixes for you!

No SVN

If you do not have an account on the svn server, you can still work on this MP by downloading the source files from mp1.zip.

Part 2: Create a Makefile

In CS 225, we feel it’s important you understand how a C++ program compiles.

Go through the Makefile Tutorial and create a Makefile for this assignemnt. You may find the lab_intro Makefile useful as a reference.

Your Makefile must compile together your own solution files, namely main.cppmp1.cppmp1.h, and files in the cs225directory. Do not have typos in your file names or your Makefile! For example, make sure your Makefile compiles a file named main.cpp, not a file named main.C or test.cpp or any other such thing.

Please make sure your Makefile does not compile extra files that are not part of this MP. For example, do not add in files from the Makefile tutorial by mistake; the only files the Makefile should be dealing with are the few listed in the paragraph above.

Your Makefile must produce an executable called mp1 (all lowercase).

Hint: Makefile for testing

After creating a Makefile that builds mp1, the following two lines can be added to the end of your Makefile so that you can also build the test cases:

test : unit_tests.o mp1.o PNG.o HSLAPixel.o lodepng.o $(LD) unit_tests.o mp1.o PNG.o HSLAPixel.o lodepng.o $(LDFLAGS) -o test

unit_tests.o : tests/unit_tests.cpp tests/catch.hpp cs225/PNG.h cs225/HSLAPixel.h $(CXX) $(CXXFLAGS) tests/unit_tests.cpp

Part 3: Rotate an Image

Open mp1.cpp and complete the rotate function. This function must:

  • Read in inputFile,
  • Rotate the image 180 degrees,
  • Write the rorated image out as outputFile