a94e69601b08cb226f4a333a991d08502f07a47c
[profile/ivi/opencv.git] / modules / highgui / include / opencv2 / highgui / highgui_c.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 __OPENCV_HIGHGUI_H__
43 #define __OPENCV_HIGHGUI_H__
44
45 #include "opencv2/core/core_c.h"
46
47 #ifdef __cplusplus
48 extern "C" {
49 #endif /* __cplusplus */
50
51 /****************************************************************************************\
52 *                                  Basic GUI functions                                   *
53 \****************************************************************************************/
54 //YV
55 //-----------New for Qt
56 /* For font */
57 enum {  CV_FONT_LIGHT           = 25,//QFont::Light,
58         CV_FONT_NORMAL          = 50,//QFont::Normal,
59         CV_FONT_DEMIBOLD        = 63,//QFont::DemiBold,
60         CV_FONT_BOLD            = 75,//QFont::Bold,
61         CV_FONT_BLACK           = 87 //QFont::Black
62 };
63
64 enum {  CV_STYLE_NORMAL         = 0,//QFont::StyleNormal,
65         CV_STYLE_ITALIC         = 1,//QFont::StyleItalic,
66         CV_STYLE_OBLIQUE        = 2 //QFont::StyleOblique
67 };
68 /* ---------*/
69
70 //for color cvScalar(blue_component, green_component, red\_component[, alpha_component])
71 //and alpha= 0 <-> 0xFF (not transparent <-> transparent)
72 CVAPI(CvFont) cvFontQt(const char* nameFont, int pointSize CV_DEFAULT(-1), CvScalar color CV_DEFAULT(cvScalarAll(0)), int weight CV_DEFAULT(CV_FONT_NORMAL),  int style CV_DEFAULT(CV_STYLE_NORMAL), int spacing CV_DEFAULT(0));
73
74 CVAPI(void) cvAddText(const CvArr* img, const char* text, CvPoint org, CvFont *arg2);
75
76 CVAPI(void) cvDisplayOverlay(const char* name, const char* text, int delayms CV_DEFAULT(0));
77 CVAPI(void) cvDisplayStatusBar(const char* name, const char* text, int delayms CV_DEFAULT(0));
78
79 CVAPI(void) cvSaveWindowParameters(const char* name);
80 CVAPI(void) cvLoadWindowParameters(const char* name);
81 CVAPI(int) cvStartLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]);
82 CVAPI(void) cvStopLoop( void );
83
84 typedef void (CV_CDECL *CvButtonCallback)(int state, void* userdata);
85 enum {CV_PUSH_BUTTON = 0, CV_CHECKBOX = 1, CV_RADIOBOX = 2};
86 CVAPI(int) cvCreateButton( const char* button_name CV_DEFAULT(NULL),CvButtonCallback on_change CV_DEFAULT(NULL), void* userdata CV_DEFAULT(NULL) , int button_type CV_DEFAULT(CV_PUSH_BUTTON), int initial_button_state CV_DEFAULT(0));
87 //----------------------
88
89
90 /* this function is used to set some external parameters in case of X Window */
91 CVAPI(int) cvInitSystem( int argc, char** argv );
92
93 CVAPI(int) cvStartWindowThread( void );
94
95 // ---------  YV ---------
96 enum
97 {
98     //These 3 flags are used by cvSet/GetWindowProperty
99     CV_WND_PROP_FULLSCREEN = 0, //to change/get window's fullscreen property
100     CV_WND_PROP_AUTOSIZE   = 1, //to change/get window's autosize property
101     CV_WND_PROP_ASPECTRATIO= 2, //to change/get window's aspectratio property
102     CV_WND_PROP_OPENGL     = 3, //to change/get window's opengl support
103
104     //These 2 flags are used by cvNamedWindow and cvSet/GetWindowProperty
105     CV_WINDOW_NORMAL       = 0x00000000, //the user can resize the window (no constraint)  / also use to switch a fullscreen window to a normal size
106     CV_WINDOW_AUTOSIZE     = 0x00000001, //the user cannot resize the window, the size is constrainted by the image displayed
107     CV_WINDOW_OPENGL       = 0x00001000, //window with opengl support
108
109     //Those flags are only for Qt
110     CV_GUI_EXPANDED         = 0x00000000, //status bar and tool bar
111     CV_GUI_NORMAL           = 0x00000010, //old fashious way
112
113     //These 3 flags are used by cvNamedWindow and cvSet/GetWindowProperty
114     CV_WINDOW_FULLSCREEN   = 1,//change the window to fullscreen
115     CV_WINDOW_FREERATIO    = 0x00000100,//the image expends as much as it can (no ratio constraint)
116     CV_WINDOW_KEEPRATIO    = 0x00000000//the ration image is respected.
117 };
118
119 /* create window */
120 CVAPI(int) cvNamedWindow( const char* name, int flags CV_DEFAULT(CV_WINDOW_AUTOSIZE) );
121
122 /* Set and Get Property of the window */
123 CVAPI(void) cvSetWindowProperty(const char* name, int prop_id, double prop_value);
124 CVAPI(double) cvGetWindowProperty(const char* name, int prop_id);
125
126 /* display image within window (highgui windows remember their content) */
127 CVAPI(void) cvShowImage( const char* name, const CvArr* image );
128
129 /* resize/move window */
130 CVAPI(void) cvResizeWindow( const char* name, int width, int height );
131 CVAPI(void) cvMoveWindow( const char* name, int x, int y );
132
133
134 /* destroy window and all the trackers associated with it */
135 CVAPI(void) cvDestroyWindow( const char* name );
136
137 CVAPI(void) cvDestroyAllWindows(void);
138
139 /* get native window handle (HWND in case of Win32 and Widget in case of X Window) */
140 CVAPI(void*) cvGetWindowHandle( const char* name );
141
142 /* get name of highgui window given its native handle */
143 CVAPI(const char*) cvGetWindowName( void* window_handle );
144
145
146 typedef void (CV_CDECL *CvTrackbarCallback)(int pos);
147
148 /* create trackbar and display it on top of given window, set callback */
149 CVAPI(int) cvCreateTrackbar( const char* trackbar_name, const char* window_name,
150                              int* value, int count, CvTrackbarCallback on_change CV_DEFAULT(NULL));
151
152 typedef void (CV_CDECL *CvTrackbarCallback2)(int pos, void* userdata);
153
154 CVAPI(int) cvCreateTrackbar2( const char* trackbar_name, const char* window_name,
155                               int* value, int count, CvTrackbarCallback2 on_change,
156                               void* userdata CV_DEFAULT(0));
157
158 /* retrieve or set trackbar position */
159 CVAPI(int) cvGetTrackbarPos( const char* trackbar_name, const char* window_name );
160 CVAPI(void) cvSetTrackbarPos( const char* trackbar_name, const char* window_name, int pos );
161
162 enum
163 {
164     CV_EVENT_MOUSEMOVE      =0,
165     CV_EVENT_LBUTTONDOWN    =1,
166     CV_EVENT_RBUTTONDOWN    =2,
167     CV_EVENT_MBUTTONDOWN    =3,
168     CV_EVENT_LBUTTONUP      =4,
169     CV_EVENT_RBUTTONUP      =5,
170     CV_EVENT_MBUTTONUP      =6,
171     CV_EVENT_LBUTTONDBLCLK  =7,
172     CV_EVENT_RBUTTONDBLCLK  =8,
173     CV_EVENT_MBUTTONDBLCLK  =9,
174     CV_EVENT_MOUSEWHEEL     =10,
175     CV_EVENT_MOUSEHWHEEL    =11
176 };
177
178 enum
179 {
180     CV_EVENT_FLAG_LBUTTON   =1,
181     CV_EVENT_FLAG_RBUTTON   =2,
182     CV_EVENT_FLAG_MBUTTON   =4,
183     CV_EVENT_FLAG_CTRLKEY   =8,
184     CV_EVENT_FLAG_SHIFTKEY  =16,
185     CV_EVENT_FLAG_ALTKEY    =32
186 };
187
188
189 #define CV_GET_WHEEL_DELTA(flags) ((short)((flags >> 16) & 0xffff)) // upper 16 bits
190
191 typedef void (CV_CDECL *CvMouseCallback )(int event, int x, int y, int flags, void* param);
192
193 /* assign callback for mouse events */
194 CVAPI(void) cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse,
195                                 void* param CV_DEFAULT(NULL));
196
197 /* wait for key event infinitely (delay<=0) or for "delay" milliseconds */
198 CVAPI(int) cvWaitKey(int delay CV_DEFAULT(0));
199
200 // OpenGL support
201
202 typedef void (CV_CDECL *CvOpenGlDrawCallback)(void* userdata);
203 CVAPI(void) cvSetOpenGlDrawCallback(const char* window_name, CvOpenGlDrawCallback callback, void* userdata CV_DEFAULT(NULL));
204
205 CVAPI(void) cvSetOpenGlContext(const char* window_name);
206 CVAPI(void) cvUpdateWindow(const char* window_name);
207
208
209 /****************************************************************************************\
210 *                         Working with Video Files and Cameras                           *
211 \****************************************************************************************/
212
213 /* "black box" capture structure */
214 typedef struct CvCapture CvCapture;
215
216 /* start capturing frames from video file */
217 CVAPI(CvCapture*) cvCreateFileCapture( const char* filename );
218
219 enum
220 {
221     CV_CAP_ANY      =0,     // autodetect
222
223     CV_CAP_MIL      =100,   // MIL proprietary drivers
224
225     CV_CAP_VFW      =200,   // platform native
226     CV_CAP_V4L      =200,
227     CV_CAP_V4L2     =200,
228
229     CV_CAP_FIREWARE =300,   // IEEE 1394 drivers
230     CV_CAP_FIREWIRE =300,
231     CV_CAP_IEEE1394 =300,
232     CV_CAP_DC1394   =300,
233     CV_CAP_CMU1394  =300,
234
235     CV_CAP_STEREO   =400,   // TYZX proprietary drivers
236     CV_CAP_TYZX     =400,
237     CV_TYZX_LEFT    =400,
238     CV_TYZX_RIGHT   =401,
239     CV_TYZX_COLOR   =402,
240     CV_TYZX_Z       =403,
241
242     CV_CAP_QT       =500,   // QuickTime
243
244     CV_CAP_UNICAP   =600,   // Unicap drivers
245
246     CV_CAP_DSHOW    =700,   // DirectShow (via videoInput)
247     CV_CAP_MSMF     =1400,  // Microsoft Media Foundation (via videoInput)
248
249     CV_CAP_PVAPI    =800,   // PvAPI, Prosilica GigE SDK
250
251     CV_CAP_OPENNI   =900,   // OpenNI (for Kinect)
252     CV_CAP_OPENNI_ASUS =910,   // OpenNI (for Asus Xtion)
253
254     CV_CAP_ANDROID  =1000,  // Android
255     CV_CAP_ANDROID_BACK =CV_CAP_ANDROID+99, // Android back camera
256     CV_CAP_ANDROID_FRONT =CV_CAP_ANDROID+98, // Android front camera
257
258     CV_CAP_XIAPI    =1100,   // XIMEA Camera API
259
260     CV_CAP_AVFOUNDATION = 1200,  // AVFoundation framework for iOS (OS X Lion will have the same API)
261
262     CV_CAP_GIGANETIX = 1300,  // Smartek Giganetix GigEVisionSDK
263
264     CV_CAP_INTELPERC = 1500 // Intel Perceptual Computing SDK
265 };
266
267 /* start capturing frames from camera: index = camera_index + domain_offset (CV_CAP_*) */
268 CVAPI(CvCapture*) cvCreateCameraCapture( int index );
269
270 /* grab a frame, return 1 on success, 0 on fail.
271   this function is thought to be fast               */
272 CVAPI(int) cvGrabFrame( CvCapture* capture );
273
274 /* get the frame grabbed with cvGrabFrame(..)
275   This function may apply some frame processing like
276   frame decompression, flipping etc.
277   !!!DO NOT RELEASE or MODIFY the retrieved frame!!! */
278 CVAPI(IplImage*) cvRetrieveFrame( CvCapture* capture, int streamIdx CV_DEFAULT(0) );
279
280 /* Just a combination of cvGrabFrame and cvRetrieveFrame
281    !!!DO NOT RELEASE or MODIFY the retrieved frame!!!      */
282 CVAPI(IplImage*) cvQueryFrame( CvCapture* capture );
283
284 /* stop capturing/reading and free resources */
285 CVAPI(void) cvReleaseCapture( CvCapture** capture );
286
287 enum
288 {
289     // modes of the controlling registers (can be: auto, manual, auto single push, absolute Latter allowed with any other mode)
290     // every feature can have only one mode turned on at a time
291     CV_CAP_PROP_DC1394_OFF         = -4,  //turn the feature off (not controlled manually nor automatically)
292     CV_CAP_PROP_DC1394_MODE_MANUAL = -3, //set automatically when a value of the feature is set by the user
293     CV_CAP_PROP_DC1394_MODE_AUTO = -2,
294     CV_CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1,
295     CV_CAP_PROP_POS_MSEC       =0,
296     CV_CAP_PROP_POS_FRAMES     =1,
297     CV_CAP_PROP_POS_AVI_RATIO  =2,
298     CV_CAP_PROP_FRAME_WIDTH    =3,
299     CV_CAP_PROP_FRAME_HEIGHT   =4,
300     CV_CAP_PROP_FPS            =5,
301     CV_CAP_PROP_FOURCC         =6,
302     CV_CAP_PROP_FRAME_COUNT    =7,
303     CV_CAP_PROP_FORMAT         =8,
304     CV_CAP_PROP_MODE           =9,
305     CV_CAP_PROP_BRIGHTNESS    =10,
306     CV_CAP_PROP_CONTRAST      =11,
307     CV_CAP_PROP_SATURATION    =12,
308     CV_CAP_PROP_HUE           =13,
309     CV_CAP_PROP_GAIN          =14,
310     CV_CAP_PROP_EXPOSURE      =15,
311     CV_CAP_PROP_CONVERT_RGB   =16,
312     CV_CAP_PROP_WHITE_BALANCE_BLUE_U =17,
313     CV_CAP_PROP_RECTIFICATION =18,
314     CV_CAP_PROP_MONOCROME     =19,
315     CV_CAP_PROP_SHARPNESS     =20,
316     CV_CAP_PROP_AUTO_EXPOSURE =21, // exposure control done by camera,
317                                    // user can adjust refernce level
318                                    // using this feature
319     CV_CAP_PROP_GAMMA         =22,
320     CV_CAP_PROP_TEMPERATURE   =23,
321     CV_CAP_PROP_TRIGGER       =24,
322     CV_CAP_PROP_TRIGGER_DELAY =25,
323     CV_CAP_PROP_WHITE_BALANCE_RED_V =26,
324     CV_CAP_PROP_ZOOM          =27,
325     CV_CAP_PROP_FOCUS         =28,
326     CV_CAP_PROP_GUID          =29,
327     CV_CAP_PROP_ISO_SPEED     =30,
328     CV_CAP_PROP_MAX_DC1394    =31,
329     CV_CAP_PROP_BACKLIGHT     =32,
330     CV_CAP_PROP_PAN           =33,
331     CV_CAP_PROP_TILT          =34,
332     CV_CAP_PROP_ROLL          =35,
333     CV_CAP_PROP_IRIS          =36,
334     CV_CAP_PROP_SETTINGS      =37,
335
336     CV_CAP_PROP_AUTOGRAB      =1024, // property for highgui class CvCapture_Android only
337     CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING=1025, // readonly, tricky property, returns cpnst char* indeed
338     CV_CAP_PROP_PREVIEW_FORMAT=1026, // readonly, tricky property, returns cpnst char* indeed
339
340     // OpenNI map generators
341     CV_CAP_OPENNI_DEPTH_GENERATOR = 1 << 31,
342     CV_CAP_OPENNI_IMAGE_GENERATOR = 1 << 30,
343     CV_CAP_OPENNI_GENERATORS_MASK = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_OPENNI_IMAGE_GENERATOR,
344
345     // Properties of cameras available through OpenNI interfaces
346     CV_CAP_PROP_OPENNI_OUTPUT_MODE     = 100,
347     CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, // in mm
348     CV_CAP_PROP_OPENNI_BASELINE        = 102, // in mm
349     CV_CAP_PROP_OPENNI_FOCAL_LENGTH    = 103, // in pixels
350     CV_CAP_PROP_OPENNI_REGISTRATION    = 104, // flag
351     CV_CAP_PROP_OPENNI_REGISTRATION_ON = CV_CAP_PROP_OPENNI_REGISTRATION, // flag that synchronizes the remapping depth map to image map
352                                                                           // by changing depth generator's view point (if the flag is "on") or
353                                                                           // sets this view point to its normal one (if the flag is "off").
354     CV_CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105,
355     CV_CAP_PROP_OPENNI_MAX_BUFFER_SIZE   = 106,
356     CV_CAP_PROP_OPENNI_CIRCLE_BUFFER     = 107,
357     CV_CAP_PROP_OPENNI_MAX_TIME_DURATION = 108,
358
359     CV_CAP_PROP_OPENNI_GENERATOR_PRESENT = 109,
360
361     CV_CAP_OPENNI_IMAGE_GENERATOR_PRESENT         = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT,
362     CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE     = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_OUTPUT_MODE,
363     CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE        = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_BASELINE,
364     CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH    = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_FOCAL_LENGTH,
365     CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION    = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_REGISTRATION,
366     CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION,
367
368     // Properties of cameras available through GStreamer interface
369     CV_CAP_GSTREAMER_QUEUE_LENGTH           = 200, // default is 1
370
371     // PVAPI
372     CV_CAP_PROP_PVAPI_MULTICASTIP           = 300, // ip for anable multicast master mode. 0 for disable multicast
373     CV_CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301, // FrameStartTriggerMode: Determines how a frame is initiated
374
375     // Properties of cameras available through XIMEA SDK interface
376     CV_CAP_PROP_XI_DOWNSAMPLING  = 400,      // Change image resolution by binning or skipping.
377     CV_CAP_PROP_XI_DATA_FORMAT   = 401,       // Output data format.
378     CV_CAP_PROP_XI_OFFSET_X      = 402,      // Horizontal offset from the origin to the area of interest (in pixels).
379     CV_CAP_PROP_XI_OFFSET_Y      = 403,      // Vertical offset from the origin to the area of interest (in pixels).
380     CV_CAP_PROP_XI_TRG_SOURCE    = 404,      // Defines source of trigger.
381     CV_CAP_PROP_XI_TRG_SOFTWARE  = 405,      // Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE.
382     CV_CAP_PROP_XI_GPI_SELECTOR  = 406,      // Selects general purpose input
383     CV_CAP_PROP_XI_GPI_MODE      = 407,      // Set general purpose input mode
384     CV_CAP_PROP_XI_GPI_LEVEL     = 408,      // Get general purpose level
385     CV_CAP_PROP_XI_GPO_SELECTOR  = 409,      // Selects general purpose output
386     CV_CAP_PROP_XI_GPO_MODE      = 410,      // Set general purpose output mode
387     CV_CAP_PROP_XI_LED_SELECTOR  = 411,      // Selects camera signalling LED
388     CV_CAP_PROP_XI_LED_MODE      = 412,      // Define camera signalling LED functionality
389     CV_CAP_PROP_XI_MANUAL_WB     = 413,      // Calculates White Balance(must be called during acquisition)
390     CV_CAP_PROP_XI_AUTO_WB       = 414,      // Automatic white balance
391     CV_CAP_PROP_XI_AEAG          = 415,      // Automatic exposure/gain
392     CV_CAP_PROP_XI_EXP_PRIORITY  = 416,      // Exposure priority (0.5 - exposure 50%, gain 50%).
393     CV_CAP_PROP_XI_AE_MAX_LIMIT  = 417,      // Maximum limit of exposure in AEAG procedure
394     CV_CAP_PROP_XI_AG_MAX_LIMIT  = 418,      // Maximum limit of gain in AEAG procedure
395     CV_CAP_PROP_XI_AEAG_LEVEL    = 419,       // Average intensity of output signal AEAG should achieve(in %)
396     CV_CAP_PROP_XI_TIMEOUT       = 420,       // Image capture timeout in milliseconds
397
398     // Properties for Android cameras
399     CV_CAP_PROP_ANDROID_FLASH_MODE = 8001,
400     CV_CAP_PROP_ANDROID_FOCUS_MODE = 8002,
401     CV_CAP_PROP_ANDROID_WHITE_BALANCE = 8003,
402     CV_CAP_PROP_ANDROID_ANTIBANDING = 8004,
403     CV_CAP_PROP_ANDROID_FOCAL_LENGTH = 8005,
404     CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_NEAR = 8006,
405     CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_OPTIMAL = 8007,
406     CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_FAR = 8008,
407     CV_CAP_PROP_ANDROID_EXPOSE_LOCK = 8009,
408     CV_CAP_PROP_ANDROID_WHITEBALANCE_LOCK = 8010,
409
410     // Properties of cameras available through AVFOUNDATION interface
411     CV_CAP_PROP_IOS_DEVICE_FOCUS = 9001,
412     CV_CAP_PROP_IOS_DEVICE_EXPOSURE = 9002,
413     CV_CAP_PROP_IOS_DEVICE_FLASH = 9003,
414     CV_CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004,
415     CV_CAP_PROP_IOS_DEVICE_TORCH = 9005,
416
417     // Properties of cameras available through Smartek Giganetix Ethernet Vision interface
418     /* --- Vladimir Litvinenko (litvinenko.vladimir@gmail.com) --- */
419     CV_CAP_PROP_GIGA_FRAME_OFFSET_X = 10001,
420     CV_CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002,
421     CV_CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003,
422     CV_CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004,
423     CV_CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005,
424     CV_CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006,
425
426     CV_CAP_PROP_INTELPERC_PROFILE_COUNT               = 11001,
427     CV_CAP_PROP_INTELPERC_PROFILE_IDX                 = 11002,
428     CV_CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE  = 11003,
429     CV_CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE      = 11004,
430     CV_CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD  = 11005,
431     CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ     = 11006,
432     CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT     = 11007,
433
434     // Intel PerC streams
435     CV_CAP_INTELPERC_DEPTH_GENERATOR = 1 << 29,
436     CV_CAP_INTELPERC_IMAGE_GENERATOR = 1 << 28,
437     CV_CAP_INTELPERC_GENERATORS_MASK = CV_CAP_INTELPERC_DEPTH_GENERATOR + CV_CAP_INTELPERC_IMAGE_GENERATOR
438 };
439
440 enum
441 {
442     // Data given from depth generator.
443     CV_CAP_OPENNI_DEPTH_MAP                 = 0, // Depth values in mm (CV_16UC1)
444     CV_CAP_OPENNI_POINT_CLOUD_MAP           = 1, // XYZ in meters (CV_32FC3)
445     CV_CAP_OPENNI_DISPARITY_MAP             = 2, // Disparity in pixels (CV_8UC1)
446     CV_CAP_OPENNI_DISPARITY_MAP_32F         = 3, // Disparity in pixels (CV_32FC1)
447     CV_CAP_OPENNI_VALID_DEPTH_MASK          = 4, // CV_8UC1
448
449     // Data given from RGB image generator.
450     CV_CAP_OPENNI_BGR_IMAGE                 = 5,
451     CV_CAP_OPENNI_GRAY_IMAGE                = 6
452 };
453
454 // Supported output modes of OpenNI image generator
455 enum
456 {
457     CV_CAP_OPENNI_VGA_30HZ     = 0,
458     CV_CAP_OPENNI_SXGA_15HZ    = 1,
459     CV_CAP_OPENNI_SXGA_30HZ    = 2,
460     CV_CAP_OPENNI_QVGA_30HZ    = 3,
461     CV_CAP_OPENNI_QVGA_60HZ    = 4
462 };
463
464 //supported by Android camera output formats
465 enum
466 {
467     CV_CAP_ANDROID_COLOR_FRAME_BGR = 0, //BGR
468     CV_CAP_ANDROID_COLOR_FRAME = CV_CAP_ANDROID_COLOR_FRAME_BGR,
469     CV_CAP_ANDROID_GREY_FRAME  = 1,  //Y
470     CV_CAP_ANDROID_COLOR_FRAME_RGB = 2,
471     CV_CAP_ANDROID_COLOR_FRAME_BGRA = 3,
472     CV_CAP_ANDROID_COLOR_FRAME_RGBA = 4
473 };
474
475 // supported Android camera flash modes
476 enum
477 {
478     CV_CAP_ANDROID_FLASH_MODE_AUTO = 0,
479     CV_CAP_ANDROID_FLASH_MODE_OFF,
480     CV_CAP_ANDROID_FLASH_MODE_ON,
481     CV_CAP_ANDROID_FLASH_MODE_RED_EYE,
482     CV_CAP_ANDROID_FLASH_MODE_TORCH
483 };
484
485 // supported Android camera focus modes
486 enum
487 {
488     CV_CAP_ANDROID_FOCUS_MODE_AUTO = 0,
489     CV_CAP_ANDROID_FOCUS_MODE_CONTINUOUS_PICTURE,
490     CV_CAP_ANDROID_FOCUS_MODE_CONTINUOUS_VIDEO,
491     CV_CAP_ANDROID_FOCUS_MODE_EDOF,
492     CV_CAP_ANDROID_FOCUS_MODE_FIXED,
493     CV_CAP_ANDROID_FOCUS_MODE_INFINITY,
494     CV_CAP_ANDROID_FOCUS_MODE_MACRO
495 };
496
497 // supported Android camera white balance modes
498 enum
499 {
500     CV_CAP_ANDROID_WHITE_BALANCE_AUTO = 0,
501     CV_CAP_ANDROID_WHITE_BALANCE_CLOUDY_DAYLIGHT,
502     CV_CAP_ANDROID_WHITE_BALANCE_DAYLIGHT,
503     CV_CAP_ANDROID_WHITE_BALANCE_FLUORESCENT,
504     CV_CAP_ANDROID_WHITE_BALANCE_INCANDESCENT,
505     CV_CAP_ANDROID_WHITE_BALANCE_SHADE,
506     CV_CAP_ANDROID_WHITE_BALANCE_TWILIGHT,
507     CV_CAP_ANDROID_WHITE_BALANCE_WARM_FLUORESCENT
508 };
509
510 // supported Android camera antibanding modes
511 enum
512 {
513     CV_CAP_ANDROID_ANTIBANDING_50HZ = 0,
514     CV_CAP_ANDROID_ANTIBANDING_60HZ,
515     CV_CAP_ANDROID_ANTIBANDING_AUTO,
516     CV_CAP_ANDROID_ANTIBANDING_OFF
517 };
518
519 enum
520 {
521     CV_CAP_INTELPERC_DEPTH_MAP              = 0, // Each pixel is a 16-bit integer. The value indicates the distance from an object to the camera's XY plane or the Cartesian depth.
522     CV_CAP_INTELPERC_UVDEPTH_MAP            = 1, // Each pixel contains two 32-bit floating point values in the range of 0-1, representing the mapping of depth coordinates to the color coordinates.
523     CV_CAP_INTELPERC_IR_MAP                 = 2, // Each pixel is a 16-bit integer. The value indicates the intensity of the reflected laser beam.
524     CV_CAP_INTELPERC_IMAGE                  = 3
525 };
526
527 /* retrieve or set capture properties */
528 CVAPI(double) cvGetCaptureProperty( CvCapture* capture, int property_id );
529 CVAPI(int)    cvSetCaptureProperty( CvCapture* capture, int property_id, double value );
530
531 // Return the type of the capturer (eg, CV_CAP_V4W, CV_CAP_UNICAP), which is unknown if created with CV_CAP_ANY
532 CVAPI(int)    cvGetCaptureDomain( CvCapture* capture);
533
534 /* "black box" video file writer structure */
535 typedef struct CvVideoWriter CvVideoWriter;
536
537 #define CV_FOURCC_MACRO(c1, c2, c3, c4) (((c1) & 255) + (((c2) & 255) << 8) + (((c3) & 255) << 16) + (((c4) & 255) << 24))
538
539 CV_INLINE int CV_FOURCC(char c1, char c2, char c3, char c4)
540 {
541     return CV_FOURCC_MACRO(c1, c2, c3, c4);
542 }
543
544 #define CV_FOURCC_PROMPT -1  /* Open Codec Selection Dialog (Windows only) */
545 #define CV_FOURCC_DEFAULT CV_FOURCC('I', 'Y', 'U', 'V') /* Use default codec for specified filename (Linux only) */
546
547 /* initialize video file writer */
548 CVAPI(CvVideoWriter*) cvCreateVideoWriter( const char* filename, int fourcc,
549                                            double fps, CvSize frame_size,
550                                            int is_color CV_DEFAULT(1));
551
552 /* write frame to video file */
553 CVAPI(int) cvWriteFrame( CvVideoWriter* writer, const IplImage* image );
554
555 /* close video file writer */
556 CVAPI(void) cvReleaseVideoWriter( CvVideoWriter** writer );
557
558 /****************************************************************************************\
559 *                              Obsolete functions/synonyms                               *
560 \****************************************************************************************/
561
562 #define cvCaptureFromFile cvCreateFileCapture
563 #define cvCaptureFromCAM cvCreateCameraCapture
564 #define cvCaptureFromAVI cvCaptureFromFile
565 #define cvCreateAVIWriter cvCreateVideoWriter
566 #define cvWriteToAVI cvWriteFrame
567 #define cvAddSearchPath(path)
568 #define cvvInitSystem cvInitSystem
569 #define cvvNamedWindow cvNamedWindow
570 #define cvvShowImage cvShowImage
571 #define cvvResizeWindow cvResizeWindow
572 #define cvvDestroyWindow cvDestroyWindow
573 #define cvvCreateTrackbar cvCreateTrackbar
574 #define cvvLoadImage(name) cvLoadImage((name),1)
575 #define cvvSaveImage cvSaveImage
576 #define cvvAddSearchPath cvAddSearchPath
577 #define cvvWaitKey(name) cvWaitKey(0)
578 #define cvvWaitKeyEx(name,delay) cvWaitKey(delay)
579 #define cvvConvertImage cvConvertImage
580 #define HG_AUTOSIZE CV_WINDOW_AUTOSIZE
581 #define set_preprocess_func cvSetPreprocessFuncWin32
582 #define set_postprocess_func cvSetPostprocessFuncWin32
583
584 #if defined WIN32 || defined _WIN32
585
586 CVAPI(void) cvSetPreprocessFuncWin32_(const void* callback);
587 CVAPI(void) cvSetPostprocessFuncWin32_(const void* callback);
588 #define cvSetPreprocessFuncWin32(callback) cvSetPreprocessFuncWin32_((const void*)(callback))
589 #define cvSetPostprocessFuncWin32(callback) cvSetPostprocessFuncWin32_((const void*)(callback))
590
591 #endif
592
593 #ifdef __cplusplus
594 }
595 #endif
596
597 #endif