C# Class GtkZBar.Scanner

Inheritance: Gtk.DrawingArea
Show file Open project: jonasfj/zbar-sharp

Public Methods

Method Description
Close ( ) : void
ListVideoSources ( ) : string>.IDictionary

List potential video sources on the system

This just adds a default device without checking it's existance on Windows. On Linux this list all /dev/video* devices, and attempts to get their name using /lib/udev/v4l_id, watch the kernel source (link available in source comments) to that this remains compatible. Alternately, define UDEV_RULES and the "/dev/v4l/by-id/" symlinks will be used to find the names. Note this presumably depends on Ubuntu 9.10 udev rules. Thus the other approach is preffered. Note that on Linux this might be solve a lot better using HAL over dbus, however, last I checked HAL is being replaced by DeviceKit which isn't done yet, so unless the APIs are expected to remain stable HAL is a waste of time.

Open ( string device ) : void

Open a video device

ResetLastItemScanned ( ) : void

Resets the last item scanned

This method may only be called from UI-thread.

Scanner ( ) : System

Protected Methods

Method Description
OnExposeEvent ( Gdk ev ) : bool
OnSizeAllocated ( Gdk allocation ) : void
OnSizeRequested ( Gtk &requisition ) : void

Private Methods

Method Description
CaptureVideo ( Video video, ImageScanner scanner ) : void

Capture and scan images

This method will also flip the images so that they need not be flipped when drawing.

HandleDestroyed ( object sender, EventArgs e ) : void
ProcessVideo ( ) : void

Process video, the worker thread

ThreadSafeRedraw ( ) : void

Simple threadsafe redraw method

Method Details

Close() public method

public Close ( ) : void
return void

ListVideoSources() public static method

List potential video sources on the system
This just adds a default device without checking it's existance on Windows. On Linux this list all /dev/video* devices, and attempts to get their name using /lib/udev/v4l_id, watch the kernel source (link available in source comments) to that this remains compatible. Alternately, define UDEV_RULES and the "/dev/v4l/by-id/" symlinks will be used to find the names. Note this presumably depends on Ubuntu 9.10 udev rules. Thus the other approach is preffered. Note that on Linux this might be solve a lot better using HAL over dbus, however, last I checked HAL is being replaced by DeviceKit which isn't done yet, so unless the APIs are expected to remain stable HAL is a waste of time.
public static ListVideoSources ( ) : string>.IDictionary
return string>.IDictionary

OnExposeEvent() protected method

protected OnExposeEvent ( Gdk ev ) : bool
ev Gdk
return bool

OnSizeAllocated() protected method

protected OnSizeAllocated ( Gdk allocation ) : void
allocation Gdk
return void

OnSizeRequested() protected method

protected OnSizeRequested ( Gtk &requisition ) : void
requisition Gtk
return void

Open() public method

Open a video device
public Open ( string device ) : void
device string /// Video device to open ///
return void

ResetLastItemScanned() public method

Resets the last item scanned
This method may only be called from UI-thread.
public ResetLastItemScanned ( ) : void
return void

Scanner() public method

public Scanner ( ) : System
return System