CPSC362A
Video Game Development

Activity 14

Images

Create a C++ program that reads a binary ppm file.

Details

The program should read a binary ppm file and print the rgb values of all of the pixels.

Example

$ cat activity14.ppm
P6
# 2 by 2 image of red, green, blue, and yellow
2 2
255
�����
$ ./activity14 activity14.ppm
255 0 0
0 255 0
0 0 255
255 255 0