Update to 2.0.0 tree from current Fremantle build
[opencv] / src / 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 #if _MSC_VER >= 1200
46 #pragma warning( disable: 4251 )
47 #endif
48
49 #include "highgui.h"
50 #include "cxmisc.h"
51
52 #include <stdlib.h>
53 #include <stdio.h>
54 #include <string.h>
55 #include <limits.h>
56 #include <ctype.h>
57 #include <assert.h>
58
59 #if !defined WIN32 && !defined _WIN32
60 #include "cvconfig.h"
61 #else
62 void  FillBitmapInfo( BITMAPINFO* bmi, int width, int height, int bpp, int origin );
63 #endif
64
65 /* Errors */
66 #define HG_OK          0 /* Don't bet on it! */
67 #define HG_BADNAME    -1 /* Bad window or file name */
68 #define HG_INITFAILED -2 /* Can't initialize HigHGUI. Possibly, can't find vlgrfmts.dll */
69 #define HG_WCFAILED   -3 /* Can't create a window */
70 #define HG_NULLPTR    -4 /* The null pointer where it should not appear */
71 #define HG_BADPARAM   -5
72
73 #define CV_WINDOW_MAGIC_VAL     0x00420042
74 #define CV_TRACKBAR_MAGIC_VAL   0x00420043
75
76 /***************************** CvCapture structure ******************************/
77
78 struct CvCapture
79 {
80     virtual ~CvCapture() {}
81     virtual double getProperty(int) { return 0; }
82     virtual bool setProperty(int, double) { return 0; }
83     virtual bool grabFrame() { return true; }
84     virtual IplImage* retrieveFrame(int) { return 0; }
85     virtual IplImage* queryFrame() { return grabFrame() ? retrieveFrame(0) : 0; }
86         virtual int getCaptureDomain() { return CV_CAP_ANY; } // Return the type of the capture object: CV_CAP_VFW, etc...
87 };
88
89 /*************************** CvVideoWriter structure ****************************/
90
91 struct CvVideoWriter
92 {
93     virtual ~CvVideoWriter() {}
94     virtual bool writeFrame(const IplImage*) { return false; }
95 };
96
97 #if defined WIN32 || defined _WIN32
98 #define HAVE_VFW 1
99
100 #if (_MSC_VER >= 1400 || defined __GNUC__) && !defined WIN64 && !defined _WIN64
101 #define HAVE_VIDEOINPUT 1
102 #endif
103
104 /* uncomment to enable OpenEXR codec (will not compile under MSVC6) */
105 //#define HAVE_ILMIMF 1
106
107 /* uncomment to enable CMUCamera1394 fireware camera module */
108 //#define HAVE_CMU1394 1
109 #endif
110
111
112 CvCapture * cvCreateCameraCapture_V4L( int index );
113 CvCapture * cvCreateCameraCapture_DC1394( int index );
114 CvCapture * cvCreateCameraCapture_DC1394_2( int index );
115 CvCapture* cvCreateCameraCapture_MIL( int index );
116 CvCapture * cvCreateCameraCapture_CMU( int index );
117 CV_IMPL CvCapture * cvCreateCameraCapture_TYZX( int index );
118 CvCapture* cvCreateFileCapture_Win32( const char* filename );
119 CvCapture* cvCreateCameraCapture_VFW( int index );
120 CvCapture* cvCreateFileCapture_VFW( const char* filename );
121 CvVideoWriter* cvCreateVideoWriter_Win32( const char* filename, int fourcc,
122                                           double fps, CvSize frameSize, int is_color );
123 CvVideoWriter* cvCreateVideoWriter_VFW( const char* filename, int fourcc,
124                                         double fps, CvSize frameSize, int is_color );
125 CvCapture* cvCreateCameraCapture_DShow( int index );
126
127 CVAPI(int) cvHaveImageReader(const char* filename);
128 CVAPI(int) cvHaveImageWriter(const char* filename);
129
130 CvCapture* cvCreateFileCapture_Images(const char* filename);
131 CvVideoWriter* cvCreateVideoWriter_Images(const char* filename);
132
133 CvCapture* cvCreateFileCapture_XINE (const char* filename);
134
135 #define CV_CAP_GSTREAMER_1394           0
136 #define CV_CAP_GSTREAMER_V4L            1
137 #define CV_CAP_GSTREAMER_V4L2           2
138 #define CV_CAP_GSTREAMER_FILE           3
139
140 CvCapture * cvCreateCapture_GStreamer(int type, const char *filename);
141 CvCapture* cvCreateFileCapture_FFMPEG (const char* filename);
142
143 CvVideoWriter* cvCreateVideoWriter_FFMPEG ( const char* filename, int fourcc,
144                                             double fps, CvSize frameSize, int is_color );
145
146 CvCapture * cvCreateFileCapture_QT (const char  * filename);
147 CvCapture * cvCreateCameraCapture_QT  (const int     index);
148
149 CvVideoWriter* cvCreateVideoWriter_QT ( const char* filename, int fourcc,
150                                         double fps, CvSize frameSize, int is_color );
151
152 CvCapture * cvCreateCameraCapture_Unicap  (const int     index);
153
154 /*namespace cv
155 {
156
157 class CV_EXPORTS BaseWindow
158 {
159 public:
160     BaseWindow(const String& name, int flags=0);
161     virtual ~BaseWindow();
162     virtual void close();
163     virtual void show(const Mat& mat);
164     virtual void resize(Size size);
165     virtual void move(Point topleft);
166     virtual Size size() const;
167     virtual Point topLeft() const;
168     virtual void setGeometry(Point topLeft, Size size);
169     virtual void getGeometry(Point& topLeft, Size& size) const;
170     virtual String getTitle() const;
171     virtual void setTitle(const String& str);
172     virtual String getName() const;
173     virtual void setScaleMode(int mode);
174     virtual int getScaleMode();
175     virtual void setScrollPos(double pos);
176     virtual double getScrollPos() const;
177     virtual void setScale(double scale);
178     virtual double getScale() const;
179     virtual Point getImageCoords(Point pos) const;
180     virtual Scalar getPixelValue(Point pos, const String& colorspace=String()) const;
181
182     virtual void addTrackbar( const String& trackbar, int low, int high, int step );
183 };
184
185 typedef Ptr<BaseWindow> Window;
186
187 }*/
188
189 #endif /* __HIGHGUI_H_ */