VidCapDll.h File Reference
#include "CVRes.h"
#include "CVImageStructs.h"
#include "CVResFile.h"
#include "CVResImage.h"
#include "CVResVidCap.h"
#include "CVResDll.h"
Go to the source code of this file. Defines
Typedefs
Enumerations
Functions
- CVRES VIDCAPFUNC CVAcquireVidCap (CVVIDCAPSYSTEM *vidCapSystem)
- CVRES VIDCAPFUNC CVReleaseVidCap (CVVIDCAPSYSTEM vidCapSystem)
- int VIDCAPFUNC CVGetNumDevices (CVVIDCAPSYSTEM vidCapSystem)
- CVRES VIDCAPFUNC CVGetDeviceName (CVVIDCAPSYSTEM vidCapSystem, int deviceNum, char *devNameBuffer, int *nameBufLen)
- CVRES VIDCAPFUNC CVDevConnect (CVVIDCAPSYSTEM vidCapSystem, int devIndex)
- CVRES VIDCAPFUNC CVDevDisconnect (CVVIDCAPSYSTEM vidCapSystem)
- int VIDCAPFUNC CVDevGetNumModes (CVVIDCAPSYSTEM vidCapSystem)
- CVRES VIDCAPFUNC CVDevGetModeInfo (CVVIDCAPSYSTEM vidCapSystem, int modeIndex, int *xRes, int *yRes, int *frameRate, int *vidFormat)
- CVRES VIDCAPFUNC CVDevGetFormatName (CVVIDCAPSYSTEM vidCapSystem, int vidFormat, char *vidFormatNameBuf, int *vidFormatBufLen)
- CVRES VIDCAPFUNC CVDevGrabImage (CVVIDCAPSYSTEM vidCapSystem, int modeIndex, CVIMAGETYPE imageType, struct CVIMAGESTRUCT **imageStructPtrPtr)
- CVRES VIDCAPFUNC CVDevStartCap (CVVIDCAPSYSTEM vidCapSystem, int modeIndex, CVIMAGETYPE imageType, CVVIDCAPDLLCB callback, void *cbUserParm, CVCAPHANDLE *capHandlePtr)
- CVRES VIDCAPFUNC CVDevStopCap (CVVIDCAPSYSTEM vidCapSystem, CVCAPHANDLE capHandle)
- CVRES VIDCAPFUNC CVLoadImage (const char *filename, struct CVIMAGESTRUCT **imageStructPtrPtr)
- CVRES VIDCAPFUNC CVSaveImage (const char *filename, struct CVIMAGESTRUCT *imageStructPtr, BOOL overwrite)
- void VIDCAPFUNC CVReleaseImage (struct CVIMAGESTRUCT *imageStructPtr)
- void VIDCAPFUNC CVGetVidCapString (char *buffer, int *bufLength)
- CVRES VIDCAPFUNC CVDevGetProperty (CVVIDCAPSYSTEM capSystem, CVCAMERAPROP property, long *curValue, long *defValue, long *minValue, long *maxValue, long *step)
- CVRES VIDCAPFUNC CVDevSetProperty (CVVIDCAPSYSTEM capSystem, CVCAMERAPROP property, long newValue)
Define Documentation
| #define VIDCAPFUNC _declspec(dllimport) WINAPI
|
|
|
|
Definition at line 73 of file VidCapDll.h.
Referenced by CVAcquireVidCap(), CVDevConnect(), CVDevDisconnect(), CVDevGetFormatName(), CVDevGetModeInfo(), CVDevGetNumModes(), CVDevGetProperty(), CVDevGrabImage(), CVDevSetProperty(), CVDevStartCap(), CVDevStopCap(), CVGetDeviceName(), CVGetNumDevices(), CVGetVidCapString(), CVLoadImage(), CVReleaseImage(), CVReleaseVidCap(), and CVSaveImage(). |
Typedef Documentation
Enumeration Type Documentation
|
|
- Enumeration values:
-
| CVCAM_BRIGHT |
|
| CVCAM_CONTRAST |
|
| CVCAM_HUE |
|
| CVCAM_SAT |
|
| CVCAM_SHARP |
|
| CVCAM_GAMMA |
|
| CVCAM_WHITEBALANCE |
|
| CVCAM_GAIN |
|
| CVCAMERAPROP_LAST |
|
Definition at line 349 of file VidCapDll.h. |
Function Documentation
|
|
CVAcquireVidCap() acquires a video capture object and initializes it. You must call CVReleaseVidCap() when done with the handle returned on a successful call.
- Parameters:
-
| capSystem | - ref to handle. Contains new handle on success. |
- Returns:
- CVRES - CVRES_SUCCESS on successful initialization.
- See also:
- CVReleaseVidCap()
Successful - save handle and return
Didn't initialize properly - uninitialize and return error.
Definition at line 96 of file VidCapDll.cpp.
References CVPlatform::AcquireVideoCapture(), CVRES, CVRES_DLL_VIDCAP_CREATE_ERROR, CVRES_INVALID_PARAMETER, CVRES_SUCCESS, CVSUCCESS, CVVIDCAPSYSTEM, CVPlatform::GetPlatform(), CVVidCapture::Init(), CVPlatform::Release(), and VIDCAPFUNC.
Referenced by main(). |
| CVRES VIDCAPFUNC CVDevGetFormatName |
( |
CVVIDCAPSYSTEM |
capSystem, |
|
|
int |
vidFormat, |
|
|
char * |
vidFormatNameBuf, |
|
|
int * |
vidFormatBufLen |
|
) |
|
|
| CVRES VIDCAPFUNC CVDevGetModeInfo |
( |
CVVIDCAPSYSTEM |
capSystem, |
|
|
int |
modeIndex, |
|
|
int * |
xRes, |
|
|
int * |
yRes, |
|
|
int * |
frameRate, |
|
|
int * |
vidFormat |
|
) |
|
|
|
|
CVDevGetModeInfo() retrieve information about the specified mode.
- Parameters:
-
| capSystem | - handle from CVAcquireVidCap() |
| modeIndex | - index of mode to use for capture |
| xRes | - ptr to receive x resolution of the camera mode |
| yRes | - ptr to receive y resolution of the camera mode |
| frameRate | - ptr to receive estimated framerate (may be null) |
| vidFormat | - ptr to receive input video mode value (VIDCAP_FORMAT) may be null. |
- Returns:
- CVRES - CVRES_SUCCESS on success
- See also:
- CVDevGetNumModes(), CVDevConnect(),
Definition at line 363 of file VidCapDll.cpp.
References CVAssert, CVFAILED, CVRES, CVRES_DLL_VIDCAP_INVALID_HANDLE, CVRES_INVALID_PARAMETER, CVRES_SUCCESS, CVVidCapture::VIDCAP_MODE::EstFrameRate, CVVidCapture::GetModeInfo(), CVVidCapture::VIDCAP_MODE::InputFormat, VIDCAPFUNC, CVVidCapture::VIDCAP_MODE::XRes, and CVVidCapture::VIDCAP_MODE::YRes.
Referenced by main(). |
| CVRES VIDCAPFUNC CVDevGetProperty |
( |
CVVIDCAPSYSTEM |
capSystem, |
|
|
CVCAMERAPROP |
property, |
|
|
long * |
curValue, |
|
|
long * |
defValue, |
|
|
long * |
minValue, |
|
|
long * |
maxValue, |
|
|
long * |
step |
|
) |
|
|
|
|
CVDevGetProperty() retrieves the current, minimum, and maximum values for the specified property.
If the property is not supported by the camera, then it will return CVRES_DLL_VIDCAP_UNSUPPORTED_PROPERTY.
- Parameters:
-
| capSystem | - handle to *connected* capture system. |
| property | - property identifier |
| curValue | - ptr to receive current value of property. |
| defValue | - ptr to receive default value of property. |
| minValue | - ptr to receive minimum value of property. |
| maxValue | - ptr to receive maximum value of property. |
| step | - ptr to receive the minimum step distance between values. |
- See also:
- CVDevSetProperty()
This is a bit fugly, but I want to allow the class values to change while the DLL Values can't. Also, some properties probably shouldn't be messed with by the DLL (e.g. COLOR).
And, we've got the added bonus that bad values can be detected here...
Definition at line 882 of file VidCapDll.cpp.
References CVVidCapture::CAMERA_PROPERTY, CVVidCapture::CAMERAPROP_BRIGHT, CVVidCapture::CAMERAPROP_CONTRAST, CVVidCapture::CAMERAPROP_GAIN, CVVidCapture::CAMERAPROP_GAMMA, CVVidCapture::CAMERAPROP_HUE, CVVidCapture::CAMERAPROP_SAT, CVVidCapture::CAMERAPROP_SHARP, CVVidCapture::CAMERAPROP_WHITEBALANCE, CVAssert, CVCAM_BRIGHT, CVCAM_CONTRAST, CVCAM_GAIN, CVCAM_GAMMA, CVCAM_HUE, CVCAM_SAT, CVCAM_SHARP, CVCAM_WHITEBALANCE, CVRES, CVRES_DLL_VIDCAP_INVALID_HANDLE, CVRES_INVALID_PARAMETER, CVVidCapture::GetPropertyInfo(), and VIDCAPFUNC.
Referenced by main(). |
|
|
CVDevSetProperty() sets the specified property value for the camera.
If the property is not supported by the camera, then it will return CVRES_DLL_VIDCAP_UNSUPPORTED_PROPERTY.
- Parameters:
-
| capSystem | - handle to *connected* capture system. |
| property | - property identifier |
| newValue | - new value for the property. Should be within range given by CVGetProperty() |
- See also:
- CVDevGetProperty()
This is a bit fugly, but I want to allow the class values to change while the DLL Values can't. Also, some properties probably shouldn't be messed with by the DLL (e.g. COLOR).
And, we've got the added bonus that bad values can be detected here...
Definition at line 966 of file VidCapDll.cpp.
References CVVidCapture::CAMERA_PROPERTY, CVVidCapture::CAMERAPROP_BRIGHT, CVVidCapture::CAMERAPROP_CONTRAST, CVVidCapture::CAMERAPROP_GAIN, CVVidCapture::CAMERAPROP_GAMMA, CVVidCapture::CAMERAPROP_HUE, CVVidCapture::CAMERAPROP_SAT, CVVidCapture::CAMERAPROP_SHARP, CVVidCapture::CAMERAPROP_WHITEBALANCE, CVAssert, CVCAM_BRIGHT, CVCAM_CONTRAST, CVCAM_GAIN, CVCAM_GAMMA, CVCAM_HUE, CVCAM_SAT, CVCAM_SHARP, CVCAM_WHITEBALANCE, CVRES, CVRES_DLL_VIDCAP_INVALID_HANDLE, CVRES_INVALID_PARAMETER, CVVidCapture::SetProperty(), and VIDCAPFUNC.
Referenced by main(). |
|
|
CVDevStartCap() starts a continuous capture, sending each image to the specified callback.
The CVIMAGESTRUCT* passed to the callback is *only* valid during the callback! You must copy the data out if you'll need it later. However, you should NOT call CVReleaseImage() on it - the DLL will do that for you when your callback function returns.
- Parameters:
-
| capSystem | - handle from CVAcquireVidCap() |
| modeIndex | - index of mode to use for capture |
| imageType | - type of image to capture |
| callback | - callback to receive images during capture |
| cbUserParam | - user parameter to send to callback |
| capHandlePtr | - ptr to receive capture handle. |
- Returns:
- CVRES - CVRES_SUCCESS on success
Create a capture structure for our callback
If we didn't start successfully, clean up the capture struct
Definition at line 594 of file VidCapDll.cpp.
References CVAssert, CVCAPHANDLE, CVFAILED, CVImage::CVIMAGE_TYPE, CVRES, CVRES_DLL_VIDCAP_INVALID_HANDLE, DllCaptureCb(), DLLCAPTURESTRUCT::HostCallback, DLLCAPTURESTRUCT::HostUserParam, CVVidCapture::StartImageCap(), and VIDCAPFUNC.
Referenced by main(). |
| CVRES VIDCAPFUNC CVGetDeviceName |
( |
CVVIDCAPSYSTEM |
capSystem, |
|
|
int |
deviceNum, |
|
|
char * |
devNameBuffer, |
|
|
int * |
nameBufLen |
|
) |
|
|
|
|
CVGetDeviceName() retrieves the name of a capture device into the provided buffer.
- Parameters:
-
| capSystem | - handle from CVAcquireVidCap() |
| deviceNum | - index of device (0 -> CVGetNumDevices() - 1) |
| devNameBuffer | - buffer to receive ASCIIZ device name. must be allocated by caller! |
| nameBufLen | - ptr to Maximum length of devNameBuffer. set to length of device name on return. |
- Returns:
- CVRES - CVRES_SUCCESS on success.
- See also:
- CVGetNumDevices(), CVDevConnect()
Definition at line 230 of file VidCapDll.cpp.
References CVAssert, CVFAILED, CVRES, CVRES_DLL_VIDCAP_DEV_NOT_FOUND, CVRES_DLL_VIDCAP_INVALID_HANDLE, CVRES_INVALID_PARAMETER, CVRES_SUCCESS, CVVidCapture::VIDCAP_DEVICE::DeviceString, CVVidCapture::GetDeviceInfo(), and VIDCAPFUNC.
Referenced by main(). |
| void VIDCAPFUNC CVGetVidCapString |
( |
char * |
buffer, |
|
|
int * |
bufLength |
|
) |
|
|
| CVRES VIDCAPFUNC CVLoadImage |
( |
const char * |
filename, |
|
|
struct CVIMAGESTRUCT ** |
imageStructPtrPtr |
|
) |
|
|
| void VIDCAPFUNC CVReleaseImage |
( |
struct CVIMAGESTRUCT * |
imageStructPtr |
) |
|
|
| CVRES VIDCAPFUNC CVSaveImage |
( |
const char * |
filename, |
|
|
struct CVIMAGESTRUCT * |
imageStructPtr, |
|
|
BOOL |
overwrite |
|
) |
|
|
|