4d069d1593452d3f1ee7502d28b7ac97650512a1
[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 #define CV_CAPTURE_BASE_API_COUNT 6
75
76 typedef void         (CV_CDECL* CvCaptureCloseFunc)         ( CvCapture* capture );
77 typedef int          (CV_CDECL* CvCaptureGrabFrameFunc)     ( CvCapture* capture );
78 typedef IplImage   * (CV_CDECL* CvCaptureRetrieveFrameFunc) ( CvCapture* capture );
79 typedef double       (CV_CDECL* CvCaptureGetPropertyFunc)   ( CvCapture* capture, int id );
80 typedef int          (CV_CDECL* CvCaptureSetPropertyFunc)   ( CvCapture* capture,
81                                                               int id, double value );
82 typedef const char * (CV_CDECL* CvCaptureGetDescriptionFunc)( CvCapture* capture );
83
84 typedef struct CvCaptureVTable
85 {
86     int                           count;
87     CvCaptureCloseFunc            close;
88     CvCaptureGrabFrameFunc        grab_frame;
89     CvCaptureRetrieveFrameFunc    retrieve_frame;
90     CvCaptureGetPropertyFunc      get_property;
91     CvCaptureSetPropertyFunc      set_property;
92     CvCaptureGetDescriptionFunc   get_description;
93 }
94 CvCaptureVTable;
95
96 typedef struct CvCapture
97 {
98     CvCaptureVTable* vtable;
99 }
100 CvCapture;
101
102 extern "C" {
103
104 typedef CvCapture* (CV_CDECL * CvCaptureFromFile)( const char* filename );
105
106 typedef CvVideoWriter* (CV_CDECL * CvCreateVideoWriter)( const char * filename,
107         int fourcc, double fps, CvSize frameSize, int is_color );
108
109 typedef int (CV_CDECL * CvWriteFrame)( CvVideoWriter * writer, const IplImage * image );
110
111 typedef void (CV_CDECL * CvReleaseVideoWriter)( CvVideoWriter ** writer );
112
113 }
114
115 #ifdef WIN32
116 #define HAVE_VFW 1
117
118 /* uncomment to enable OpenEXR codec (will not compile under MSVC6) */ 
119 //#define HAVE_ILMIMF 1
120
121 /* uncomment to enable CMUCamera1394 fireware camera module */
122 //#define HAVE_CMU1394 1
123 #endif
124
125
126 #if defined (HAVE_CAMV4L) || defined (HAVE_CAMV4L2)
127 CvCapture * cvCaptureFromCAM_V4L( int index );
128 #endif
129
130 #ifdef HAVE_DC1394
131 CvCapture * cvCaptureFromCAM_DC1394( int index );
132 #endif
133
134 #ifdef HAVE_MIL
135 CvCapture* cvCaptureFromCAM_MIL( int index );
136 #endif
137
138 #ifdef HAVE_CMU1394
139 CvCapture * cvCaptureFromCAM_CMU( int index );
140 #endif
141
142 #ifdef HAVE_TYZX
143 CV_IMPL CvCapture * cvCaptureFromCAM_TYZX( int index );
144 #endif
145
146 #ifdef WIN32
147 CvCapture* cvCaptureFromFile_Win32( const char* filename );
148
149 CvCapture* cvCaptureFromCAM_VFW( int index );
150 CvCapture* cvCaptureFromFile_VFW( const char* filename );
151
152 CvVideoWriter* cvCreateVideoWriter_VFW( const char* filename, int fourcc,
153                                         double fps, CvSize frameSize, int is_color );
154 int cvWriteFrame_VFW( CvVideoWriter* _writer, const IplImage* image );
155 void cvReleaseVideoWriter_VFW( CvVideoWriter** writer );
156
157 #endif
158
159 #ifdef HAVE_XINE
160 CvCapture* cvCaptureFromFile_XINE   (const char* filename);
161 #endif
162
163 #ifdef HAVE_FFMPEG
164 CvCapture* cvCaptureFromFile_FFMPEG (const char* filename);
165 #endif
166
167 #ifdef HAVE_QUICKTIME
168 CvCapture * cvCaptureFromFile_QT (const char  * filename);
169 CvCapture * cvCaptureFromCAM_QT  (const int     index);
170 #endif
171
172 #endif /* __HIGHGUI_H_ */