CodeVis.com SourceForge.net Logo

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

  • #define VIDCAPFUNC   _declspec(dllimport) WINAPI

Typedefs

Enumerations

Functions


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

typedef int CVCAMERAPROP
 

Definition at line 348 of file VidCapDll.h.

typedef void* CVCAPHANDLE
 

Definition at line 98 of file VidCapDll.h.

Referenced by CVDevStartCap(), and main().

typedef BOOL(WINAPI* CVVIDCAPDLLCB)( CVRES status, struct CVIMAGESTRUCT* imagePtr, void* userParam )
 

Definition at line 105 of file VidCapDll.h.

typedef void* CVVIDCAPSYSTEM
 

Definition at line 91 of file VidCapDll.h.

Referenced by CVAcquireVidCap(), and main().


Enumeration Type Documentation

anonymous enum
 

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

CVRES VIDCAPFUNC CVAcquireVidCap CVVIDCAPSYSTEM capSystem  ) 
 

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 CVDevConnect CVVIDCAPSYSTEM  capSystem,
int  devIndex
 

CVDevConnect() connects to the specified device. Only one device should be connected at a time.

Call CVDevDisconnect() then done with the capture device handle.

Parameters:
capSystem - handle from CVAcquireVidCap()
devIndex - index of device (from GetDeviceName/GetNumDevices)
Returns:
CVRES - CVRES_SUCCESS on success
See also:
CVDevDisconnect(), CVGetDeviceName(), CVAcquireVidCap()

Definition at line 283 of file VidCapDll.cpp.

References CVVidCapture::Connect(), CVAssert, CVRES, CVRES_DLL_VIDCAP_INVALID_HANDLE, and VIDCAPFUNC.

Referenced by main().

CVRES VIDCAPFUNC CVDevDisconnect CVVIDCAPSYSTEM  capSystem  ) 
 

CVDevDisconnect() disconnects a previously connected device. CVDevDisconnect() should be called when done with a capture device connected via CVDevConnect().

Parameters:
capSystem - handle from CVAcquireVidCap()
Returns:
CVRES - CVRES_SUCCESS on success
See also:
CVDevCOnnect()

Definition at line 306 of file VidCapDll.cpp.

References CVAssert, CVRES, CVRES_DLL_VIDCAP_INVALID_HANDLE, CVVidCapture::Disconnect(), and VIDCAPFUNC.

Referenced by main().

CVRES VIDCAPFUNC CVDevGetFormatName CVVIDCAPSYSTEM  capSystem,
int  vidFormat,
char *  vidFormatNameBuf,
int *  vidFormatBufLen
 

CVDevGetFormatName() retrieves the name of the video format for a camera mode.

Parameters:
capSystem - handle from CVAcquireVidCap()
vidFormat - video format type (from CVDevGetModeInfo)
vidFormatNameBuf - ptr to buffer to receive format name
vidFormatBufLen - ptr to length of buffer. set to length of name on return.
Returns:
CVRES - CVRES_SUCCESS on success
See also:
CVDevGetModeInfo()

Definition at line 422 of file VidCapDll.cpp.

References CVRES, CVRES_DLL_VIDCAP_INVALID_HANDLE, CVRES_INVALID_PARAMETER, CVRES_SUCCESS, CVRES_VIDCAP_VIDEO_FORMAT_NOT_SUPPORTED, CVVidCapture::GetFormatModeName(), VIDCAP_FORMAT, VIDCAP_NUM_FORMATS, and VIDCAPFUNC.

Referenced by main().

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().

int VIDCAPFUNC CVDevGetNumModes CVVIDCAPSYSTEM  capSystem  ) 
 

CVDevGetNumModes() retrieves the number of available mode on a connected capture device.

You *must* connect to a device before you can retrieve the available modes for it. If you do not, you'll just get 0 for the number of modes.

Parameters:
capSystem - handle from CVAcquireVidCap()
Returns:
int - number of modes available for the connected device

An error occurred...

Definition at line 329 of file VidCapDll.cpp.

References CVAssert, CVSUCCESS, CVVidCapture::GetNumSupportedModes(), and VIDCAPFUNC.

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().

CVRES VIDCAPFUNC CVDevGrabImage CVVIDCAPSYSTEM  vidCapSystem,
int  modeIndex,
CVIMAGETYPE  imageType,
struct CVIMAGESTRUCT **  imageStructPtrPtr
 

Referenced by main().

CVRES VIDCAPFUNC CVDevSetProperty CVVIDCAPSYSTEM  capSystem,
CVCAMERAPROP  property,
long  newValue
 

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().

CVRES VIDCAPFUNC CVDevStartCap CVVIDCAPSYSTEM  capSystem,
int  modeIndex,
CVIMAGETYPE  imageType,
CVVIDCAPDLLCB  callback,
void *  cbUserParam,
CVCAPHANDLE capHandlePtr
 

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 CVDevStopCap CVVIDCAPSYSTEM  capSystem,
CVCAPHANDLE  capHandle
 

CVDevStopCap() halts an image capture session started by CVDevStartCap().

This must be called for cleanup even if the capture is stopped prematurely by an error or by returning false from within the callback function.

Parameters:
capSystem - vidcap handle from CVAcquireVidCap()
capHandle - cap handle received from CVDevStartCap()

Cleanup the capture structure

Definition at line 639 of file VidCapDll.cpp.

References CVAssert, CVRES, CVRES_DLL_VIDCAP_INVALID_HANDLE, CVRES_INVALID_PARAMETER, CVRES_SUCCESS, CVVidCapture::Stop(), 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().

int VIDCAPFUNC CVGetNumDevices CVVIDCAPSYSTEM  capSystem  ) 
 

CVGetNumDevices() retrieves the number of capture devices available to the VidCap .DLL.

Parameters:
capSystem - handle from CVAcquireVidCap()
Returns:
int - number of available capture devices.

CVRES_DLL_VIDCAP_INVALID_HANDLE

Definition at line 159 of file VidCapDll.cpp.

References CVAssert, CVVidCapture::GetNumDevices(), and VIDCAPFUNC.

Referenced by main().

void VIDCAPFUNC CVGetVidCapString char *  buffer,
int *  bufLength
 

CVGetVidCapString() retrieves the library identifier/copyright string.

Parameters:
buffer - buffer to receive capture string
bufLength - ptr to size of buffer. Set to length of string on return.

Definition at line 794 of file VidCapDll.cpp.

References kVIDCAPTURE_STRING, and VIDCAPFUNC.

Referenced by main().

CVRES VIDCAPFUNC CVLoadImage const char *  filename,
struct CVIMAGESTRUCT **  imageStructPtrPtr
 

void VIDCAPFUNC CVReleaseImage struct CVIMAGESTRUCT imageStructPtr  ) 
 

Referenced by main().

CVRES VIDCAPFUNC CVReleaseVidCap CVVIDCAPSYSTEM  capSystem  ) 
 

CVReleaseVidCap() releases a previously allocated video capture object.

Parameters:
capSystem - handle from CVACquireVidCap().
See also:
CVAcquireVidCap()

Definition at line 132 of file VidCapDll.cpp.

References CVRES, CVRES_SUCCESS, CVPlatform::GetPlatform(), CVPlatform::Release(), and VIDCAPFUNC.

Referenced by main().

CVRES VIDCAPFUNC CVSaveImage const char *  filename,
struct CVIMAGESTRUCT imageStructPtr,
BOOL  overwrite
 

Referenced by ImageCallback(), and main().


Generated on Mon Mar 1 13:27:13 2004 for VidCapture Library by doxygen 1.3.3
CodeVis VidCapture 0.2 Copyright © 2003-2004 by Michael Ellison.