include/opencv2/highgui/highgui_c.h
Go to the documentation of this file.
00001 /*M///////////////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
00004 //
00005 //  By downloading, copying, installing or using the software you agree to this license.
00006 //  If you do not agree to this license, do not download, install,
00007 //  copy or use the software.
00008 //
00009 //
00010 //                        Intel License Agreement
00011 //                For Open Source Computer Vision Library
00012 //
00013 // Copyright (C) 2000, Intel Corporation, all rights reserved.
00014 // Third party copyrights are property of their respective owners.
00015 //
00016 // Redistribution and use in source and binary forms, with or without modification,
00017 // are permitted provided that the following conditions are met:
00018 //
00019 //   * Redistribution's of source code must retain the above copyright notice,
00020 //     this list of conditions and the following disclaimer.
00021 //
00022 //   * Redistribution's in binary form must reproduce the above copyright notice,
00023 //     this list of conditions and the following disclaimer in the documentation
00024 //     and/or other materials provided with the distribution.
00025 //
00026 //   * The name of Intel Corporation may not be used to endorse or promote products
00027 //     derived from this software without specific prior written permission.
00028 //
00029 // This software is provided by the copyright holders and contributors "as is" and
00030 // any express or implied warranties, including, but not limited to, the implied
00031 // warranties of merchantability and fitness for a particular purpose are disclaimed.
00032 // In no event shall the Intel Corporation or contributors be liable for any direct,
00033 // indirect, incidental, special, exemplary, or consequential damages
00034 // (including, but not limited to, procurement of substitute goods or services;
00035 // loss of use, data, or profits; or business interruption) however caused
00036 // and on any theory of liability, whether in contract, strict liability,
00037 // or tort (including negligence or otherwise) arising in any way out of
00038 // the use of this software, even if advised of the possibility of such damage.
00039 //
00040 //M*/
00041 
00042 #ifndef __OPENCV_HIGHGUI_H__
00043 #define __OPENCV_HIGHGUI_H__
00044 
00045 #include "opencv2/core/core_c.h"
00046 
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif /* __cplusplus */
00050 
00051 /****************************************************************************************\
00052 *                                  Basic GUI functions                                   *
00053 \****************************************************************************************/
00054 //YV
00055 //-----------New for Qt
00056 /* For font */
00057 enum {  CV_FONT_LIGHT           = 25,//QFont::Light,
00058         CV_FONT_NORMAL          = 50,//QFont::Normal,
00059         CV_FONT_DEMIBOLD        = 63,//QFont::DemiBold,
00060         CV_FONT_BOLD            = 75,//QFont::Bold,
00061         CV_FONT_BLACK           = 87 //QFont::Black
00062 };
00063 
00064 enum {  CV_STYLE_NORMAL         = 0,//QFont::StyleNormal,
00065         CV_STYLE_ITALIC         = 1,//QFont::StyleItalic,
00066         CV_STYLE_OBLIQUE        = 2 //QFont::StyleOblique
00067 };
00068 /* ---------*/
00069 
00070 //for color cvScalar(blue_component, green_component, red\_component[, alpha_component])
00071 //and alpha= 0 <-> 0xFF (not transparent <-> transparent)
00072 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));
00073 
00074 CVAPI(void) cvAddText(const CvArr* img, const char* text, CvPoint org, CvFont *arg2);
00075 
00076 CVAPI(void) cvDisplayOverlay(const char* name, const char* text, int delayms CV_DEFAULT(0));
00077 CVAPI(void) cvDisplayStatusBar(const char* name, const char* text, int delayms CV_DEFAULT(0));
00078 
00079 CVAPI(void) cvSaveWindowParameters(const char* name);
00080 CVAPI(void) cvLoadWindowParameters(const char* name);
00081 CVAPI(int) cvStartLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]);
00082 CVAPI(void) cvStopLoop( void );
00083 
00084 typedef void (CV_CDECL *CvButtonCallback)(int state, void* userdata);
00085 enum {CV_PUSH_BUTTON = 0, CV_CHECKBOX = 1, CV_RADIOBOX = 2};
00086 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));
00087 //----------------------
00088 
00089 
00090 /* this function is used to set some external parameters in case of X Window */
00091 CVAPI(int) cvInitSystem( int argc, char** argv );
00092 
00093 CVAPI(int) cvStartWindowThread( void );
00094 
00095 // ---------  YV ---------
00096 enum
00097 {
00098     //These 3 flags are used by cvSet/GetWindowProperty
00099     CV_WND_PROP_FULLSCREEN = 0, //to change/get window's fullscreen property
00100     CV_WND_PROP_AUTOSIZE   = 1, //to change/get window's autosize property
00101     CV_WND_PROP_ASPECTRATIO= 2, //to change/get window's aspectratio property
00102     CV_WND_PROP_OPENGL     = 3, //to change/get window's opengl support
00103 
00104     //These 2 flags are used by cvNamedWindow and cvSet/GetWindowProperty
00105     CV_WINDOW_NORMAL       = 0x00000000, //the user can resize the window (no constraint)  / also use to switch a fullscreen window to a normal size
00106     CV_WINDOW_AUTOSIZE     = 0x00000001, //the user cannot resize the window, the size is constrainted by the image displayed
00107     CV_WINDOW_OPENGL       = 0x00001000, //window with opengl support
00108 
00109     //Those flags are only for Qt
00110     CV_GUI_EXPANDED         = 0x00000000, //status bar and tool bar
00111     CV_GUI_NORMAL           = 0x00000010, //old fashious way
00112 
00113     //These 3 flags are used by cvNamedWindow and cvSet/GetWindowProperty
00114     CV_WINDOW_FULLSCREEN   = 1,//change the window to fullscreen
00115     CV_WINDOW_FREERATIO    = 0x00000100,//the image expends as much as it can (no ratio constraint)
00116     CV_WINDOW_KEEPRATIO    = 0x00000000//the ration image is respected.
00117 };
00118 
00119 /* create window */
00120 CVAPI(int) cvNamedWindow( const char* name, int flags CV_DEFAULT(CV_WINDOW_AUTOSIZE) );
00121 
00122 /* Set and Get Property of the window */
00123 CVAPI(void) cvSetWindowProperty(const char* name, int prop_id, double prop_value);
00124 CVAPI(double) cvGetWindowProperty(const char* name, int prop_id);
00125 
00126 /* display image within window (highgui windows remember their content) */
00127 CVAPI(void) cvShowImage( const char* name, const CvArr* image );
00128 
00129 /* resize/move window */
00130 CVAPI(void) cvResizeWindow( const char* name, int width, int height );
00131 CVAPI(void) cvMoveWindow( const char* name, int x, int y );
00132 
00133 
00134 /* destroy window and all the trackers associated with it */
00135 CVAPI(void) cvDestroyWindow( const char* name );
00136 
00137 CVAPI(void) cvDestroyAllWindows(void);
00138 
00139 /* get native window handle (HWND in case of Win32 and Widget in case of X Window) */
00140 CVAPI(void*) cvGetWindowHandle( const char* name );
00141 
00142 /* get name of highgui window given its native handle */
00143 CVAPI(const char*) cvGetWindowName( void* window_handle );
00144 
00145 
00146 typedef void (CV_CDECL *CvTrackbarCallback)(int pos);
00147 
00148 /* create trackbar and display it on top of given window, set callback */
00149 CVAPI(int) cvCreateTrackbar( const char* trackbar_name, const char* window_name,
00150                              int* value, int count, CvTrackbarCallback on_change CV_DEFAULT(NULL));
00151 
00152 typedef void (CV_CDECL *CvTrackbarCallback2)(int pos, void* userdata);
00153 
00154 CVAPI(int) cvCreateTrackbar2( const char* trackbar_name, const char* window_name,
00155                               int* value, int count, CvTrackbarCallback2 on_change,
00156                               void* userdata CV_DEFAULT(0));
00157 
00158 /* retrieve or set trackbar position */
00159 CVAPI(int) cvGetTrackbarPos( const char* trackbar_name, const char* window_name );
00160 CVAPI(void) cvSetTrackbarPos( const char* trackbar_name, const char* window_name, int pos );
00161 
00162 enum
00163 {
00164     CV_EVENT_MOUSEMOVE      =0,
00165     CV_EVENT_LBUTTONDOWN    =1,
00166     CV_EVENT_RBUTTONDOWN    =2,
00167     CV_EVENT_MBUTTONDOWN    =3,
00168     CV_EVENT_LBUTTONUP      =4,
00169     CV_EVENT_RBUTTONUP      =5,
00170     CV_EVENT_MBUTTONUP      =6,
00171     CV_EVENT_LBUTTONDBLCLK  =7,
00172     CV_EVENT_RBUTTONDBLCLK  =8,
00173     CV_EVENT_MBUTTONDBLCLK  =9
00174 };
00175 
00176 enum
00177 {
00178     CV_EVENT_FLAG_LBUTTON   =1,
00179     CV_EVENT_FLAG_RBUTTON   =2,
00180     CV_EVENT_FLAG_MBUTTON   =4,
00181     CV_EVENT_FLAG_CTRLKEY   =8,
00182     CV_EVENT_FLAG_SHIFTKEY  =16,
00183     CV_EVENT_FLAG_ALTKEY    =32
00184 };
00185 
00186 typedef void (CV_CDECL *CvMouseCallback )(int event, int x, int y, int flags, void* param);
00187 
00188 /* assign callback for mouse events */
00189 CVAPI(void) cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse,
00190                                 void* param CV_DEFAULT(NULL));
00191 
00192 enum
00193 {
00194 /* 8bit, color or not */
00195     CV_LOAD_IMAGE_UNCHANGED  =-1,
00196 /* 8bit, gray */
00197     CV_LOAD_IMAGE_GRAYSCALE  =0,
00198 /* ?, color */
00199     CV_LOAD_IMAGE_COLOR      =1,
00200 /* any depth, ? */
00201     CV_LOAD_IMAGE_ANYDEPTH   =2,
00202 /* ?, any color */
00203     CV_LOAD_IMAGE_ANYCOLOR   =4
00204 };
00205 
00206 /* load image from file
00207   iscolor can be a combination of above flags where CV_LOAD_IMAGE_UNCHANGED
00208   overrides the other flags
00209   using CV_LOAD_IMAGE_ANYCOLOR alone is equivalent to CV_LOAD_IMAGE_UNCHANGED
00210   unless CV_LOAD_IMAGE_ANYDEPTH is specified images are converted to 8bit
00211 */
00212 CVAPI(IplImage*) cvLoadImage( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
00213 CVAPI(CvMat*) cvLoadImageM( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
00214 
00215 enum
00216 {
00217     CV_IMWRITE_JPEG_QUALITY =1,
00218     CV_IMWRITE_PNG_COMPRESSION =16,
00219     CV_IMWRITE_PNG_STRATEGY =17,
00220     CV_IMWRITE_PNG_BILEVEL =18,
00221     CV_IMWRITE_PNG_STRATEGY_DEFAULT =0,
00222     CV_IMWRITE_PNG_STRATEGY_FILTERED =1,
00223     CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY =2,
00224     CV_IMWRITE_PNG_STRATEGY_RLE =3,
00225     CV_IMWRITE_PNG_STRATEGY_FIXED =4,
00226     CV_IMWRITE_PXM_BINARY =32
00227 };
00228 
00229 /* save image to file */
00230 CVAPI(int) cvSaveImage( const char* filename, const CvArr* image,
00231                         const int* params CV_DEFAULT(0) );
00232 
00233 /* decode image stored in the buffer */
00234 CVAPI(IplImage*) cvDecodeImage( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
00235 CVAPI(CvMat*) cvDecodeImageM( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
00236 
00237 /* encode image and store the result as a byte vector (single-row 8uC1 matrix) */
00238 CVAPI(CvMat*) cvEncodeImage( const char* ext, const CvArr* image,
00239                              const int* params CV_DEFAULT(0) );
00240 
00241 enum
00242 {
00243     CV_CVTIMG_FLIP      =1,
00244     CV_CVTIMG_SWAP_RB   =2
00245 };
00246 
00247 /* utility function: convert one image to another with optional vertical flip */
00248 CVAPI(void) cvConvertImage( const CvArr* src, CvArr* dst, int flags CV_DEFAULT(0));
00249 
00250 /* wait for key event infinitely (delay<=0) or for "delay" milliseconds */
00251 CVAPI(int) cvWaitKey(int delay CV_DEFAULT(0));
00252 
00253 // OpenGL support
00254 
00255 typedef void (CV_CDECL *CvOpenGlDrawCallback)(void* userdata);
00256 CVAPI(void) cvSetOpenGlDrawCallback(const char* window_name, CvOpenGlDrawCallback callback, void* userdata CV_DEFAULT(NULL));
00257 
00258 CVAPI(void) cvSetOpenGlContext(const char* window_name);
00259 CVAPI(void) cvUpdateWindow(const char* window_name);
00260 
00261 
00262 /****************************************************************************************\
00263 *                         Working with Video Files and Cameras                           *
00264 \****************************************************************************************/
00265 
00266 /* "black box" capture structure */
00267 typedef struct CvCapture CvCapture;
00268 
00269 /* start capturing frames from video file */
00270 CVAPI(CvCapture*) cvCreateFileCapture( const char* filename );
00271 
00272 enum
00273 {
00274     CV_CAP_ANY      =0,     // autodetect
00275 
00276     CV_CAP_MIL      =100,   // MIL proprietary drivers
00277 
00278     CV_CAP_VFW      =200,   // platform native
00279     CV_CAP_V4L      =200,
00280     CV_CAP_V4L2     =200,
00281 
00282     CV_CAP_FIREWARE =300,   // IEEE 1394 drivers
00283     CV_CAP_FIREWIRE =300,
00284     CV_CAP_IEEE1394 =300,
00285     CV_CAP_DC1394   =300,
00286     CV_CAP_CMU1394  =300,
00287 
00288     CV_CAP_STEREO   =400,   // TYZX proprietary drivers
00289     CV_CAP_TYZX     =400,
00290     CV_TYZX_LEFT    =400,
00291     CV_TYZX_RIGHT   =401,
00292     CV_TYZX_COLOR   =402,
00293     CV_TYZX_Z       =403,
00294 
00295     CV_CAP_QT       =500,   // QuickTime
00296 
00297     CV_CAP_UNICAP   =600,   // Unicap drivers
00298 
00299     CV_CAP_DSHOW    =700,   // DirectShow (via videoInput)
00300 
00301     CV_CAP_PVAPI    =800,   // PvAPI, Prosilica GigE SDK
00302 
00303     CV_CAP_OPENNI   =900,   // OpenNI (for Kinect)
00304     CV_CAP_OPENNI_ASUS =910,   // OpenNI (for Asus Xtion)
00305 
00306     CV_CAP_ANDROID  =1000,  // Android
00307 
00308     CV_CAP_XIAPI    =1100,   // XIMEA Camera API
00309 
00310     CV_CAP_AVFOUNDATION = 1200,  // AVFoundation framework for iOS (OS X Lion will have the same API)
00311 
00312     CV_CAP_GIGANETIX = 1300  // Smartek Giganetix GigEVisionSDK
00313 };
00314 
00315 /* start capturing frames from camera: index = camera_index + domain_offset (CV_CAP_*) */
00316 CVAPI(CvCapture*) cvCreateCameraCapture( int index );
00317 
00318 /* grab a frame, return 1 on success, 0 on fail.
00319   this function is thought to be fast               */
00320 CVAPI(int) cvGrabFrame( CvCapture* capture );
00321 
00322 /* get the frame grabbed with cvGrabFrame(..)
00323   This function may apply some frame processing like
00324   frame decompression, flipping etc.
00325   !!!DO NOT RELEASE or MODIFY the retrieved frame!!! */
00326 CVAPI(IplImage*) cvRetrieveFrame( CvCapture* capture, int streamIdx CV_DEFAULT(0) );
00327 
00328 /* Just a combination of cvGrabFrame and cvRetrieveFrame
00329    !!!DO NOT RELEASE or MODIFY the retrieved frame!!!      */
00330 CVAPI(IplImage*) cvQueryFrame( CvCapture* capture );
00331 
00332 /* stop capturing/reading and free resources */
00333 CVAPI(void) cvReleaseCapture( CvCapture** capture );
00334 
00335 enum
00336 {
00337     // modes of the controlling registers (can be: auto, manual, auto single push, absolute Latter allowed with any other mode)
00338     // every feature can have only one mode turned on at a time
00339     CV_CAP_PROP_DC1394_OFF         = -4,  //turn the feature off (not controlled manually nor automatically)
00340     CV_CAP_PROP_DC1394_MODE_MANUAL = -3, //set automatically when a value of the feature is set by the user
00341     CV_CAP_PROP_DC1394_MODE_AUTO = -2,
00342     CV_CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1,
00343     CV_CAP_PROP_POS_MSEC       =0,
00344     CV_CAP_PROP_POS_FRAMES     =1,
00345     CV_CAP_PROP_POS_AVI_RATIO  =2,
00346     CV_CAP_PROP_FRAME_WIDTH    =3,
00347     CV_CAP_PROP_FRAME_HEIGHT   =4,
00348     CV_CAP_PROP_FPS            =5,
00349     CV_CAP_PROP_FOURCC         =6,
00350     CV_CAP_PROP_FRAME_COUNT    =7,
00351     CV_CAP_PROP_FORMAT         =8,
00352     CV_CAP_PROP_MODE           =9,
00353     CV_CAP_PROP_BRIGHTNESS    =10,
00354     CV_CAP_PROP_CONTRAST      =11,
00355     CV_CAP_PROP_SATURATION    =12,
00356     CV_CAP_PROP_HUE           =13,
00357     CV_CAP_PROP_GAIN          =14,
00358     CV_CAP_PROP_EXPOSURE      =15,
00359     CV_CAP_PROP_CONVERT_RGB   =16,
00360     CV_CAP_PROP_WHITE_BALANCE_BLUE_U =17,
00361     CV_CAP_PROP_RECTIFICATION =18,
00362     CV_CAP_PROP_MONOCROME     =19,
00363     CV_CAP_PROP_SHARPNESS     =20,
00364     CV_CAP_PROP_AUTO_EXPOSURE =21, // exposure control done by camera,
00365                                    // user can adjust refernce level
00366                                    // using this feature
00367     CV_CAP_PROP_GAMMA         =22,
00368     CV_CAP_PROP_TEMPERATURE   =23,
00369     CV_CAP_PROP_TRIGGER       =24,
00370     CV_CAP_PROP_TRIGGER_DELAY =25,
00371     CV_CAP_PROP_WHITE_BALANCE_RED_V =26,
00372     CV_CAP_PROP_ZOOM          =27,
00373     CV_CAP_PROP_FOCUS         =28,
00374     CV_CAP_PROP_GUID          =29,
00375     CV_CAP_PROP_ISO_SPEED     =30,
00376     CV_CAP_PROP_MAX_DC1394    =31,
00377     CV_CAP_PROP_BACKLIGHT     =32,
00378     CV_CAP_PROP_PAN           =33,
00379     CV_CAP_PROP_TILT          =34,
00380     CV_CAP_PROP_ROLL          =35,
00381     CV_CAP_PROP_IRIS          =36,
00382     CV_CAP_PROP_SETTINGS      =37,
00383 
00384     CV_CAP_PROP_AUTOGRAB      =1024, // property for highgui class CvCapture_Android only
00385     CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING=1025, // readonly, tricky property, returns cpnst char* indeed
00386     CV_CAP_PROP_PREVIEW_FORMAT=1026, // readonly, tricky property, returns cpnst char* indeed
00387 
00388     // OpenNI map generators
00389     CV_CAP_OPENNI_DEPTH_GENERATOR = 1 << 31,
00390     CV_CAP_OPENNI_IMAGE_GENERATOR = 1 << 30,
00391     CV_CAP_OPENNI_GENERATORS_MASK = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_OPENNI_IMAGE_GENERATOR,
00392 
00393     // Properties of cameras available through OpenNI interfaces
00394     CV_CAP_PROP_OPENNI_OUTPUT_MODE     = 100,
00395     CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, // in mm
00396     CV_CAP_PROP_OPENNI_BASELINE        = 102, // in mm
00397     CV_CAP_PROP_OPENNI_FOCAL_LENGTH    = 103, // in pixels
00398     CV_CAP_PROP_OPENNI_REGISTRATION    = 104, // flag
00399     CV_CAP_PROP_OPENNI_REGISTRATION_ON = CV_CAP_PROP_OPENNI_REGISTRATION, // flag that synchronizes the remapping depth map to image map
00400                                                                           // by changing depth generator's view point (if the flag is "on") or
00401                                                                           // sets this view point to its normal one (if the flag is "off").
00402     CV_CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105,
00403     CV_CAP_PROP_OPENNI_MAX_BUFFER_SIZE   = 106,
00404     CV_CAP_PROP_OPENNI_CIRCLE_BUFFER     = 107,
00405     CV_CAP_PROP_OPENNI_MAX_TIME_DURATION = 108,
00406 
00407     CV_CAP_PROP_OPENNI_GENERATOR_PRESENT = 109,
00408 
00409     CV_CAP_OPENNI_IMAGE_GENERATOR_PRESENT         = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT,
00410     CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE     = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_OUTPUT_MODE,
00411     CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE        = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_BASELINE,
00412     CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH    = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_FOCAL_LENGTH,
00413     CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION    = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_REGISTRATION,
00414     CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION,
00415 
00416     // Properties of cameras available through GStreamer interface
00417     CV_CAP_GSTREAMER_QUEUE_LENGTH   = 200, // default is 1
00418     CV_CAP_PROP_PVAPI_MULTICASTIP   = 300, // ip for anable multicast master mode. 0 for disable multicast
00419 
00420     // Properties of cameras available through XIMEA SDK interface
00421     CV_CAP_PROP_XI_DOWNSAMPLING  = 400,      // Change image resolution by binning or skipping.
00422     CV_CAP_PROP_XI_DATA_FORMAT   = 401,       // Output data format.
00423     CV_CAP_PROP_XI_OFFSET_X      = 402,      // Horizontal offset from the origin to the area of interest (in pixels).
00424     CV_CAP_PROP_XI_OFFSET_Y      = 403,      // Vertical offset from the origin to the area of interest (in pixels).
00425     CV_CAP_PROP_XI_TRG_SOURCE    = 404,      // Defines source of trigger.
00426     CV_CAP_PROP_XI_TRG_SOFTWARE  = 405,      // Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE.
00427     CV_CAP_PROP_XI_GPI_SELECTOR  = 406,      // Selects general purpose input
00428     CV_CAP_PROP_XI_GPI_MODE      = 407,      // Set general purpose input mode
00429     CV_CAP_PROP_XI_GPI_LEVEL     = 408,      // Get general purpose level
00430     CV_CAP_PROP_XI_GPO_SELECTOR  = 409,      // Selects general purpose output
00431     CV_CAP_PROP_XI_GPO_MODE      = 410,      // Set general purpose output mode
00432     CV_CAP_PROP_XI_LED_SELECTOR  = 411,      // Selects camera signalling LED
00433     CV_CAP_PROP_XI_LED_MODE      = 412,      // Define camera signalling LED functionality
00434     CV_CAP_PROP_XI_MANUAL_WB     = 413,      // Calculates White Balance(must be called during acquisition)
00435     CV_CAP_PROP_XI_AUTO_WB       = 414,      // Automatic white balance
00436     CV_CAP_PROP_XI_AEAG          = 415,      // Automatic exposure/gain
00437     CV_CAP_PROP_XI_EXP_PRIORITY  = 416,      // Exposure priority (0.5 - exposure 50%, gain 50%).
00438     CV_CAP_PROP_XI_AE_MAX_LIMIT  = 417,      // Maximum limit of exposure in AEAG procedure
00439     CV_CAP_PROP_XI_AG_MAX_LIMIT  = 418,      // Maximum limit of gain in AEAG procedure
00440     CV_CAP_PROP_XI_AEAG_LEVEL    = 419,       // Average intensity of output signal AEAG should achieve(in %)
00441     CV_CAP_PROP_XI_TIMEOUT       = 420,       // Image capture timeout in milliseconds
00442 
00443     // Properties for Android cameras
00444     CV_CAP_PROP_ANDROID_FLASH_MODE = 8001,
00445     CV_CAP_PROP_ANDROID_FOCUS_MODE = 8002,
00446     CV_CAP_PROP_ANDROID_WHITE_BALANCE = 8003,
00447     CV_CAP_PROP_ANDROID_ANTIBANDING = 8004,
00448     CV_CAP_PROP_ANDROID_FOCAL_LENGTH = 8005,
00449     CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_NEAR = 8006,
00450     CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_OPTIMAL = 8007,
00451     CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_FAR = 8008,
00452 
00453     // Properties of cameras available through AVFOUNDATION interface
00454     CV_CAP_PROP_IOS_DEVICE_FOCUS = 9001,
00455     CV_CAP_PROP_IOS_DEVICE_EXPOSURE = 9002,
00456     CV_CAP_PROP_IOS_DEVICE_FLASH = 9003,
00457     CV_CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004,
00458     CV_CAP_PROP_IOS_DEVICE_TORCH = 9005
00459 
00460     // Properties of cameras available through Smartek Giganetix Ethernet Vision interface
00461     /* --- Vladimir Litvinenko (litvinenko.vladimir@gmail.com) --- */
00462     ,CV_CAP_PROP_GIGA_FRAME_OFFSET_X = 10001,
00463     CV_CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002,
00464     CV_CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003,
00465     CV_CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004,
00466     CV_CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005,
00467     CV_CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006
00468 };
00469 
00470 enum
00471 {
00472     // Data given from depth generator.
00473     CV_CAP_OPENNI_DEPTH_MAP                 = 0, // Depth values in mm (CV_16UC1)
00474     CV_CAP_OPENNI_POINT_CLOUD_MAP           = 1, // XYZ in meters (CV_32FC3)
00475     CV_CAP_OPENNI_DISPARITY_MAP             = 2, // Disparity in pixels (CV_8UC1)
00476     CV_CAP_OPENNI_DISPARITY_MAP_32F         = 3, // Disparity in pixels (CV_32FC1)
00477     CV_CAP_OPENNI_VALID_DEPTH_MASK          = 4, // CV_8UC1
00478 
00479     // Data given from RGB image generator.
00480     CV_CAP_OPENNI_BGR_IMAGE                 = 5,
00481     CV_CAP_OPENNI_GRAY_IMAGE                = 6
00482 };
00483 
00484 // Supported output modes of OpenNI image generator
00485 enum
00486 {
00487     CV_CAP_OPENNI_VGA_30HZ     = 0,
00488     CV_CAP_OPENNI_SXGA_15HZ    = 1,
00489     CV_CAP_OPENNI_SXGA_30HZ    = 2,
00490     CV_CAP_OPENNI_QVGA_30HZ    = 3,
00491     CV_CAP_OPENNI_QVGA_60HZ    = 4
00492 };
00493 
00494 //supported by Android camera output formats
00495 enum
00496 {
00497     CV_CAP_ANDROID_COLOR_FRAME_BGR = 0, //BGR
00498     CV_CAP_ANDROID_COLOR_FRAME = CV_CAP_ANDROID_COLOR_FRAME_BGR,
00499     CV_CAP_ANDROID_GREY_FRAME  = 1,  //Y
00500     CV_CAP_ANDROID_COLOR_FRAME_RGB = 2,
00501     CV_CAP_ANDROID_COLOR_FRAME_BGRA = 3,
00502     CV_CAP_ANDROID_COLOR_FRAME_RGBA = 4
00503 };
00504 
00505 // supported Android camera flash modes
00506 enum
00507 {
00508     CV_CAP_ANDROID_FLASH_MODE_AUTO = 0,
00509     CV_CAP_ANDROID_FLASH_MODE_OFF,
00510     CV_CAP_ANDROID_FLASH_MODE_ON,
00511     CV_CAP_ANDROID_FLASH_MODE_RED_EYE,
00512     CV_CAP_ANDROID_FLASH_MODE_TORCH
00513 };
00514 
00515 // supported Android camera focus modes
00516 enum
00517 {
00518     CV_CAP_ANDROID_FOCUS_MODE_AUTO = 0,
00519     CV_CAP_ANDROID_FOCUS_MODE_CONTINUOUS_VIDEO,
00520     CV_CAP_ANDROID_FOCUS_MODE_EDOF,
00521     CV_CAP_ANDROID_FOCUS_MODE_FIXED,
00522     CV_CAP_ANDROID_FOCUS_MODE_INFINITY,
00523     CV_CAP_ANDROID_FOCUS_MODE_MACRO
00524 };
00525 
00526 // supported Android camera white balance modes
00527 enum
00528 {
00529     CV_CAP_ANDROID_WHITE_BALANCE_AUTO = 0,
00530     CV_CAP_ANDROID_WHITE_BALANCE_CLOUDY_DAYLIGHT,
00531     CV_CAP_ANDROID_WHITE_BALANCE_DAYLIGHT,
00532     CV_CAP_ANDROID_WHITE_BALANCE_FLUORESCENT,
00533     CV_CAP_ANDROID_WHITE_BALANCE_INCANDESCENT,
00534     CV_CAP_ANDROID_WHITE_BALANCE_SHADE,
00535     CV_CAP_ANDROID_WHITE_BALANCE_TWILIGHT,
00536     CV_CAP_ANDROID_WHITE_BALANCE_WARM_FLUORESCENT
00537 };
00538 
00539 // supported Android camera antibanding modes
00540 enum
00541 {
00542     CV_CAP_ANDROID_ANTIBANDING_50HZ = 0,
00543     CV_CAP_ANDROID_ANTIBANDING_60HZ,
00544     CV_CAP_ANDROID_ANTIBANDING_AUTO,
00545     CV_CAP_ANDROID_ANTIBANDING_OFF
00546 };
00547 
00548 /* retrieve or set capture properties */
00549 CVAPI(double) cvGetCaptureProperty( CvCapture* capture, int property_id );
00550 CVAPI(int)    cvSetCaptureProperty( CvCapture* capture, int property_id, double value );
00551 
00552 // Return the type of the capturer (eg, CV_CAP_V4W, CV_CAP_UNICAP), which is unknown if created with CV_CAP_ANY
00553 CVAPI(int)    cvGetCaptureDomain( CvCapture* capture);
00554 
00555 /* "black box" video file writer structure */
00556 typedef struct CvVideoWriter CvVideoWriter;
00557 
00558 CV_INLINE int CV_FOURCC(char c1, char c2, char c3, char c4)
00559 {
00560     return (c1 & 255) + ((c2 & 255) << 8) + ((c3 & 255) << 16) + ((c4 & 255) << 24);
00561 }
00562 
00563 #define CV_FOURCC_PROMPT -1  /* Open Codec Selection Dialog (Windows only) */
00564 #define CV_FOURCC_DEFAULT CV_FOURCC('I', 'Y', 'U', 'V') /* Use default codec for specified filename (Linux only) */
00565 
00566 /* initialize video file writer */
00567 CVAPI(CvVideoWriter*) cvCreateVideoWriter( const char* filename, int fourcc,
00568                                            double fps, CvSize frame_size,
00569                                            int is_color CV_DEFAULT(1));
00570 
00571 //CVAPI(CvVideoWriter*) cvCreateImageSequenceWriter( const char* filename,
00572 //                                                   int is_color CV_DEFAULT(1));
00573 
00574 /* write frame to video file */
00575 CVAPI(int) cvWriteFrame( CvVideoWriter* writer, const IplImage* image );
00576 
00577 /* close video file writer */
00578 CVAPI(void) cvReleaseVideoWriter( CvVideoWriter** writer );
00579 
00580 /****************************************************************************************\
00581 *                              Obsolete functions/synonyms                               *
00582 \****************************************************************************************/
00583 
00584 #define cvCaptureFromFile cvCreateFileCapture
00585 #define cvCaptureFromCAM cvCreateCameraCapture
00586 #define cvCaptureFromAVI cvCaptureFromFile
00587 #define cvCreateAVIWriter cvCreateVideoWriter
00588 #define cvWriteToAVI cvWriteFrame
00589 #define cvAddSearchPath(path)
00590 #define cvvInitSystem cvInitSystem
00591 #define cvvNamedWindow cvNamedWindow
00592 #define cvvShowImage cvShowImage
00593 #define cvvResizeWindow cvResizeWindow
00594 #define cvvDestroyWindow cvDestroyWindow
00595 #define cvvCreateTrackbar cvCreateTrackbar
00596 #define cvvLoadImage(name) cvLoadImage((name),1)
00597 #define cvvSaveImage cvSaveImage
00598 #define cvvAddSearchPath cvAddSearchPath
00599 #define cvvWaitKey(name) cvWaitKey(0)
00600 #define cvvWaitKeyEx(name,delay) cvWaitKey(delay)
00601 #define cvvConvertImage cvConvertImage
00602 #define HG_AUTOSIZE CV_WINDOW_AUTOSIZE
00603 #define set_preprocess_func cvSetPreprocessFuncWin32
00604 #define set_postprocess_func cvSetPostprocessFuncWin32
00605 
00606 #if defined WIN32 || defined _WIN32
00607 
00608 CVAPI(void) cvSetPreprocessFuncWin32_(const void* callback);
00609 CVAPI(void) cvSetPostprocessFuncWin32_(const void* callback);
00610 #define cvSetPreprocessFuncWin32(callback) cvSetPreprocessFuncWin32_((const void*)(callback))
00611 #define cvSetPostprocessFuncWin32(callback) cvSetPostprocessFuncWin32_((const void*)(callback))
00612 
00613 #endif
00614 
00615 #ifdef __cplusplus
00616 }
00617 #endif
00618 
00619 #endif