The Bilinear Interpolation is a simple program written in MIPS assembly language using MARS Simulator. Program allows user to specify width and height of a drawn rectangle as well as four colors of every vertices in order : upper left, upper right, lower left, lower right. Output rectangle is saved in heap address range and can be displayed using build-in MARS Bitmap Display set with a width parameter to 1024. Program works in a loop untill wrong input is supplied.
Parameter | Description |
---|---|
width | The width of a drawn rectangle. Value range between <0; 1024>. |
height | The height of a drawn rectangle. Value range arbitrary but depending from a MARS Bitmap Display configurations. |
color | Color of a upper left vertex. RGB value specified as a decimal value. |
color | Color of a upper right vertex. RGB value specified as a decimal value. |
color | Color of a lower left vertex. RGB value specified as a decimal value. |
color | Color of a lower right vertex. RGB value specified as a decimal value. |
Beware that program checks only if the input is a positive value it does not check the upper limit bound of the input!
Below you can see example of output for :
Input | Value |
---|---|
width | 800 |
height | 500 |
color | 255 (Blue) |
color | 65280 (Grenn) |
color | 16711680 (Red) |
color | 16711935 (Magenda) |
Output :
- Fixed point arithmetic 16.16 was used.
- Desctiption of an algorithm can be found on Wikipedia website ( https://en.wikipedia.org/wiki/Bilinear_interpolation )