Main / P1Sample - CS559 2007
The Picture Processor Sample Solution
We have built an example solution for the project. The binary is available (coming soon) so you can play with it and see what your project should do. The example doesn't implement all of the optional features, and doesn't necessarily provide exemplary implementations of all the functions. But it should be good enough for you to figure out what is going on.
We also are providing you with some of the source code. You are free to use it for your own project. We explicitly designed the implementation so that it is easy to add new commands to it. So, all you need to do is to take the example project and start adding new commands to implement the ones we didn't give to you!
A zip file containing everything you need to get started adding to the sample code is (coming soon). We've even included the visual studio project and solution files.
It should be possible to complete the project only by adding code to the example code. You don't need to edit the example code files. If you do make changes, please explain it in your project documentation.
In fact, you are better off avoiding making changes to the provided files. That way if there are updates, you can simply plug them in.
Note: the example solution reads commands until it gets to an end of file. For the console under windows, and end of file is created by hitting CTRL-Z.
You can download the whole thing here as a single 21K zip file.
Example Code Overview
The example code provides the interpreter for the scripting language, and a few example commands (including reading and writing images).
The files are:
The project also includes the files for LibTarga and TargaImage (as documented in Main.Tutorial5).
For completeness, we've also given you the Visual Studio 2005 files for building the project (the same files you need to turn in)
These files were built by following the directions in Main.Tutorial1.
Download the whole thing here as a single 21K zip file.
Adding to the Example Solution
As provided, the example solution only implements 6 commands (info, test, blank, write, read, darken). You will need to add a whole bunch more.
You should be able to add new commands without modifying the existing files.
To add a new command, define a new class that is a subclass of
A warning: sometimes, when you add a new global variable, visual studio gets confused and doesn't call the constructor in the right order. If you've added a new command and it isn't showing up (the program prints a list when it starts), you might need to do a "Rebuild All" in VS2005.
The "guts" of your implementation will be in the
From the six example commands you should be able to figure out enough of the mechanics so that you can spend your time writing the image processing operations, not the parsing.