]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - dpvsimpledecode.h
added Cvar_UnlockDefaults function (not console accessible)
[xonotic/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 framerate of the stream
38 double dpvsimpledecode_getframerate(void *stream);
39
40 // decodes a video frame to the supplied output pixels
41 int dpvsimpledecode_video(void *stream, void *imagedata, unsigned int Rmask, unsigned int Gmask, unsigned int Bmask, unsigned int bytesperpixel, int imagebytesperrow);
42
43 #endif