Repository navigation
Expand file tree
/
Copy pathDebugCamera.cs
More file actions
86 lines (69 loc) · 1.94 KB
/
Copy pathDebugCamera.cs
File metadata and controls
86 lines (69 loc) · 1.94 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
using Avalonia;
namespace Scopie;
internal sealed class DebugCamera(DeviceImage[] debugImages) : PushEnumerable<DeviceImage>, ICamera
{
private int _currentIndex;
public void Dispose()
{
}
public ScanResult CameraId => new("debug", "debug");
public event Action<List<CameraControlValue>>? OnControlsUpdated
{
add { }
remove { }
}
public bool Exposing
{
set { }
}
public Task Init()
{
return Task.CompletedTask;
}
public Task<ChipInfo> GetChipInfoAsync()
{
return Task.FromResult(new ChipInfo(debugImages[_currentIndex].Width, debugImages[_currentIndex].Height, debugImages[_currentIndex].Width, debugImages[_currentIndex].Height, 1.0, 1.0, (uint)debugImages[_currentIndex].Metadata.BitsPerPixel));
}
public Task<EffectiveArea> GetEffectiveAreaAsync()
{
return Task.FromResult(new EffectiveArea(0u, 0u, debugImages[_currentIndex].Width, debugImages[_currentIndex].Height));
}
public Task<string> GetFastReadoutStatusAsync()
{
return Task.FromResult("fast readout status");
}
public Task<string> GetSdkVersionAsync()
{
return Task.FromResult("1.0");
}
public Task<string> GetFirmwareVersionAsync()
{
return Task.FromResult("1.0");
}
public Task<string> GetFpgaVersionAsync()
{
return Task.FromResult("1.0");
}
public Task HardwareCrop(PixelRect rect)
{
return Task.CompletedTask;
}
public Task ResetHardwareCrop()
{
return Task.CompletedTask;
}
public void SetControl(CameraControl control, double value)
{
}
public void Push(int n)
{
ThreadPool.QueueUserWorkItem(_ =>
{
for (var i = 0; i < n; i++)
{
Push(debugImages[_currentIndex]);
_currentIndex = (_currentIndex + 1).Mod(debugImages.Length);
}
});
}
}