


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A project for extending the functionality of the image class in c++ to include member functions for scaling, reading, writing, rotating 90 degrees clockwise, and rotating 90 degrees counter clockwise. The image to be modified is a jpeg file located in the /data directory, which will be converted to the ppm format for manipulation. The format of the ppm file, including its limitations and the conversion process between jpeg and ppm formats.
Typology: Assignments
1 / 4
This page cannot be seen from the preview
Don't miss anything!



nd
For this assignment you will be extending image.hpp functionality to take an image and write member functions for the class Image to scale, read, write, rotate 90 clockwise and rotate 90 counter clockwise.
The image that you will use is in the /data directory of your directory structure, and it is of JPEG format. If you would like to view the image, you can simply open it up in paint/gimp or a similar program that supports JPEG images. You will not be doing direct manipulation on the JPEG file format itself but converted format called PPM (Portable Pixel Map). This format is much larger in size than the JPEG format, however it is much easier to manipulate and process (and human readable). There are different versions of the PPM file format, and the one we will be using for this project is ‘plain PPM format’. This is like the raw PPM file format except that ‘plain PPM’ has some limitations on the format of the image.
Ex) Example of ‘plain PPM’ format
P 4 4 15 0 0 0 0 0 0 0 0 0 15 0 15 0 0 0 0 15 7 0 0 0 0 0 0 0 0 0 0 0 0 0 15 7 0 0 0 15 0 15 0 0 0 0 0 0 0 0 0
Don’t worry about the P3, this is just a magic number that designates the type of file format, in this case it is ppm. If the input is not a plain ppm, you should exit after printing an error. As you may have noticed the file is broken up into a simple format.
To convert, between JPEG format and PPM then to PPM –plain and back to JPEGformat is done by the following commands.
If you would like to read further about this file format you can view these links.
Implementation:
Ex)
Ex)
Your projects directory structure:
Getting Started:
Input and Output Format: