|
The image server that you can download from this page is a slightly modified version of the image server included in the UASRSim package. The server code is the same however this version also supports UT running in client mode.
Copy the following files in the UT2004/System directory:
ImageSrv.exe
FreeImage.dll
Hook.dll
If you want to use the image server in the usual way do the following:
Remember: you must run image server on the same machine where UT server is running.
If you plan to use USARSim in client mode, then do the following:
Image Server simulates web camera. Its workflow is:
The server supports both raw picture and jpeg picture. The image data format is:
ImageType (1 byte) + ImageSize (4 bytes) + ImageData (n bytes)
Where ImageType is the format of the image. It can be:
0 raw data
1 jpeg in super quality
2 jpeg in good quality
3 jpeg in normal quality
4 jpeg in averagequality
5 jpeg in bad quality
ImageSize is the total length of ImageData in bytes.
ImageData is the actual data of the image. For raw data, the ImageData is:
width (2 bytes) + height (2 bytes) + RGB (1 byte + 1 byte + 1 byte) data from left to right, from top to bottom. For jpeg, the ImageData is the real jpeg data which can be decompressed by any jpeg decoders.
The image transfer protocol is very simple. When the client got the image, it sends back acknowledgement meesage 'OK' (in plain text) to the image server. To use the image server, you only need to follow the simple protocol and the image format. As an example of how to use image server, the source code of SimpleUI is included in the USARSim package. The SimpleUI uses the FreeImage (http://sourceforge.net/projects/freeimage) DLL to decode jpeg pictures.
ImageSrv.rar (1.28Mb)