Apply maemo2 patch
[opencv] / otherlibs / highgui / _highgui.h
1 /*M///////////////////////////////////////////////////////////////////////////////////////
2 //
3 //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4 //
5 //  By downloading, copying, installing or using the software you agree to this license.
6 //  If you do not agree to this license, do not download, install,
7 //  copy or use the software.
8 //
9 //
10 //                        Intel License Agreement
11 //                For Open Source Computer Vision Library
12 //
13 // Copyright (C) 2000, Intel Corporation, all rights reserved.
14 // Third party copyrights are property of their respective owners.
15 //
16 // Redistribution and use in source and binary forms, with or without modification,
17 // are permitted provided that the following conditions are met:
18 //
19 //   * Redistribution's of source code must retain the above copyright notice,
20 //     this list of conditions and the following disclaimer.
21 //
22 //   * Redistribution's in binary form must reproduce the above copyright notice,
23 //     this list of conditions and the following disclaimer in the documentation
24 //     and/or other materials provided with the distribution.
25 //
26 //   * The name of Intel Corporation may not be used to endorse or promote products
27 //     derived from this software without specific prior written permission.
28 //
29 // This software is provided by the copyright holders and contributors "as is" and
30 // any express or implied warranties, including, but not limited to, the implied
31 // warranties of merchantability and fitness for a particular purpose are disclaimed.
32 // In no event shall the Intel Corporation or contributors be liable for any direct,
33 // indirect, incidental, special, exemplary, or consequential damages
34 // (including, but not limited to, procurement of substitute goods or services;
35 // loss of use, data, or profits; or business interruption) however caused
36 // and on any theory of liability, whether in contract, strict liability,
37 // or tort (including negligence or otherwise) arising in any way out of
38 // the use of this software, even if advised of the possibility of such damage.
39 //
40 //M*/
41
42 #ifndef __HIGHGUI_H_
43 #define __HIGHGUI_H_
44
45 #include "highgui.h"
46 #include "cxmisc.h"
47
48 #include <stdlib.h>
49 #include <stdio.h>
50 #include <string.h>
51 #include <limits.h>
52 #include <ctype.h>
53 #include <assert.h>
54
55 #ifndef WIN32
56 #include "cvconfig.h"
57 #else
58 void  FillBitmapInfo( BITMAPINFO* bmi, int width, int height, int bpp, int origin );
59 #endif
60
61 /* Errors */
62 #define HG_OK          0 /* Don't bet on it! */
63 #define HG_BADNAME    -1 /* Bad window or file name */
64 #define HG_INITFAILED -2 /* Can't initialize HigHGUI. Possibly, can't find vlgrfmts.dll */
65 #define HG_WCFAILED   -3 /* Can't create a window */
66 #define HG_NULLPTR    -4 /* The null pointer where it should not appear */
67 #define HG_BADPARAM   -5
68
69 #define CV_WINDOW_MAGIC_VAL     0x00420042
70 #define CV_TRACKBAR_MAGIC_VAL   0x00420043
71
72 /***************************** CvCapture structure ******************************/
73
74 struct CvCapture
75 {
76     virtual ~CvCapture() {}
77     virtual double getProperty(int) { return 0; }
78     virtual bool setProperty(int, double) { return 0; }
79     virtual bool grabFrame() { return true; }
80     virtual IplImage* retrieveFrame() { return 0; }
81     virtual IplImage* queryFrame() { return grabFrame() ? retrieveFrame() : 0; }
82 };
83
84 /*************************** CvVideoWriter structure ****************************/
85
86 struct CvVideoWriter
87 {
88     virtual ~CvVideoWriter() {}
89     virtual bool writeFrame(const IplImage*) { return false; }
90 };
91
92 #ifdef WIN32
93 #define HAVE_VFW 1
94
95 /* uncomment to enable OpenEXR codec (will not compile under MSVC6) */
96 //#define HAVE_ILMIMF 1
97
98 /* uncomment to enable CMUCamera1394 fireware camera module */
99 //#define HAVE_CMU1394 1
100 #endif
101
102
103 #if defined (HAVE_CAMV4L) || defined (HAVE_CAMV4L2)
104 CvCapture * cvCreateCameraCapture_V4L( int index );
105 #endif
106
107 #ifdef HAVE_DC1394
108 CvCapture * cvCreateCameraCapture_DC1394( int index );
109 #endif
110
111 #ifdef HAVE_MIL
112 CvCapture* cvCreateCameraCapture_MIL( int index );
113 #endif
114
115 #ifdef HAVE_CMU1394
116 CvCapture * cvCreateCameraCapture_CMU( int index );
117 #endif
118
119 #ifdef HAVE_TYZX
120 CV_IMPL CvCapture * cvCreateCameraCapture_TYZX( int index );
121 #endif
122
123 #ifdef WIN32
124 CvCapture* cvCreateFileCapture_Win32( const char* filename );
125
126 CvCapture* cvCreateCameraCapture_VFW( int index );
127 CvCapture* cvCreateFileCapture_VFW( const char* filename );
128
129 CvVideoWriter* cvCreateVideoWriter_Win32( const char* filename, int fourcc,
130                                           double fps, CvSize frameSize, int is_color );
131 CvVideoWriter* cvCreateVideoWriter_VFW( const char* filename, int fourcc,
132                                         double fps, CvSize frameSize, int is_color );
133 #endif
134
135 CVAPI(int) cvHaveImageReader(const char* filename);
136 CVAPI(int) cvHaveImageWriter(const char* filename);
137
138 CvCapture* cvCreateFileCapture_Images(const char* filename);
139 CvVideoWriter* cvCreateVideoWriter_Images(const char* filename);
140
141 #ifdef HAVE_XINE
142 CvCapture* cvCreateFileCapture_XINE (const char* filename);
143 #endif
144
145 #ifdef HAVE_GSTREAMER
146 #define CV_CAP_GSTREAMER_1394           0
147 #define CV_CAP_GSTREAMER_V4L            1
148 #define CV_CAP_GSTREAMER_V4L2           2
149 #define CV_CAP_GSTREAMER_FILE           3
150
151 CvCapture * cvCreateCapture_GStreamer(int type, const char *filename);
152 #endif
153
154 #ifdef HAVE_FFMPEG
155 CvCapture* cvCreateFileCapture_FFMPEG (const char* filename);
156
157 CvVideoWriter* cvCreateVideoWriter_FFMPEG ( const char* filename, int fourcc,
158                                             double fps, CvSize frameSize, int is_color );
159 #endif
160
161 #ifdef HAVE_QUICKTIME
162 CvCapture * cvCreateFileCapture_QT (const char  * filename);
163 CvCapture * cvCreateCameraCapture_QT  (const int     index);
164
165 CvVideoWriter* cvCreateVideoWriter_QT ( const char* filename, int fourcc,
166                                         double fps, CvSize frameSize, int is_color );
167 #endif
168
169 #ifdef HAVE_UNICAP
170 CvCapture * cvCreateCameraCapture_Unicap  (const int     index);
171
172 #endif
173
174 #endif /* __HIGHGUI_H_ */