1 /*M///////////////////////////////////////////////////////////////////////////////////////
3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
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.
10 // Intel License Agreement
11 // For Open Source Computer Vision Library
13 // Copyright (C) 2000, Intel Corporation, all rights reserved.
14 // Third party copyrights are property of their respective owners.
16 // Redistribution and use in source and binary forms, with or without modification,
17 // are permitted provided that the following conditions are met:
19 // * Redistribution's of source code must retain the above copyright notice,
20 // this list of conditions and the following disclaimer.
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.
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.
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.
46 #pragma warning( disable: 4251 )
59 #if !defined WIN32 && !defined _WIN32
62 void FillBitmapInfo( BITMAPINFO* bmi, int width, int height, int bpp, int origin );
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
73 #define CV_WINDOW_MAGIC_VAL 0x00420042
74 #define CV_TRACKBAR_MAGIC_VAL 0x00420043
76 /***************************** CvCapture structure ******************************/
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...
89 /*************************** CvVideoWriter structure ****************************/
93 virtual ~CvVideoWriter() {}
94 virtual bool writeFrame(const IplImage*) { return false; }
97 #if defined WIN32 || defined _WIN32
100 #if (_MSC_VER >= 1400 || defined __GNUC__) && !defined WIN64 && !defined _WIN64
101 #define HAVE_VIDEOINPUT 1
104 /* uncomment to enable OpenEXR codec (will not compile under MSVC6) */
105 //#define HAVE_ILMIMF 1
107 /* uncomment to enable CMUCamera1394 fireware camera module */
108 //#define HAVE_CMU1394 1
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 );
127 CVAPI(int) cvHaveImageReader(const char* filename);
128 CVAPI(int) cvHaveImageWriter(const char* filename);
130 CvCapture* cvCreateFileCapture_Images(const char* filename);
131 CvVideoWriter* cvCreateVideoWriter_Images(const char* filename);
133 CvCapture* cvCreateFileCapture_XINE (const char* filename);
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
140 CvCapture * cvCreateCapture_GStreamer(int type, const char *filename);
141 CvCapture* cvCreateFileCapture_FFMPEG (const char* filename);
143 CvVideoWriter* cvCreateVideoWriter_FFMPEG ( const char* filename, int fourcc,
144 double fps, CvSize frameSize, int is_color );
146 CvCapture * cvCreateFileCapture_QT (const char * filename);
147 CvCapture * cvCreateCameraCapture_QT (const int index);
149 CvVideoWriter* cvCreateVideoWriter_QT ( const char* filename, int fourcc,
150 double fps, CvSize frameSize, int is_color );
152 CvCapture * cvCreateCameraCapture_Unicap (const int index);
157 class CV_EXPORTS BaseWindow
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;
182 virtual void addTrackbar( const String& trackbar, int low, int high, int step );
185 typedef Ptr<BaseWindow> Window;
189 #endif /* __HIGHGUI_H_ */