Main Page | Directories | File List | Globals | Related Pages

VideoWrapper_DCAM.cpp File Reference

Implements an API adapter for the Videre Design DCAM SDK version 2.3b. More...

#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <dcam.h>
#include "VideoWrapperLibAdapter.h"
#include "VideoWrapperTime.h"
#include "VideoWrapperScale.h"

Functions

void setPrintFunction (VWAPrintFcn *func)
 Sets a callback function to be used for printing messages.
VWResult openVideo (char *lpCmdLine, VWHCamera *phCam)
 Intializes a video camera.
VWResult startVideo (VWHCamera hCam)
 Starts aquiring frames from the camera.
VWResult stopVideo (VWHCamera hCam)
 Stops aquiring frames from the camera.
VWResult resetVideo (VWHCamera hCam, VWBool bAutomatic)
 Resets all the camera parameters to defaults.
VWResult showPropertiesDialog (VWHCamera hCam)
 Pops up the properties screen associated with this device.
VWResult getFrame (VWHCamera hCam, unsigned char **im, timeval *timestamp)
 Captures a video frame.
VWResult releaseFrame (VWHCamera hCam)
 Releases the frame so that the space can be freed.
VWResult closeVideo (VWHCamera hCam)
 Close the video camera.
VWResult getVideoWidth (VWHCamera hCam, int *pnWidth)
 Gets the video width.
VWResult getVideoHeight (VWHCamera hCam, int *pnHeight)
 Gets the video height.
VWResult getVideoPixelFormat (VWHCamera hCam, VWPixelFormat *pPixelFormat)
 Gets the pixel format of the video frame buffer.
VWResult getVideoDepth (VWHCamera hCam, int *pnDepth)
 Gets color depth as bits ber pixel.
VWResult getFrameRate (VWHCamera hCam, double *pdFrameRate)
 Gets the frame rate of the camera as frames per second.
VWResult setPropertyLong (VWHCamera hCam, VWCamProp propId, long lValue1, long lValue2, VWBool bAuto)
 Sets a long-typed camera property such as white balance, gain, etc.
VWResult getPropertyLong (VWHCamera hCam, VWCamProp propId, long *plValue1, long *plValue2, VWBool *pbAuto)
 Gets a long-typed camera property such as white balance, gain, etc.
VWResult getPropertyRangeLong (VWHCamera hCam, VWCamProp propId, long *plMinValue, long *plMaxValue, VWBool *pbAuto)
 Gets the valid range for a long-typed camera property such as white balance, gain, etc.
VWResult setPropertyString (VWHCamera hCam, VWCamProp propId, char *szValue)
 Sets a string-typed camera property.
VWResult getPropertyString (VWHCamera hCam, VWCamProp propId, char *szValue, int nSize)
 Gets a string-typed camera property.


Detailed Description

Implements an API adapter for the Videre Design DCAM SDK version 2.3b.

For use by VideoWrapper.

See also:
VideoWrapper.h
Copyright 2004-5, Georgia Tech Research Corporation, Atlanta, Georgia 30332-0415 All Rights Reserved

Function Documentation

VWResult closeVideo VWHCamera  hCam  ) 
 

Close the video camera.

Parameters:
hCam Handle to video camera.
Returns:
VWResult indicating success or failure.

VWResult getFrame VWHCamera  hCam,
unsigned char **  ppbFrame,
timeval *  pTimestamp = NULL
 

Captures a video frame.

Parameters:
hCam Handle to video camera.
[out] ppbFrame Pointer returning the captured video frame. Memory is alocated by the camera library.
[out] pTimestamp Pointer returning the timestamp of the captured video frame.
Returns:
VWResult indicating success or failure.

VWResult getFrameRate VWHCamera  hCam,
double *  pdFrameRate
 

Gets the frame rate of the camera as frames per second.

Parameters:
hCam Handle to video camera.
[out] pdFrameRate Pointer returning the frame rate of the camera.
Returns:
VWResult indicating success or failure.

VWResult getPropertyLong VWHCamera  hCam,
VWCamProp  propId,
long *  plValue1 = NULL,
long *  plValue2 = NULL,
VWBool pbAuto = NULL
 

Gets a long-typed camera property such as white balance, gain, etc.

Some properties are composed of two values. Symbols for camera properties are defined in VideoWrapperTypes.h.

Parameters:
propId Identifier of the property.
[out] plValue1 Pointer returning first property value.
[out] plValue2 Pointer returning second property value. Not used with most properties.
Returns:
VWResult indicating success or failure.
See also:
VWCamProp

VWResult getPropertyRangeLong VWHCamera  hCam,
VWCamProp  propId,
long *  plMinValue = NULL,
long *  plMaxValue = NULL,
VWBool pbAuto = NULL
 

Gets the valid range for a long-typed camera property such as white balance, gain, etc.

Symbols for camera properties are defined in VideoWrapperTypes.h.

Parameters:
propId Identifier of the property.
lValue1 First property value.
lValue2 Second property value. Not used with most properties.
Returns:
VWResult indicating success or failure.
See also:
VWCamProp

VWResult getPropertyString VWHCamera  hCam,
VWCamProp  propId,
char *  szValue,
int  nSize
 

Gets a string-typed camera property.

Parameters:
propId Identifier of the property.
[in] szValue Property value.
Returns:
VWResult indicating success or failure.
See also:
VWCamProp

VWResult getVideoDepth VWHCamera  hCam,
int *  pnDepth
 

Gets color depth as bits ber pixel.

Always returns 24.

Parameters:
hCam Handle to video camera.
[out] pnDepth Pointer returning the bits per pixel.
Returns:
VWResult indicating success or failure.

VWResult getVideoHeight VWHCamera  hCam,
int *  pnHeight
 

Gets the video height.

Parameters:
hCam Handle to video camera.
[out] pnHeight Pointer returning the height of the video.
Returns:
VWResult indicating success or failure.

VWResult getVideoPixelFormat VWHCamera  hCam,
VWPixelFormat pPixelFormat
 

Gets the pixel format of the video frame buffer.

Parameters:
hCam Handle to video camera.
[out] pnFormat Pointer returning an integer expressing the pixel format.
Returns:
VWResult indicating success or failure.
See also:
VWPixelFormat

VWResult getVideoWidth VWHCamera  hCam,
int *  pnWidth
 

Gets the video width.

Parameters:
hCam Handle to video camera.
[out] pnWidth Pointer returning the width of the video.
Returns:
VWResult indicating success or failure.

VWResult openVideo char *  szInit,
VWHCamera phCam
 

Intializes a video camera.

Parameters:
[in] szInit An implementation-dependent string used to configure the camera. Consult the 'VideoWrapper_xxx Details' page for the API adapter you are instantiating for the string format. Generally, however, the string is formatted as follows: "libId: camNum width frameRate colorMode scale outputMode" where
  • libId is the identifier for the API adapter library.
  • camNum is a number (starting at 0) representing the camera to open.
  • width is the desired frame width.
  • frameRate is the desired frame rate
  • colorMode is a string specifying the format of the desired color mode (e.g. rgb, yuv).
  • scale is 0 or 1. 1 means a mode of 2x or 4x the size can be used, and scaled to the correct size.
[out] phVideo Pointer to the handle for opened camera.
Returns:
VWResult indicating success or failure.

VWResult releaseFrame VWHCamera  hCam  ) 
 

Releases the frame so that the space can be freed.

Parameters:
hCam Handle to video camera.
Returns:
VWResult indicating success or failure.

VWResult resetVideo VWHCamera  hCam,
VWBool  bAutomatic
 

Resets all the camera parameters to defaults.

Parameters:
hCam Handle to video camera.
bAutomatic If true, allow the camera to auto-adust.
Returns:
VWResult indicating success or failure.

void setPrintFunction VWAPrintFcn *  function  ) 
 

Sets a callback function to be used for printing messages.

Parameters:
function: ptr to print function

VWResult setPropertyLong VWHCamera  hCam,
VWCamProp  propId,
long  lValue1,
long  lValue2 = 0L,
VWBool  bAuto = FALSE
 

Sets a long-typed camera property such as white balance, gain, etc.

Some properties are composed of two values. Symbols for camera properties are defined in VideoWrapperTypes.h.

Parameters:
propId Identifier of the property.
lValue1 First property value.
lValue2 Second property value. Not used with most properties.
Returns:
VWResult indicating success or failure.
See also:
VWCamProp

VWResult setPropertyString VWHCamera  hCam,
VWCamProp  propId,
char *  szValue
 

Sets a string-typed camera property.

Parameters:
propId Identifier of the property.
[in] szValue Property value.
Returns:
VWResult indicating success or failure.
See also:
VWCamProp

VWResult showPropertiesDialog VWHCamera  hCam  ) 
 

Pops up the properties screen associated with this device.

Not supported by all camera libraries.

Parameters:
hCam Handle to video camera.
Returns:
VWResult indicating success or failure.

VWResult startVideo VWHCamera  hCam  ) 
 

Starts aquiring frames from the camera.

Parameters:
hCam Handle to video camera.
Returns:
VWResult indicating success or failure.

VWResult stopVideo VWHCamera  hCam  ) 
 

Stops aquiring frames from the camera.

Parameters:
hCam Handle to video camera.
Returns:
VWResult indicating success or failure.


Generated on Tue Oct 18 12:18:51 2005 for VideoWrapper API by  doxygen 1.4.1