highgui_c.h

Harald Schmidt, 2012-08-24 07:15 pm

Download (25.8 kB)

 
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_NORMAL_Z     = 0x00000002, //the user can resize the window (no constraint)  / bigger default size == fullscreen
107
    CV_WINDOW_AUTOSIZE     = 0x00000001, //the user cannot resize the window, the size is constrainted by the image displayed
108
    CV_WINDOW_OPENGL       = 0x00001000, //window with opengl support
109
110
    //Those flags are only for Qt
111
    CV_GUI_EXPANDED         = 0x00000000, //status bar and tool bar
112
    CV_GUI_NORMAL           = 0x00000010, //old fashious way
113
114
    //These 3 flags are used by cvNamedWindow and cvSet/GetWindowProperty
115
    CV_WINDOW_FULLSCREEN   = 1,//change the window to fullscreen
116
    CV_WINDOW_FREERATIO    = 0x00000100,//the image expends as much as it can (no ratio constraint)
117
    CV_WINDOW_KEEPRATIO    = 0x00000000//the ration image is respected.
118
};
119
120
/* create window */
121
CVAPI(int) cvNamedWindow( const char* name, int flags CV_DEFAULT(CV_WINDOW_AUTOSIZE) );
122
123
/* Set and Get Property of the window */
124
CVAPI(void) cvSetWindowProperty(const char* name, int prop_id, double prop_value);
125
CVAPI(double) cvGetWindowProperty(const char* name, int prop_id);
126
127
/* display image within window (highgui windows remember their content) */
128
CVAPI(void) cvShowImage( const char* name, const CvArr* image );
129
130
/* resize/move window */
131
CVAPI(void) cvResizeWindow( const char* name, int width, int height );
132
CVAPI(void) cvMoveWindow( const char* name, int x, int y );
133
134
135
/* destroy window and all the trackers associated with it */
136
CVAPI(void) cvDestroyWindow( const char* name );
137
138
CVAPI(void) cvDestroyAllWindows(void);
139
140
// ---------  HS ---------
141
/* some additional modes for button bar config */
142
enum { EMOD_PropWnd, EMOD_Zoom, EMOD_Panning, EMOD_SaveImg, 
143
       EMOD_TxtButton, EMOD_Label, EMOD_Edit, EMOD_Combo, 
144
       EMOD_Slider, EMOD_Pulldown,
145
       EMOD_CheckBox, EMOD_CheckText, EMOD_PushText, EMOD_Spin };
146
147
/* some additional functions for button bar config */
148
CVAPI(int)  cvGetCommand( const char* WndName, char* cmd );
149
CVAPI(int)  cvGetButtonBarContent(const char * WndName, int idx, char * txt );
150
CVAPI(int)  cvSetButtonBarContent(const char * WndName, int etype, int idx, char * txt );
151
CVAPI(void) cvDispInfoBox_Qt( const char* WndName, char* caption, const char * csTxt ); 
152
153
/* adjust window in relation to screen resolution; all int values as percentage */
154
CVAPI(void) cvAdjustWindowPos_Qt( const char * name, int xp, int xwp, int yp, int yhp );
155
// ---------------------
156
157
158
/* get native window handle (HWND in case of Win32 and Widget in case of X Window) */
159
CVAPI(void*) cvGetWindowHandle( const char* name );
160
161
/* get name of highgui window given its native handle */
162
CVAPI(const char*) cvGetWindowName( void* window_handle );
163
164
165
typedef void (CV_CDECL *CvTrackbarCallback)(int pos);
166
167
/* create trackbar and display it on top of given window, set callback */
168
CVAPI(int) cvCreateTrackbar( const char* trackbar_name, const char* window_name,
169
                             int* value, int count, CvTrackbarCallback on_change CV_DEFAULT(NULL));
170
171
typedef void (CV_CDECL *CvTrackbarCallback2)(int pos, void* userdata);
172
173
CVAPI(int) cvCreateTrackbar2( const char* trackbar_name, const char* window_name,
174
                              int* value, int count, CvTrackbarCallback2 on_change,
175
                              void* userdata CV_DEFAULT(0));
176
177
/* retrieve or set trackbar position */
178
CVAPI(int) cvGetTrackbarPos( const char* trackbar_name, const char* window_name );
179
CVAPI(void) cvSetTrackbarPos( const char* trackbar_name, const char* window_name, int pos );
180
181
enum
182
{
183
    CV_EVENT_MOUSEMOVE      =0,
184
    CV_EVENT_LBUTTONDOWN    =1,
185
    CV_EVENT_RBUTTONDOWN    =2,
186
    CV_EVENT_MBUTTONDOWN    =3,
187
    CV_EVENT_LBUTTONUP      =4,
188
    CV_EVENT_RBUTTONUP      =5,
189
    CV_EVENT_MBUTTONUP      =6,
190
    CV_EVENT_LBUTTONDBLCLK  =7,
191
    CV_EVENT_RBUTTONDBLCLK  =8,
192
    CV_EVENT_MBUTTONDBLCLK  =9
193
};
194
195
enum
196
{
197
    CV_EVENT_FLAG_LBUTTON   =1,
198
    CV_EVENT_FLAG_RBUTTON   =2,
199
    CV_EVENT_FLAG_MBUTTON   =4,
200
    CV_EVENT_FLAG_CTRLKEY   =8,
201
    CV_EVENT_FLAG_SHIFTKEY  =16,
202
    CV_EVENT_FLAG_ALTKEY    =32
203
};
204
205
typedef void (CV_CDECL *CvMouseCallback )(int event, int x, int y, int flags, void* param);
206
207
/* assign callback for mouse events */
208
CVAPI(void) cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse,
209
                                void* param CV_DEFAULT(NULL));
210
211
enum
212
{
213
/* 8bit, color or not */
214
    CV_LOAD_IMAGE_UNCHANGED  =-1,
215
/* 8bit, gray */
216
    CV_LOAD_IMAGE_GRAYSCALE  =0,
217
/* ?, color */
218
    CV_LOAD_IMAGE_COLOR      =1,
219
/* any depth, ? */
220
    CV_LOAD_IMAGE_ANYDEPTH   =2,
221
/* ?, any color */
222
    CV_LOAD_IMAGE_ANYCOLOR   =4
223
};
224
225
/* load image from file
226
  iscolor can be a combination of above flags where CV_LOAD_IMAGE_UNCHANGED
227
  overrides the other flags
228
  using CV_LOAD_IMAGE_ANYCOLOR alone is equivalent to CV_LOAD_IMAGE_UNCHANGED
229
  unless CV_LOAD_IMAGE_ANYDEPTH is specified images are converted to 8bit
230
*/
231
CVAPI(IplImage*) cvLoadImage( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
232
CVAPI(CvMat*) cvLoadImageM( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
233
234
enum
235
{
236
    CV_IMWRITE_JPEG_QUALITY =1,
237
    CV_IMWRITE_PNG_COMPRESSION =16,
238
    CV_IMWRITE_PNG_STRATEGY =17,
239
    CV_IMWRITE_PNG_STRATEGY_DEFAULT =0,
240
    CV_IMWRITE_PNG_STRATEGY_FILTERED =1,
241
    CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY =2,
242
    CV_IMWRITE_PNG_STRATEGY_RLE =3,
243
    CV_IMWRITE_PNG_STRATEGY_FIXED =4,
244
    CV_IMWRITE_PXM_BINARY =32
245
};
246
247
/* save image to file */
248
CVAPI(int) cvSaveImage( const char* filename, const CvArr* image,
249
                        const int* params CV_DEFAULT(0) );
250
251
/* decode image stored in the buffer */
252
CVAPI(IplImage*) cvDecodeImage( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
253
CVAPI(CvMat*) cvDecodeImageM( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
254
255
/* encode image and store the result as a byte vector (single-row 8uC1 matrix) */
256
CVAPI(CvMat*) cvEncodeImage( const char* ext, const CvArr* image,
257
                             const int* params CV_DEFAULT(0) );
258
259
enum
260
{
261
    CV_CVTIMG_FLIP      =1,
262
    CV_CVTIMG_SWAP_RB   =2
263
};
264
265
/* utility function: convert one image to another with optional vertical flip */
266
CVAPI(void) cvConvertImage( const CvArr* src, CvArr* dst, int flags CV_DEFAULT(0));
267
268
/* wait for key event infinitely (delay<=0) or for "delay" milliseconds */
269
CVAPI(int) cvWaitKey(int delay CV_DEFAULT(0));
270
271
// OpenGL support
272
273
typedef void (CV_CDECL *CvOpenGlDrawCallback)(void* userdata);
274
CVAPI(void) cvSetOpenGlDrawCallback(const char* window_name, CvOpenGlDrawCallback callback, void* userdata CV_DEFAULT(NULL));
275
276
CVAPI(void) cvSetOpenGlContext(const char* window_name);
277
CVAPI(void) cvUpdateWindow(const char* window_name);
278
279
280
/****************************************************************************************\
281
*                         Working with Video Files and Cameras                           *
282
\****************************************************************************************/
283
284
/* "black box" capture structure */
285
typedef struct CvCapture CvCapture;
286
287
/* start capturing frames from video file */
288
CVAPI(CvCapture*) cvCreateFileCapture( const char* filename );
289
290
enum
291
{
292
    CV_CAP_ANY      =0,     // autodetect
293
294
    CV_CAP_MIL      =100,   // MIL proprietary drivers
295
296
    CV_CAP_VFW      =200,   // platform native
297
    CV_CAP_V4L      =200,
298
    CV_CAP_V4L2     =200,
299
300
    CV_CAP_FIREWARE =300,   // IEEE 1394 drivers
301
    CV_CAP_FIREWIRE =300,
302
    CV_CAP_IEEE1394 =300,
303
    CV_CAP_DC1394   =300,
304
    CV_CAP_CMU1394  =300,
305
306
    CV_CAP_STEREO   =400,   // TYZX proprietary drivers
307
    CV_CAP_TYZX     =400,
308
    CV_TYZX_LEFT    =400,
309
    CV_TYZX_RIGHT   =401,
310
    CV_TYZX_COLOR   =402,
311
    CV_TYZX_Z       =403,
312
313
    CV_CAP_QT       =500,   // QuickTime
314
315
    CV_CAP_UNICAP   =600,   // Unicap drivers
316
317
    CV_CAP_DSHOW    =700,   // DirectShow (via videoInput)
318
319
    CV_CAP_PVAPI    =800,   // PvAPI, Prosilica GigE SDK
320
321
    CV_CAP_OPENNI   =900,   // OpenNI (for Kinect)
322
    CV_CAP_OPENNI_ASUS =910,   // OpenNI (for Asus Xtion)
323
324
    CV_CAP_ANDROID  =1000,  // Android
325
326
    CV_CAP_XIAPI    =1100,   // XIMEA Camera API
327
328
    CV_CAP_AVFOUNDATION = 1200  // AVFoundation framework for iOS (OS X Lion will have the same API)
329
};
330
331
/* start capturing frames from camera: index = camera_index + domain_offset (CV_CAP_*) */
332
CVAPI(CvCapture*) cvCreateCameraCapture( int index );
333
334
/* grab a frame, return 1 on success, 0 on fail.
335
  this function is thought to be fast               */
336
CVAPI(int) cvGrabFrame( CvCapture* capture );
337
338
/* get the frame grabbed with cvGrabFrame(..)
339
  This function may apply some frame processing like
340
  frame decompression, flipping etc.
341
  !!!DO NOT RELEASE or MODIFY the retrieved frame!!! */
342
CVAPI(IplImage*) cvRetrieveFrame( CvCapture* capture, int streamIdx CV_DEFAULT(0) );
343
344
/* Just a combination of cvGrabFrame and cvRetrieveFrame
345
   !!!DO NOT RELEASE or MODIFY the retrieved frame!!!      */
346
CVAPI(IplImage*) cvQueryFrame( CvCapture* capture );
347
348
/* stop capturing/reading and free resources */
349
CVAPI(void) cvReleaseCapture( CvCapture** capture );
350
351
enum
352
{
353
    // modes of the controlling registers (can be: auto, manual, auto single push, absolute Latter allowed with any other mode)
354
    // every feature can have only one mode turned on at a time
355
    CV_CAP_PROP_DC1394_OFF         = -4,  //turn the feature off (not controlled manually nor automatically)
356
    CV_CAP_PROP_DC1394_MODE_MANUAL = -3, //set automatically when a value of the feature is set by the user
357
    CV_CAP_PROP_DC1394_MODE_AUTO = -2,
358
    CV_CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1,
359
    CV_CAP_PROP_POS_MSEC       =0,
360
    CV_CAP_PROP_POS_FRAMES     =1,
361
    CV_CAP_PROP_POS_AVI_RATIO  =2,
362
    CV_CAP_PROP_FRAME_WIDTH    =3,
363
    CV_CAP_PROP_FRAME_HEIGHT   =4,
364
    CV_CAP_PROP_FPS            =5,
365
    CV_CAP_PROP_FOURCC         =6,
366
    CV_CAP_PROP_FRAME_COUNT    =7,
367
    CV_CAP_PROP_FORMAT         =8,
368
    CV_CAP_PROP_MODE           =9,
369
    CV_CAP_PROP_BRIGHTNESS    =10,
370
    CV_CAP_PROP_CONTRAST      =11,
371
    CV_CAP_PROP_SATURATION    =12,
372
    CV_CAP_PROP_HUE           =13,
373
    CV_CAP_PROP_GAIN          =14,
374
    CV_CAP_PROP_EXPOSURE      =15,
375
    CV_CAP_PROP_CONVERT_RGB   =16,
376
    CV_CAP_PROP_WHITE_BALANCE_BLUE_U =17,
377
    CV_CAP_PROP_RECTIFICATION =18,
378
    CV_CAP_PROP_MONOCROME     =19,
379
    CV_CAP_PROP_SHARPNESS     =20,
380
    CV_CAP_PROP_AUTO_EXPOSURE =21, // exposure control done by camera,
381
                                   // user can adjust refernce level
382
                                   // using this feature
383
    CV_CAP_PROP_GAMMA         =22,
384
    CV_CAP_PROP_TEMPERATURE   =23,
385
    CV_CAP_PROP_TRIGGER       =24,
386
    CV_CAP_PROP_TRIGGER_DELAY =25,
387
    CV_CAP_PROP_WHITE_BALANCE_RED_V =26,
388
    CV_CAP_PROP_ZOOM          =27,
389
    CV_CAP_PROP_FOCUS         =28,
390
    CV_CAP_PROP_GUID          =29,
391
    CV_CAP_PROP_ISO_SPEED     =30,
392
    CV_CAP_PROP_MAX_DC1394    =31,
393
    CV_CAP_PROP_BACKLIGHT     =32,
394
    CV_CAP_PROP_PAN           =33,
395
    CV_CAP_PROP_TILT          =34,
396
    CV_CAP_PROP_ROLL          =35,
397
    CV_CAP_PROP_IRIS          =36,
398
    CV_CAP_PROP_SETTINGS      =37,
399
400
    CV_CAP_PROP_AUTOGRAB      =1024, // property for highgui class CvCapture_Android only
401
    CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING=1025, // readonly, tricky property, returns cpnst char* indeed
402
    CV_CAP_PROP_PREVIEW_FORMAT=1026, // readonly, tricky property, returns cpnst char* indeed
403
404
    // OpenNI map generators
405
    CV_CAP_OPENNI_DEPTH_GENERATOR = 1 << 31,
406
    CV_CAP_OPENNI_IMAGE_GENERATOR = 1 << 30,
407
    CV_CAP_OPENNI_GENERATORS_MASK = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_OPENNI_IMAGE_GENERATOR,
408
409
    // Properties of cameras available through OpenNI interfaces
410
    CV_CAP_PROP_OPENNI_OUTPUT_MODE     = 100,
411
    CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, // in mm
412
    CV_CAP_PROP_OPENNI_BASELINE        = 102, // in mm
413
    CV_CAP_PROP_OPENNI_FOCAL_LENGTH    = 103, // in pixels
414
    CV_CAP_PROP_OPENNI_REGISTRATION    = 104, // flag
415
    CV_CAP_PROP_OPENNI_REGISTRATION_ON = CV_CAP_PROP_OPENNI_REGISTRATION, // flag that synchronizes the remapping depth map to image map
416
                                                                          // by changing depth generator's view point (if the flag is "on") or
417
                                                                          // sets this view point to its normal one (if the flag is "off").
418
    CV_CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105,
419
    CV_CAP_PROP_OPENNI_MAX_BUFFER_SIZE   = 106,
420
    CV_CAP_PROP_OPENNI_CIRCLE_BUFFER     = 107,
421
    CV_CAP_PROP_OPENNI_MAX_TIME_DURATION = 108,
422
423
    CV_CAP_PROP_OPENNI_GENERATOR_PRESENT = 109,
424
425
    CV_CAP_OPENNI_IMAGE_GENERATOR_PRESENT         = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT,
426
    CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE     = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_OUTPUT_MODE,
427
    CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE        = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_BASELINE,
428
    CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH    = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_FOCAL_LENGTH,
429
    CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION    = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_REGISTRATION,
430
    CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION,
431
432
    // Properties of cameras available through GStreamer interface
433
    CV_CAP_GSTREAMER_QUEUE_LENGTH   = 200, // default is 1
434
    CV_CAP_PROP_PVAPI_MULTICASTIP   = 300, // ip for anable multicast master mode. 0 for disable multicast
435
436
    // Properties of cameras available through XIMEA SDK interface
437
    CV_CAP_PROP_XI_DOWNSAMPLING  = 400,      // Change image resolution by binning or skipping.
438
    CV_CAP_PROP_XI_DATA_FORMAT   = 401,       // Output data format.
439
    CV_CAP_PROP_XI_OFFSET_X      = 402,      // Horizontal offset from the origin to the area of interest (in pixels).
440
    CV_CAP_PROP_XI_OFFSET_Y      = 403,      // Vertical offset from the origin to the area of interest (in pixels).
441
    CV_CAP_PROP_XI_TRG_SOURCE    = 404,      // Defines source of trigger.
442
    CV_CAP_PROP_XI_TRG_SOFTWARE  = 405,      // Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE.
443
    CV_CAP_PROP_XI_GPI_SELECTOR  = 406,      // Selects general purpose input
444
    CV_CAP_PROP_XI_GPI_MODE      = 407,      // Set general purpose input mode
445
    CV_CAP_PROP_XI_GPI_LEVEL     = 408,      // Get general purpose level
446
    CV_CAP_PROP_XI_GPO_SELECTOR  = 409,      // Selects general purpose output
447
    CV_CAP_PROP_XI_GPO_MODE      = 410,      // Set general purpose output mode
448
    CV_CAP_PROP_XI_LED_SELECTOR  = 411,      // Selects camera signalling LED
449
    CV_CAP_PROP_XI_LED_MODE      = 412,      // Define camera signalling LED functionality
450
    CV_CAP_PROP_XI_MANUAL_WB     = 413,      // Calculates White Balance(must be called during acquisition)
451
    CV_CAP_PROP_XI_AUTO_WB       = 414,      // Automatic white balance
452
    CV_CAP_PROP_XI_AEAG          = 415,      // Automatic exposure/gain
453
    CV_CAP_PROP_XI_EXP_PRIORITY  = 416,      // Exposure priority (0.5 - exposure 50%, gain 50%).
454
    CV_CAP_PROP_XI_AE_MAX_LIMIT  = 417,      // Maximum limit of exposure in AEAG procedure
455
    CV_CAP_PROP_XI_AG_MAX_LIMIT  = 418,      // Maximum limit of gain in AEAG procedure
456
    CV_CAP_PROP_XI_AEAG_LEVEL    = 419,       // Average intensity of output signal AEAG should achieve(in %)
457
    CV_CAP_PROP_XI_TIMEOUT       = 420,       // Image capture timeout in milliseconds
458
459
    // Properties for Android cameras
460
    CV_CAP_PROP_ANDROID_FLASH_MODE = 8001,
461
    CV_CAP_PROP_ANDROID_FOCUS_MODE = 8002,
462
    CV_CAP_PROP_ANDROID_WHITE_BALANCE = 8003,
463
    CV_CAP_PROP_ANDROID_ANTIBANDING = 8004,
464
    CV_CAP_PROP_ANDROID_FOCAL_LENGTH = 8005,
465
    CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_NEAR = 8006,
466
    CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_OPTIMAL = 8007,
467
    CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_FAR = 8008,
468
469
    // Properties of cameras available through AVFOUNDATION interface
470
    CV_CAP_PROP_IOS_DEVICE_FOCUS = 9001,
471
    CV_CAP_PROP_IOS_DEVICE_EXPOSURE = 9002,
472
    CV_CAP_PROP_IOS_DEVICE_FLASH = 9003,
473
    CV_CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004,
474
    CV_CAP_PROP_IOS_DEVICE_TORCH = 9005
475
};
476
477
enum
478
{
479
    // Data given from depth generator.
480
    CV_CAP_OPENNI_DEPTH_MAP                 = 0, // Depth values in mm (CV_16UC1)
481
    CV_CAP_OPENNI_POINT_CLOUD_MAP           = 1, // XYZ in meters (CV_32FC3)
482
    CV_CAP_OPENNI_DISPARITY_MAP             = 2, // Disparity in pixels (CV_8UC1)
483
    CV_CAP_OPENNI_DISPARITY_MAP_32F         = 3, // Disparity in pixels (CV_32FC1)
484
    CV_CAP_OPENNI_VALID_DEPTH_MASK          = 4, // CV_8UC1
485
486
    // Data given from RGB image generator.
487
    CV_CAP_OPENNI_BGR_IMAGE                 = 5,
488
    CV_CAP_OPENNI_GRAY_IMAGE                = 6
489
};
490
491
// Supported output modes of OpenNI image generator
492
enum
493
{
494
    CV_CAP_OPENNI_VGA_30HZ     = 0,
495
    CV_CAP_OPENNI_SXGA_15HZ    = 1,
496
    CV_CAP_OPENNI_SXGA_30HZ    = 2
497
};
498
499
//supported by Android camera output formats
500
enum
501
{
502
  CV_CAP_ANDROID_COLOR_FRAME_BGR = 0, //BGR
503
  CV_CAP_ANDROID_COLOR_FRAME = CV_CAP_ANDROID_COLOR_FRAME_BGR,
504
  CV_CAP_ANDROID_GREY_FRAME  = 1,  //Y
505
  CV_CAP_ANDROID_COLOR_FRAME_RGB = 2,
506
  CV_CAP_ANDROID_COLOR_FRAME_BGRA = 3,
507
  CV_CAP_ANDROID_COLOR_FRAME_RGBA = 4
508
};
509
510
// supported Android camera flash modes
511
enum {
512
    CV_CAP_ANDROID_FLASH_MODE_AUTO = 0,
513
    CV_CAP_ANDROID_FLASH_MODE_OFF,
514
    CV_CAP_ANDROID_FLASH_MODE_ON,
515
    CV_CAP_ANDROID_FLASH_MODE_RED_EYE,
516
    CV_CAP_ANDROID_FLASH_MODE_TORCH
517
};
518
519
// supported Android camera focus modes
520
enum {
521
    CV_CAP_ANDROID_FOCUS_MODE_AUTO = 0,
522
    CV_CAP_ANDROID_FOCUS_MODE_CONTINUOUS_VIDEO,
523
    CV_CAP_ANDROID_FOCUS_MODE_EDOF,
524
    CV_CAP_ANDROID_FOCUS_MODE_FIXED,
525
    CV_CAP_ANDROID_FOCUS_MODE_INFINITY,
526
    CV_CAP_ANDROID_FOCUS_MODE_MACRO
527
};
528
529
// supported Android camera white balance modes
530
enum {
531
    CV_CAP_ANDROID_WHITE_BALANCE_AUTO = 0,
532
    CV_CAP_ANDROID_WHITE_BALANCE_CLOUDY_DAYLIGHT,
533
    CV_CAP_ANDROID_WHITE_BALANCE_DAYLIGHT,
534
    CV_CAP_ANDROID_WHITE_BALANCE_FLUORESCENT,
535
    CV_CAP_ANDROID_WHITE_BALANCE_INCANDESCENT,
536
    CV_CAP_ANDROID_WHITE_BALANCE_SHADE,
537
    CV_CAP_ANDROID_WHITE_BALANCE_TWILIGHT,
538
    CV_CAP_ANDROID_WHITE_BALANCE_WARM_FLUORESCENT
539
};
540
541
// supported Android camera antibanding modes
542
enum {
543
    CV_CAP_ANDROID_ANTIBANDING_50HZ = 0,
544
    CV_CAP_ANDROID_ANTIBANDING_60HZ,
545
    CV_CAP_ANDROID_ANTIBANDING_AUTO,
546
    CV_CAP_ANDROID_ANTIBANDING_OFF
547
};
548
549
/* retrieve or set capture properties */
550
CVAPI(double) cvGetCaptureProperty( CvCapture* capture, int property_id );
551
CVAPI(int)    cvSetCaptureProperty( CvCapture* capture, int property_id, double value );
552
553
// Return the type of the capturer (eg, CV_CAP_V4W, CV_CAP_UNICAP), which is unknown if created with CV_CAP_ANY
554
CVAPI(int)    cvGetCaptureDomain( CvCapture* capture);
555
556
/* "black box" video file writer structure */
557
typedef struct CvVideoWriter CvVideoWriter;
558
559
CV_INLINE int CV_FOURCC(char c1, char c2, char c3, char c4)
560
{
561
    return (c1 & 255) + ((c2 & 255) << 8) + ((c3 & 255) << 16) + ((c4 & 255) << 24);
562
}
563
564
#define CV_FOURCC_PROMPT -1  /* Open Codec Selection Dialog (Windows only) */
565
#define CV_FOURCC_DEFAULT CV_FOURCC('I', 'Y', 'U', 'V') /* Use default codec for specified filename (Linux only) */
566
567
/* initialize video file writer */
568
CVAPI(CvVideoWriter*) cvCreateVideoWriter( const char* filename, int fourcc,
569
                                           double fps, CvSize frame_size,
570
                                           int is_color CV_DEFAULT(1));
571
572
//CVAPI(CvVideoWriter*) cvCreateImageSequenceWriter( const char* filename,
573
//                                                   int is_color CV_DEFAULT(1));
574
575
/* write frame to video file */
576
CVAPI(int) cvWriteFrame( CvVideoWriter* writer, const IplImage* image );
577
578
/* close video file writer */
579
CVAPI(void) cvReleaseVideoWriter( CvVideoWriter** writer );
580
581
/****************************************************************************************\
582
*                              Obsolete functions/synonyms                               *
583
\****************************************************************************************/
584
585
#define cvCaptureFromFile cvCreateFileCapture
586
#define cvCaptureFromCAM cvCreateCameraCapture
587
#define cvCaptureFromAVI cvCaptureFromFile
588
#define cvCreateAVIWriter cvCreateVideoWriter
589
#define cvWriteToAVI cvWriteFrame
590
#define cvAddSearchPath(path)
591
#define cvvInitSystem cvInitSystem
592
#define cvvNamedWindow cvNamedWindow
593
#define cvvShowImage cvShowImage
594
#define cvvResizeWindow cvResizeWindow
595
#define cvvDestroyWindow cvDestroyWindow
596
#define cvvCreateTrackbar cvCreateTrackbar
597
#define cvvLoadImage(name) cvLoadImage((name),1)
598
#define cvvSaveImage cvSaveImage
599
#define cvvAddSearchPath cvAddSearchPath
600
#define cvvWaitKey(name) cvWaitKey(0)
601
#define cvvWaitKeyEx(name,delay) cvWaitKey(delay)
602
#define cvvConvertImage cvConvertImage
603
#define HG_AUTOSIZE CV_WINDOW_AUTOSIZE
604
#define set_preprocess_func cvSetPreprocessFuncWin32
605
#define set_postprocess_func cvSetPostprocessFuncWin32
606
607
#if defined WIN32 || defined _WIN32
608
609
CVAPI(void) cvSetPreprocessFuncWin32_(const void* callback);
610
CVAPI(void) cvSetPostprocessFuncWin32_(const void* callback);
611
#define cvSetPreprocessFuncWin32(callback) cvSetPreprocessFuncWin32_((const void*)(callback))
612
#define cvSetPostprocessFuncWin32(callback) cvSetPostprocessFuncWin32_((const void*)(callback))
613
614
#endif
615
616
#ifdef __cplusplus
617
}
618
#endif
619
620
#endif