ZBar.Video Class Reference

Mid-level video source abstraction. captures images from a video device. More...

List of all members.

Public Member Functions

 Video ()
 Create a video instance.
void Open (string device)
 Open and probe a video device.
void Close ()
 Close the video device.
void RequestSize (uint width, uint height)
 Request a other output image size.
Image NextFrame ()
 Retrieve next captured image.
void Dispose ()
 Release resources held by this object.

Protected Member Functions

virtual void Dispose (bool disposing)
 Dispose this object.

Properties

bool Enabled [get, set]
int Width [get]
int Height [get]

Private Member Functions

 ~Video ()
 Finalize this object.
static IntPtr zbar_video_create ()
 constructor.
static void zbar_video_destroy (IntPtr video)
 destructor.
static int zbar_video_open (IntPtr video, string device)
 open and probe a video device. the device specified by platform specific unique name (v4l device node path in *nix eg "/dev/video", DirectShow DevicePath property in windows).
static int zbar_video_get_fd (IntPtr video)
 retrieve file descriptor associated with open *nix video device useful for using select()/poll() to tell when new images are available (NB v4l2 only!!).
static int zbar_video_request_size (IntPtr video, uint width, uint height)
 request a preferred size for the video image from the device. the request may be adjusted or completely ignored by the driver.
static int zbar_video_request_interface (IntPtr video, int version)
 request a preferred driver interface version for debug/testing.
static int zbar_video_request_iomode (IntPtr video, int iomode)
 request a preferred I/O mode for debug/testing.
static int zbar_video_get_width (IntPtr video)
 retrieve current output image width.
static int zbar_video_get_height (IntPtr video)
 retrieve current output image height.
static int zbar_video_init (IntPtr video, uint format)
 initialize video using a specific format for debug. use zbar_negotiate_format() to automatically select and initialize the best available format
static int zbar_video_enable (IntPtr video, int enable)
 start/stop video capture. all buffered images are retired when capture is disabled.
static IntPtr zbar_video_next_image (IntPtr video)
 retrieve next captured image. blocks until an image is available.

Private Attributes

IntPtr video = IntPtr.Zero
bool enabled = false

Detailed Description

Mid-level video source abstraction. captures images from a video device.

Definition at line 35 of file Video.cs.


Constructor & Destructor Documentation

ZBar.Video.Video (  ) 

Create a video instance.

Definition at line 43 of file Video.cs.

ZBar.Video.~Video (  )  [private]

Finalize this object.

Definition at line 180 of file Video.cs.


Member Function Documentation

void ZBar.Video.Close (  ) 

Close the video device.

Definition at line 66 of file Video.cs.

void ZBar.Video.Dispose (  ) 

Release resources held by this object.

Definition at line 171 of file Video.cs.

virtual void ZBar.Video.Dispose ( bool  disposing  )  [protected, virtual]

Dispose this object.

This boolean disposing parameter here ensures that objects with a finalizer is not disposed, this is method is invoked from the finalizer. Do overwrite, and call, this method in base classes if you use any unmanaged resources.

Parameters:
disposing A System.Boolean False if called from the finalizer, True if called from Dispose.

Definition at line 158 of file Video.cs.

Image ZBar.Video.NextFrame (  ) 

Retrieve next captured image.

This method blocks untill an image have been captured.

Returns:
A Image representating the next image captured

Definition at line 134 of file Video.cs.

void ZBar.Video.Open ( string  device  ) 

Open and probe a video device.

Parameters:
device The device specified by platform specific unique name (v4l device node path in *nix eg "/dev/video", DirectShow DevicePath property in windows).

Definition at line 57 of file Video.cs.

void ZBar.Video.RequestSize ( uint  width,
uint  height 
)

Request a other output image size.

The request may be adjusted or completely ignored by the driver.

Parameters:
width Desired output width
height Desired output height

Definition at line 122 of file Video.cs.

static IntPtr ZBar.Video.zbar_video_create (  )  [private]

constructor.

static void ZBar.Video.zbar_video_destroy ( IntPtr  video  )  [private]

destructor.

static int ZBar.Video.zbar_video_enable ( IntPtr  video,
int  enable 
) [private]

start/stop video capture. all buffered images are retired when capture is disabled.

Returns:
0 if successful or -1 if an error occurs
static int ZBar.Video.zbar_video_get_fd ( IntPtr  video  )  [private]

retrieve file descriptor associated with open *nix video device useful for using select()/poll() to tell when new images are available (NB v4l2 only!!).

Returns:
the file descriptor or -1 if the video device is not open or the driver only supports v4l1
static int ZBar.Video.zbar_video_get_height ( IntPtr  video  )  [private]

retrieve current output image height.

Returns:
the height or 0 if the video device is not open
static int ZBar.Video.zbar_video_get_width ( IntPtr  video  )  [private]

retrieve current output image width.

Returns:
the width or 0 if the video device is not open
static int ZBar.Video.zbar_video_init ( IntPtr  video,
uint  format 
) [private]

initialize video using a specific format for debug. use zbar_negotiate_format() to automatically select and initialize the best available format

static IntPtr ZBar.Video.zbar_video_next_image ( IntPtr  video  )  [private]

retrieve next captured image. blocks until an image is available.

Returns:
NULL if video is not enabled or an error occurs
static int ZBar.Video.zbar_video_open ( IntPtr  video,
string  device 
) [private]

open and probe a video device. the device specified by platform specific unique name (v4l device node path in *nix eg "/dev/video", DirectShow DevicePath property in windows).

Returns:
0 if successful or -1 if an error occurs
static int ZBar.Video.zbar_video_request_interface ( IntPtr  video,
int  version 
) [private]

request a preferred driver interface version for debug/testing.

static int ZBar.Video.zbar_video_request_iomode ( IntPtr  video,
int  iomode 
) [private]

request a preferred I/O mode for debug/testing.

You will get errors if the driver does not support the specified mode.

		///     0 = auto-detect
		///     1 = force I/O using read()
		///     2 = force memory mapped I/O using mmap()
		///     3 = force USERPTR I/O (v4l2 only)
		/// 

must be called before zbar_video_open()

static int ZBar.Video.zbar_video_request_size ( IntPtr  video,
uint  width,
uint  height 
) [private]

request a preferred size for the video image from the device. the request may be adjusted or completely ignored by the driver.

Returns:
0 if successful or -1 if the video device is already initialized

Member Data Documentation

bool ZBar.Video.enabled = false [private]

Definition at line 38 of file Video.cs.

IntPtr ZBar.Video.video = IntPtr.Zero [private]

Definition at line 37 of file Video.cs.


Property Documentation

bool ZBar.Video.Enabled [get, set]

Start/stop video capture, must be called after Open()

Definition at line 75 of file Video.cs.

int ZBar.Video.Height [get]

Get output image height

Definition at line 101 of file Video.cs.

int ZBar.Video.Width [get]

Get output handle width

Definition at line 89 of file Video.cs.


The documentation for this class was generated from the following file:

Foodolini 1.0.0 Documentation, generated with DoxyGen.