Comp 170 Programming Assignment
BMP Files
Purposes
- To
give the student practice working with binary file IO. Bitmap files are
being used as a manor of keeping your interest. Just like any file that conforms to a standard
file format, a bit-map file can be read and manipulated as long as the
programmer understands that format.
- To
give the student practice working with C++ structs.
- To
give students practice working with dynamic memory allocation
You will specifically be working with 24-bit bit-map files
made in MSPAINT. Not all bit-map files
are made alike. Depending on the number
of colors and the resolution of the image the bit-map file format will
vary.
The specification of the bit-map file format can be found
at:
http://www.fortunecity.com/skyscraper/windows/364/bmpffrmt.html
Remember to only consider the 24-bit version.
Program Requirements
- Ask
for a bit-map file name from the user.
- Open
the file. Close the file when
appropriate.
- If the
file does not exist give the user an error message then exit the program.
- If the
file exists give the user the options to:
- Display
File Specifications. (The file headers displayed neatly with labels.)
- Rotate
Image 90 deg (clockwise)
- Rotate
Image 180 deg
- Rotate
Image 270 deg (clockwise)
- Flip
image horizontal
- Flip
image vertical
- Reverse
order of all of the pixels in the picture.
- Invert
Colors
- Add
salt and pepper
- Double
the size of the Picture (Same image, 4 times the pixels)
- Exit
the Program
- Use the
numbers above as the menu options for the user commands.
- The
user should able to perform multiple file operations to a single image
before exiting the program.
- Use
good variable names and functions where appropriate.
Grading
- You
start with 100 points
- -10
points per file operation that does not work correctly
- -10
points if the menus do not match the ones given above
- -10
points if you forget to check to see if the file exists
- Points
will be deducted for poor variable names, function names, and/or poor structure
of the code.
Examples:
Kids.bmp
KidsDoubleSize.bmp
KidsFlipHorizontal.bmp
KidsFlipVertical.bmp
KidsInvertColors.bmp
KidsReverse.bmp
KidsRotate90.bmp
KidsRotate180.bmp
KidsRotate270.bmp
KidsSaltAndPepper.bmp