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 280 of file CameraControl.cs.

281  {
282  lock (this.pulseObject)
283  {
284  this.CaptureNextImage = true;
285  Monitor.Wait(this.pulseObject);
286  }
287  lock (this.pulseObject)
288  {
289  this.CaptureNextImage = true;
290  Monitor.Wait(this.pulseObject);
291  }
292  return this.nextImage;
293  }
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 119 of file CameraControl.cs.

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

Stops the imaging.

Definition at line 265 of file CameraControl.cs.

266  {
267  if (this.videoSource == null || !this.videoSource.IsRunning)
268  return;
269 
270  this.videoSource.SignalToStop();
271  this.videoSource = null;
272  }

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: