Minecraft-Texturen
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
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
2 7
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
a) the memory address
b) height and width of the image.
2. Implement a routine interpolate that reduces the resolution of an image by a factor of
3 3
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.
4
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.
Minecraft-Texturen
MIPS
vorgabe.s
Ha01
1: Load and save images 7
2 7
3 3
4 3
Reviews
There are no reviews yet.