gml_Grabber.h File Reference


Detailed Description

Declares the interface for accessing video grabbers.

#include "gml/base/gml_Types.h"
#include "gml/base/gml_Errors.h"
#include "gml/image/gml_Bitmap.h"
#include "gml/base/gml_Callback.h"

Go to the source code of this file.


Classes

struct  gml_TGrabberFeature
 Describes a feature or changeable option of the frame grabber. More...
gml_Grabber error codes

enum  gml_TGrabberFeatureType {
  gml_cGrabberOptReduce = 'redu', gml_cGrabberOptSignalFormat = 'form', gml_cGrabberOptSignalFormatPAL = 'pal ', gml_cGrabberOptSignalFormatSECAM = 'seca', gml_cGrabberOptSignalFormatNTSC = 'ntsc',
  gml_cGrabberOptShareKey = 'shmk', gml_cGrabberOptColor = 'colr', gml_cGrabberOptHue = 'hue ', gml_cGrabberOptSaturation = 'satu', gml_cGrabberOptSharpness = 'shrp',
  gml_cGrabberOptBrightness = 'brit', gml_cGrabberOptGain = 'gain', gml_cGrabberOptIris = 'iris', gml_cGrabberOptShutter = 'shtr', gml_cGrabberOptExposure = 'xpsr',
  gml_cGrabberOptWhiteBalanceU = 'whbu', gml_cGrabberOptWhiteBalanceV = 'whbv', gml_cGrabberOptGamma = 'gmma', gml_cGrabberOptTemperature = 'temp', gml_cGrabberOptZoom = 'zoom',
  gml_cGrabberOptFocus = 'fcus', gml_cGrabberOptPan = 'pan ', gml_cGrabberOptTilt = 'tilt'
}
 Standard grabber options. More...
enum  gml_TGrabberFeatureState { gml_cGrabberFlagOn = (1 << 0), gml_cGrabberFlagOff = (1 << 1), gml_cGrabberFlagManual = (1 << 2), gml_cGrabberFlagAuto = (1 << 3), gml_cGrabberFlagTune = (1 << 4) }
 Possible states for grabber features.
typedef void * gml_TGrabber
 A grabber token, returned by "gml_GrabberGet" and subsequently used for all operations on grabbers.
gml_TError gml_gGrabberNoneAvailable
 there is no available grabber
gml_TError gml_gGrabberNoSuchGrabber
 request for a grabber which does not exist
gml_TError gml_gGrabberNoSuchOption
 this option is not handled by the grabber
gml_TError gml_gGrabberReadOnlyOption
 this option is read-only
gml_TError gml_gGrabberInvalidOptionVal
 invalid value for this option
gml_TError gml_gGrabberThreadError
 threading related error
gml_TError gml_gGrabberDriverError
 driver related error
GML_EXTERN_C gml_TError gml_GrabberGet (gml_TGrabberName *name, gml_TGrabber *grabber)
 Gets acces to a grabber.
GML_EXTERN_C void gml_GrabberRelease (gml_TGrabber grabber)
 Releases a grabber.
GML_EXTERN_C gml_TError gml_GrabberList (gml_TGrabberName **names, int *nb)
 Returns an array of string describing the available grabbers.
GML_EXTERN_C gml_TBitmapgml_GrabberGetBitmap (gml_TGrabber grabber)
 Return a pointer to the bitmap where the lastest aquired frame is stored.
GML_EXTERN_C gml_TError gml_GrabberBindOnNewFrame (gml_TGrabber grabber, gml_TCallback callback, gml_TPointer userParam)
 Registers a callback to be called when a new frame has been aquired.
GML_EXTERN_C void gml_GrabberUnbindOnNewFrame (gml_TGrabber grabber, gml_TCallback callback, gml_TPointer userParam)
 De-registers a callback function that was bound to the "new frame available" event.
GML_EXTERN_C gml_TError gml_GrabberGetOption (gml_TGrabber grabber, gml_TGrabberFeature *option)
 Return the value of a grabber option in option.
GML_EXTERN_C gml_TError gml_GrabberSetOption (gml_TGrabber grabber, gml_TGrabberFeature *option)
 Change the value or flags of an option.
GML_EXTERN_C gml_TError gml_GrabberGetName (gml_TGrabber grabber, gml_TGrabberName name)
 Return a human-readable name for the grabber.
GML_EXTERN_C gml_TError gml_GrabberSettingsDialog (gml_TGrabber grabber, int display, int *exists)
 Query about and display a system-level dialog window that allows the user to set the grabber's settings.

Defines

#define GML_GRABBER_NAME_MAX   255

Typedefs

typedef char gml_TGrabberName [GML_GRABBER_NAME_MAX+1]
 Stores a human-readable description of a grabber.

Enumeration Type Documentation

Standard grabber options.

In general, can be read and written.

Enumerator:
gml_cGrabberOptReduce  int, decimation factor from native size.

gml_cGrabberOptSignalFormat  int, possible values following
gml_cGrabberOptShareKey  UInt32, the grabber sharing key (unsigned long, r/o).
gml_cGrabberOptColor  int, wether to grab color (int, default true)


Function Documentation

GML_EXTERN_C gml_TError gml_GrabberGet ( gml_TGrabberName name,
gml_TGrabber grabber 
)

Gets acces to a grabber.

Parameters:
name the name of the grabber we need to get access to. NULL means first available grabber.
grabber is set to point to the requested grabber.

GML_EXTERN_C gml_TError gml_GrabberList ( gml_TGrabberName **  names,
int *  nb 
)

Returns an array of string describing the available grabbers.

Parameters:
names on successful return, an array of fixed strings. names is allocated by gml_GrabberDescrs and must not be freed by the caller.
nb on successful return, the number of available grabbers.

GML_EXTERN_C gml_TBitmap* gml_GrabberGetBitmap ( gml_TGrabber  grabber  ) 

Return a pointer to the bitmap where the lastest aquired frame is stored.

Bug:
This is what this function should be designed to do: Returns a pointer to the oldest available aquired frame, and remove it from a queue of available frames. Return NULL if no frame is available. This function may only be called inside the registered event handler. Note that this function will not return the same frame twice.

GML_EXTERN_C gml_TError gml_GrabberBindOnNewFrame ( gml_TGrabber  grabber,
gml_TCallback  callback,
gml_TPointer  userParam 
)

Registers a callback to be called when a new frame has been aquired.

Only one callback is memorized: every call erases the previous callback address and parameter.

Parameters:
callback the callback function. NULL means remove any bound callback.
userParam a parameter that will be provided when the callback in invoked.

GML_EXTERN_C void gml_GrabberUnbindOnNewFrame ( gml_TGrabber  grabber,
gml_TCallback  callback,
gml_TPointer  userParam 
)

De-registers a callback function that was bound to the "new frame available" event.

See gml_GrabberBindOnNewFrame().

GML_EXTERN_C gml_TError gml_GrabberGetOption ( gml_TGrabber  grabber,
gml_TGrabberFeature option 
)

Return the value of a grabber option in option.

The queried option is specified by the type field of option.

GML_EXTERN_C gml_TError gml_GrabberSetOption ( gml_TGrabber  grabber,
gml_TGrabberFeature option 
)

Change the value or flags of an option.

The queried option is specified by the type field of option.

GML_EXTERN_C gml_TError gml_GrabberSettingsDialog ( gml_TGrabber  grabber,
int  display,
int *  exists 
)

Query about and display a system-level dialog window that allows the user to set the grabber's settings.

Parameters:
display a boolean: if not 0, request that the dialog be displayed if it exists.
exists a boolean: on return, the int pointed at is set to 0 if there is no such a dialog. Can be set to NULL if not interested.

Generated on Tue Jun 12 14:03:28 2007 for gml by Doxygen 1.5.2.