-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathICameraDriver.cs
More file actions
26 lines (23 loc) · 1.01 KB
/
ICameraDriver.cs
File metadata and controls
26 lines (23 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (c) 2025, Phoenix Contact GmbH & Co. KG
// Licensed under the Apache License, Version 2.0
namespace Moryx.AbstractionLayer.Drivers.Camera;
/// <summary>
/// Interface for camera devices, that provide image data
/// </summary>
public interface ICameraDriver<TImage> : IDriver where TImage : class
{
/// <summary>
/// Capture a single image from the camera
/// </summary>
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is None.</param>
/// <returns>
/// The image that was captured or null in case no image
/// could be retrieved
/// </returns>
/// <exception cref="OperationCanceledException">The cancellation token was canceled. This exception is stored into the returned task.</exception>
Task<TImage> CaptureImageAsync(CancellationToken cancellationToken = default);
/// <summary>
/// Event to continuously provide images from a camera
/// </summary>
event EventHandler<TImage> CapturedImage;
}