# 程序代写代做代考 mips 作业 Minecraft-Texturen

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.

3． Also implement a routine store_img that gets the Arguments height and width of the

image and a point from the user data and then generates an image file

1. Resolution in each dimension changes by a factor of two, you can calculate a new pixel

from 4 neighboring pixels. For example, the image a0 with a resolution of 2 × 2 pixels can

be calculated from the image a with a resolution of 4 × 4 pixels.

2. Keep in mind that the resolution must also change color values.

1. Implement an routine interpolate2 that reduces the resolution of an image by a factor

of two. The routine receives as arguments

b) height and width of the image.

2. Implement a routine interpolate that reduces the resolution of an image by a factor of

1. The given pictures have a Color depth of 8 bits. The reduction in color depth should also

be in 2 的幂 (8 bits, 4 bits, 2 bits,1 bit). 这意味要用

2 的 4 次方 来替换 2 的八次方 Grayscale

1. Implement a routine quantize takes as arguments

a) the memory address of the image,

b) the width / height of the image,

c) and a quantization factor.

（3 分）

1. If you want to reduce the resolution as well as the color depth in an image, there are two

possibilities: either first reduce the resolution and then the color depth or otherwise.

1. 尝试两种方式，并说明结果

2. 有区别吗？为什么呢？根据您的程序说明结果。