]> icculus.org git repositories - divverent/darkplaces.git/blob - dpvsimpledecode.h
the quadratic spline patches in quake3 maps now work (in english: curves!)
[divverent/darkplaces.git] / dpvsimpledecode.h
1
2 #ifndef DPVSIMPLEDECODE_H
3 #define DPVSIMPLEDECODE_H
4
5 #define DPVSIMPLEDECODEERROR_NONE 0
6 #define DPVSIMPLEDECODEERROR_EOF 1
7 #define DPVSIMPLEDECODEERROR_READERROR 2
8 #define DPVSIMPLEDECODEERROR_SOUNDBUFFERTOOSMALL 3
9 #define DPVSIMPLEDECODEERROR_INVALIDRMASK 4
10 #define DPVSIMPLEDECODEERROR_INVALIDGMASK 5
11 #define DPVSIMPLEDECODEERROR_INVALIDBMASK 6
12 #define DPVSIMPLEDECODEERROR_COLORMASKSOVERLAP 7
13 #define DPVSIMPLEDECODEERROR_COLORMASKSEXCEEDBPP 8
14 #define DPVSIMPLEDECODEERROR_UNSUPPORTEDBPP 9
15
16 // opening and closing streams
17
18 // opens a stream
19 void *dpvsimpledecode_open(char *filename, char **errorstring);
20 // closes a stream
21 void dpvsimpledecode_close(void *stream);
22
23 // utilitarian functions
24
25 // returns the current error number for the stream, and resets the error
26 // number to DPVDECODEERROR_NONE
27 // if the supplied string pointer variable is not NULL, it will be set to the
28 // error message
29 int dpvsimpledecode_error(void *stream, char **errorstring);
30
31 // returns the width of the image data
32 unsigned int dpvsimpledecode_getwidth(void *stream);
33
34 // returns the height of the image data
35 unsigned int dpvsimpledecode_getheight(void *stream);
36
37 // returns the sound sample rate of the stream
38 unsigned int dpvsimpledecode_getsoundrate(void *stream);
39
40 // returns the framerate of the stream
41 double dpvsimpledecode_getframerate(void *stream);
42
43 // decodes a video frame to the supplied output pixels
44 int dpvsimpledecode_video(void *stream, void *imagedata, unsigned int Rmask, unsigned int Gmask, unsigned int Bmask, unsigned int bytesperpixel, int imagebytesperrow);
45 // reads some sound
46 // (note: sound is 16bit stereo native-endian, left channel first)
47 int dpvsimpledecode_audio(void *stream, short *soundbuffer, int requestedlength);
48
49 #endif