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 #define CVCAM_EXTERN_C extern "C"
49 #define CVCAM_EXTERN_C
50 #endif /* __cplusplus */
54 #define CVCAM_API CVCAM_EXTERN_C __declspec(dllexport)
56 #define CVCAM_API CVCAM_EXTERN_C
57 #endif /* CVCAM_DLLEXPORT */
59 /* Returns the actual number of currently available cameras */
60 CVCAM_API int cvcamGetCamerasCount();
62 /* get/set the property of the camera. returns 0 if the property is not supported */
63 CVCAM_API int cvcamGetProperty(int camera, const char* property, void* value);
64 CVCAM_API int cvcamSetProperty(int camera, const char* property, void* value);
66 /* gets all property names. the actual number of properties is returned. */
67 CVCAM_API int cvcamGetPropertiesList(int camera, const char** properties, int count);
69 CVCAM_API int cvcamBuildStereo(void);
71 /* Prepares the currently enabled cameras for work */
72 CVCAM_API int cvcamInit(void);
75 CVCAM_API int cvcamStart(void);
78 CVCAM_API int cvcamStop(void);
80 /* Pause the video; should be used for preventing data changes during frame reading
81 using "frame" and other properties */
82 CVCAM_API int cvcamPause(void);
84 /* Resume the video */
85 CVCAM_API int cvcamResume(void);
87 /* Frees all resources */
88 CVCAM_API int cvcamExit(void);
90 /*Pops up a camera(s) selection dialog
91 Return value - number of cameras selected (0,1 or 2);
92 Argument: an array of selected cameras numbers
93 NULL if none selected. Should be released with free() when not needed.
94 if NULL passed, not used.
96 CVCAM_API int cvcamSelectCamera(int** out);
98 /*Plays a specified avi file into a specified window
99 if file is NULL, file browser is opened. if window is 0,
100 it is created. width and height mean output size's 0 means
101 those of avi file are used. __cdecl (*callback)(IplImage*) would be
102 called on every frame. NULL means no callback*/
103 CVCAM_API int cvcamPlayAVI(const char* file,
110 /*Advanced API for dealing with AVI files*/
112 typedef unsigned int cvcamAVIFILE;
115 /*Opens a given file or pops up a dialog if file is NULL
116 returns a handle to the file opened for success or -1 for failure*/
117 CVCAM_API cvcamAVIFILE cvcamAVIOpenFile(char* file);
119 /*The next functions just do what they say and return 0
120 for success, anything other for failure*/
122 CVCAM_API int cvcamAVICloseFile(cvcamAVIFILE file);
124 CVCAM_API int cvcamAVISetWindow(cvcamAVIFILE file, void* window);
126 CVCAM_API int cvcamAVISetCallback(cvcamAVIFILE file, void* callback);
128 CVCAM_API int cvcamAVISetSize(cvcamAVIFILE file, int width, int height);
130 CVCAM_API int cvcamAVIRun(cvcamAVIFILE file);
132 CVCAM_API int cvcamAVIStop(cvcamAVIFILE file);
134 CVCAM_API int cvcamAVIPause(cvcamAVIFILE file);
136 CVCAM_API int cvcamAVIResume(cvcamAVIFILE file);
138 CVCAM_API int cvcamAVIWaitCompletion(cvcamAVIFILE file);
140 CVCAM_API int cvcamAVIIsRunning(cvcamAVIFILE file);
142 static const char CVCAM_PROP_ENABLE[] = "enable";
143 static const char CVCAM_PROP_RENDER[] = "render";
144 static const char CVCAM_PROP_WINDOW[] = "window";
145 static const char CVCAM_PROP_CALLBACK[] = "callback";
146 static const char CVCAM_DESCRIPTION[] = "description";
147 static const char CVCAM_VIDEOFORMAT[] = "video_pp";
148 static const char CVCAM_CAMERAPROPS[] = "camera_pp";
149 static const char CVCAM_RNDWIDTH[] = "rendering_width";
150 static const char CVCAM_RNDHEIGHT[] = "rendering_height";
151 static const char CVCAM_SRCWIDTH[] = "source_width";
152 static const char CVCAM_SRCHEIGHT[] = "source_height";
153 static const char CVCAM_STEREO_CALLBACK[] = "stereo_callback";
154 static const char CVCAM_STEREO3_CALLBACK[] = "stereo3_callback";
155 static const char CVCAM_STEREO4_CALLBACK[] = "stereo4_callback";
156 static const char CVCAM_PROP_SETFORMAT[] = "set_video_format";
157 static const char CVCAM_PROP_RAW[] = "raw_image";
158 static const char CVCAM_PROP_TIME_FORMAT[] = "time_format";
159 static const char CVCAM_PROP_DURATION[] = "duration";
160 static const char CVCAM_PROP_POSITION[] = "current_position";
162 extern const int FRAMES_FORMAT ;
163 extern const int TIME_FORMAT ;
167 char DeviceDescription[100];
170 char ChannelDescription[100];
185 #define CVCAMTRUE (void*)1
186 #define CVCAMFALSE (void*)0
188 typedef int cvcamWindow;
193 #endif /* __cplusplus */