Write a C program to generate an analog gauge. It will be called as part of a CGI script. The gauge should be clear and simple but look good. The colours should be configurable. We would agree a mock up first. A function should be provided with parameters like this:
draw_gauge(width, height, max, current_value, output_buffer, fore_colour, back_colour, tick_colour)
Typical size would be 200 x 200. I would prefer a few fixed size gauges that look good at say 160x160 200x200 280x280 rather than a crude looking but fully scalable one.
The gauge image should look like these examples of possible images [login to view URL]
or [login to view URL]
The program should be web CGI compatible and be supplied with a cgi script to generate a 1 second server push page which will draw the gauge on a simple page on a client browser.
The main function will generate a GIF file as part of a cgi function. The code must be written in standard C. A simple cgi script should be used to demonstrate the program. It could have a edit box with a value that gets used to generate the needle position on the gauge (like a automobile speedometer). The C function (cgi program) will write the giff ormat to stdout as per the CGI protocol. You will need to understand the basic principle of CGI web page creation.