In this project you will use C++ to represent and process RGB color images with 8-bits per RGB channel. For that you will work (mainly) with 3 separate types of classes:
- prog::Color to represent RGB colors;
- prog::Image to represent images as 2D Matrix where individual pixels are represented by Color;
- prog::Script to process scripts that contain image manipulation commands;
Initial files are already provided and some of them mustn't (and needn't) be changed.
- Color.cpp: class implementation of Color.h
- Color.hpp: header file for class declaration (Interface)
Default ConstructorCopy ConstructorConstructor with valuesAccessors for each attributeMutators for each attribute- ...
- Image.cpp: class implementation of Image.h
- Image.hpp: header file for class declaration (Interface)
Constructor with (width, height, possible initial color)Destructor (especially if dynamically allocated)Accessors for width and heightMutator for a specific Color pixel (element)Accessor for a specific Color pixel (element)- ...
- Script.cpp: class implementation of Script.h
- Script.hpp: header file for class declaration (Interface)
Constructor and DestructorInitializationa and I/O- run() : Command processor
Image manipulation (keeping dimensions)Invert the colorsGrayscale the colorsReplace one color by otherMirror image horizontallyMirror image verticallyCopy all (non-neutral) pixels from an image into another image
Image manipulation (changing dimensions)Crop the imageRotate to the leftRotate to the right
Median Filter (advanced functionality)
- XPM2.cpp: class implementation of Color.h
- XPM2.hpp: header file for class declaration (Interface)
Opening an XPM2 file into an object of ImageSave an Image object into an XPM2 file
The stable branch should only be changed after implementation and approval of the changes in the code.
When you are going to implement something new, make sure to start by pulling the stable branch and then working on a separate (experimental) branch, so that multiple people can tweak the code at the same time without conflicts.
> cd ProjectProg/
> git pull origin stable
> git checkout -b <your_branch_name>
When you are done with the tweaking, commit your changes and generate a pull request for analysis.
> git add <filename of the tweaked files>
> git commit -m "<your message>"
> git push -u origin <your_branch_name>
You can then refresh this github repo, see your changes and create the pull request.
Note: after doing this merging, you should probably change your branch back to stable and delete that branch
> git checkout stable
> git branch -d <your_branch_name>
After downloading the program, run
> cd ProjectProg/
> make
To generate the proper runscript and test files. These can later be recompiled after running > make clean all.
> ./runscript <filename>.txt [<filename>.txt ...]
Is used to run one or more specific test scripts
> ./test [Color / Basic / <command>]
Is used to run all test scripts related to Color, Basic I/O or a specific command. If no arguments are passed, it runs all of the test scripts.