在本次作业中,您将开发一个 MIPS 汇编程序,包含降低分辨率和降低数字图像 的色彩深度。
程序框架见 vorgabe.s 图像见 Ha01 文件夹
作业 1: Load and save images (7 分)
1. An image can be stored in the memory as an array by continuously storing the individual lines with image points one behind the other.
2. At the beginning of the image there is also a header, which contains the width, height and color depth, which is the number of colors.
1.Your program should be able to read and write image files in the PGM format (binary, P5). a) 提示:To read and write files, QtSPIM, similar, or other operating system, provides different syscalls. You must calculate the value of the number from a string of digits.
To do this You need an ASCII table.
2.Implement a routine load_img that loads an image and processes the header