CLAHE Python bindings
[profile/ivi/opencv.git] / modules / highgui / src / precomp.hpp
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 "cvconfig.h"
46
47 #include "opencv2/highgui/highgui.hpp"
48 #include "opencv2/highgui/highgui_c.h"
49 #include "opencv2/imgproc/imgproc_c.h"
50 #include "opencv2/core/internal.hpp"
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 WINCE
60     #include <windows.h>
61     #undef small
62     #undef min
63     #undef max
64     #undef abs
65 #endif
66
67 #ifdef HAVE_TEGRA_OPTIMIZATION
68 #include "opencv2/highgui/highgui_tegra.hpp"
69 #endif
70
71 /* Errors */
72 #define HG_OK          0 /* Don't bet on it! */
73 #define HG_BADNAME    -1 /* Bad window or file name */
74 #define HG_INITFAILED -2 /* Can't initialize HigHGUI */
75 #define HG_WCFAILED   -3 /* Can't create a window */
76 #define HG_NULLPTR    -4 /* The null pointer where it should not appear */
77 #define HG_BADPARAM   -5
78
79 #define __BEGIN__ __CV_BEGIN__
80 #define __END__  __CV_END__
81 #define EXIT __CV_EXIT__
82
83 #define CV_WINDOW_MAGIC_VAL     0x00420042
84 #define CV_TRACKBAR_MAGIC_VAL   0x00420043
85
86 /***************************** CvCapture structure ******************************/
87
88 struct CvCapture
89 {
90     virtual ~CvCapture() {}
91     virtual double getProperty(int) { return 0; }
92     virtual bool setProperty(int, double) { return 0; }
93     virtual bool grabFrame() { return true; }
94     virtual IplImage* retrieveFrame(int) { return 0; }
95     virtual int getCaptureDomain() { return CV_CAP_ANY; } // Return the type of the capture object: CV_CAP_VFW, etc...
96 };
97
98 /*************************** CvVideoWriter structure ****************************/
99
100 struct CvVideoWriter
101 {
102     virtual ~CvVideoWriter() {}
103     virtual bool writeFrame(const IplImage*) { return false; }
104 };
105
106 CvCapture * cvCreateCameraCapture_V4L( int index );
107 CvCapture * cvCreateCameraCapture_DC1394( int index );
108 CvCapture * cvCreateCameraCapture_DC1394_2( int index );
109 CvCapture* cvCreateCameraCapture_MIL( int index );
110 CvCapture* cvCreateCameraCapture_Giganetix( int index );
111 CvCapture * cvCreateCameraCapture_CMU( int index );
112 CV_IMPL CvCapture * cvCreateCameraCapture_TYZX( int index );
113 CvCapture* cvCreateFileCapture_Win32( const char* filename );
114 CvCapture* cvCreateCameraCapture_VFW( int index );
115 CvCapture* cvCreateFileCapture_VFW( const char* filename );
116 CvVideoWriter* cvCreateVideoWriter_Win32( const char* filename, int fourcc,
117                                           double fps, CvSize frameSize, int is_color );
118 CvVideoWriter* cvCreateVideoWriter_VFW( const char* filename, int fourcc,
119                                         double fps, CvSize frameSize, int is_color );
120 CvCapture* cvCreateCameraCapture_DShow( int index );
121 CvCapture* cvCreateCameraCapture_MSMF( int index );
122 CvCapture* cvCreateCameraCapture_OpenNI( int index );
123 CvCapture* cvCreateFileCapture_OpenNI( const char* filename );
124 CvCapture* cvCreateCameraCapture_Android( int index );
125 CvCapture* cvCreateCameraCapture_XIMEA( int index );
126 CvCapture* cvCreateCameraCapture_AVFoundation(int index);
127
128
129 CVAPI(int) cvHaveImageReader(const char* filename);
130 CVAPI(int) cvHaveImageWriter(const char* filename);
131
132 CvCapture* cvCreateFileCapture_Images(const char* filename);
133 CvVideoWriter* cvCreateVideoWriter_Images(const char* filename);
134
135 CvCapture* cvCreateFileCapture_XINE (const char* filename);
136
137
138
139
140 #define CV_CAP_GSTREAMER_1394           0
141 #define CV_CAP_GSTREAMER_V4L            1
142 #define CV_CAP_GSTREAMER_V4L2           2
143 #define CV_CAP_GSTREAMER_FILE           3
144
145 CvCapture* cvCreateCapture_GStreamer(int type, const char *filename);
146 CvCapture* cvCreateFileCapture_FFMPEG_proxy(const char* filename);
147
148
149 CvVideoWriter* cvCreateVideoWriter_FFMPEG_proxy( const char* filename, int fourcc,
150                                             double fps, CvSize frameSize, int is_color );
151
152 CvCapture * cvCreateFileCapture_QT (const char  * filename);
153 CvCapture * cvCreateCameraCapture_QT  (const int     index);
154
155 CvVideoWriter* cvCreateVideoWriter_QT ( const char* filename, int fourcc,
156                                         double fps, CvSize frameSize, int is_color );
157
158 CvCapture* cvCreateFileCapture_AVFoundation (const char * filename);
159 CvVideoWriter* cvCreateVideoWriter_AVFoundation( const char* filename, int fourcc,
160                                                 double fps, CvSize frameSize, int is_color );
161
162
163 CvCapture * cvCreateCameraCapture_Unicap  (const int     index);
164 CvCapture * cvCreateCameraCapture_PvAPI  (const int     index);
165 CvVideoWriter* cvCreateVideoWriter_GStreamer( const char* filename, int fourcc,
166                                             double fps, CvSize frameSize, int is_color );
167
168 //Yannick Verdie 2010
169 void cvSetModeWindow_W32(const char* name, double prop_value);
170 void cvSetModeWindow_GTK(const char* name, double prop_value);
171 void cvSetModeWindow_CARBON(const char* name, double prop_value);
172 void cvSetModeWindow_COCOA(const char* name, double prop_value);
173
174 double cvGetModeWindow_W32(const char* name);
175 double cvGetModeWindow_GTK(const char* name);
176 double cvGetModeWindow_CARBON(const char* name);
177 double cvGetModeWindow_COCOA(const char* name);
178
179 double cvGetPropWindowAutoSize_W32(const char* name);
180 double cvGetPropWindowAutoSize_GTK(const char* name);
181
182 double cvGetRatioWindow_W32(const char* name);
183 double cvGetRatioWindow_GTK(const char* name);
184
185 double cvGetOpenGlProp_W32(const char* name);
186 double cvGetOpenGlProp_GTK(const char* name);
187
188 //for QT
189 #if defined (HAVE_QT)
190 double cvGetModeWindow_QT(const char* name);
191 void cvSetModeWindow_QT(const char* name, double prop_value);
192
193 double cvGetPropWindow_QT(const char* name);
194 void cvSetPropWindow_QT(const char* name,double prop_value);
195
196 double cvGetRatioWindow_QT(const char* name);
197 void cvSetRatioWindow_QT(const char* name,double prop_value);
198
199 double cvGetOpenGlProp_QT(const char* name);
200 #endif
201
202
203
204 /*namespace cv
205 {
206
207 class CV_EXPORTS BaseWindow
208 {
209 public:
210     BaseWindow(const String& name, int flags=0);
211     virtual ~BaseWindow();
212     virtual void close();
213     virtual void show(const Mat& mat);
214     virtual void resize(Size size);
215     virtual void move(Point topleft);
216     virtual Size size() const;
217     virtual Point topLeft() const;
218     virtual void setGeometry(Point topLeft, Size size);
219     virtual void getGeometry(Point& topLeft, Size& size) const;
220     virtual String getTitle() const;
221     virtual void setTitle(const String& str);
222     virtual String getName() const;
223     virtual void setScaleMode(int mode);
224     virtual int getScaleMode();
225     virtual void setScrollPos(double pos);
226     virtual double getScrollPos() const;
227     virtual void setScale(double scale);
228     virtual double getScale() const;
229     virtual Point getImageCoords(Point pos) const;
230     virtual Scalar getPixelValue(Point pos, const String& colorspace=String()) const;
231
232     virtual void addTrackbar( const String& trackbar, int low, int high, int step );
233 };
234
235 typedef Ptr<BaseWindow> Window;
236
237 }*/
238
239 #endif /* __HIGHGUI_H_ */