Simply3DScan
Simple3DScan.UI.CameraControl Class Reference

Control for accessing a camera More...

Inheritance diagram for Simple3DScan.UI.CameraControl:
Collaboration diagram for Simple3DScan.UI.CameraControl:

Public Member Functions

 CameraControl ()
 Initializes a new instance of the CameraControl class. More...
 
void StartImaging (string source)
 Starts the imaging. More...
 
void StopImaging ()
 Stops the imaging. More...
 

Package Functions

Image GetNextPicture ()
 Gets the next picture. More...
 

Properties

bool CaptureNextImage [get]
 Gets a value indicating whether [capture next image]. More...
 
bool FilterLaser [get, set]
 Gets a value indicating whether [filter laser]. More...
 
bool ShowLaserLine [get, set]
 Gets or sets a value indicating whether [show laser line]. More...
 
float LaserLeftPosition [get, set]
 Gets or sets the laser left position. More...
 
float LaserRightPosition [get, set]
 Gets or sets the laser right position. More...
 
bool LaserMotorEnabled [get, set]
 Gets or sets a value indicating whether [laser motor enabled]. More...
 

Detailed Description

Control for accessing a camera

Definition at line 17 of file CameraControl.cs.

Constructor & Destructor Documentation

Simple3DScan.UI.CameraControl.CameraControl ( )

Initializes a new instance of the CameraControl class.

Definition at line 83 of file CameraControl.cs.

84  {
85  if(!this.DesignMode)
86  this.InitializeComponent();
87  }

Member Function Documentation

Image Simple3DScan.UI.CameraControl.GetNextPicture ( )
package

Gets the next picture.

Returns

Definition at line 284 of file CameraControl.cs.

285  {
286  lock (this.pulseObject)
287  {
288  this.CaptureNextImage = true;
289  Monitor.Wait(this.pulseObject);
290  }
291  lock (this.pulseObject)
292  {
293  this.CaptureNextImage = true;
294  Monitor.Wait(this.pulseObject);
295  }
296  return this.nextImage;
297  }
bool CaptureNextImage
Gets a value indicating whether [capture next image].

Here is the caller graph for this function:

void Simple3DScan.UI.CameraControl.StartImaging ( string  source)

Starts the imaging.

Parameters
sourceThe source.

Definition at line 121 of file CameraControl.cs.

122  {
123  if (!this.videoSources.ContainsKey(source))
124  {
125  this.videoSources.Clear();
126  this.InitVideoSources();
127  if (!this.videoSources.ContainsKey(source))
128  return;
129  }
130 
131  this.StopImaging();
132 
133  this.videoSource = new VideoCaptureDevice(this.videoSources[source]);
134 
135  if (this.videoSource.VideoCapabilities.Length > 0)
136  {
137  VideoCapabilities max = this.videoSource.VideoCapabilities.OrderBy(p => p.FrameSize.Width).Last();
138  this.videoSource.VideoResolution = max;
139  }
140 
141  this.videoSource.NewFrame += this.videoSource_NewFrame;
142  this.videoSource.Start();
143  }
void StopImaging()
Stops the imaging.
void Simple3DScan.UI.CameraControl.StopImaging ( )

Stops the imaging.

Definition at line 269 of file CameraControl.cs.

270  {
271  if (this.videoSource == null || !this.videoSource.IsRunning)
272  return;
273 
274  this.videoSource.SignalToStop();
275  this.videoSource = null;
276  }

Property Documentation

bool Simple3DScan.UI.CameraControl.CaptureNextImage
get

Gets a value indicating whether [capture next image].

true if [capture next image]; otherwise, false.

Definition at line 37 of file CameraControl.cs.

bool Simple3DScan.UI.CameraControl.FilterLaser
getset

Gets a value indicating whether [filter laser].

true if [filter laser]; otherwise, false.

Definition at line 48 of file CameraControl.cs.

float Simple3DScan.UI.CameraControl.LaserLeftPosition
getset

Gets or sets the laser left position.

The laser left position.

Definition at line 62 of file CameraControl.cs.

bool Simple3DScan.UI.CameraControl.LaserMotorEnabled
getset

Gets or sets a value indicating whether [laser motor enabled].

true if [laser motor enabled]; otherwise, false.

Definition at line 76 of file CameraControl.cs.

float Simple3DScan.UI.CameraControl.LaserRightPosition
getset

Gets or sets the laser right position.

The laser right position.

Definition at line 69 of file CameraControl.cs.

bool Simple3DScan.UI.CameraControl.ShowLaserLine
getset

Gets or sets a value indicating whether [show laser line].

true if [show laser line]; otherwise, false.

Definition at line 55 of file CameraControl.cs.


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